From 1e41b55f50a8f1bdca96ef69f6ce4edb45a26be8 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:48:22 +0100 Subject: [PATCH] More keybindings (#16329) * Macros+functions+changelog * Fixed changelog mistype * Readded the old up/down keybinds, added preference for the toggle * Removed toggle as requested by head dev * sf --- code/modules/mob/living/living.dm | 38 ++++++++++ html/changelogs/fluffyghost-morekeymaps.yml | 44 +++++++++++ interface/skin.dmf | 83 +++++++++++++++++++-- 3 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 html/changelogs/fluffyghost-morekeymaps.yml diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e27e503f5ec..8b2dc0fddb8 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1023,6 +1023,44 @@ default behaviour is: if(hud_used?.move_intent) hud_used.move_intent.Click() +/** + * Used by a macro in skin.dmf to toggle the throw + */ +/mob/living/verb/throw_intent_keyDown() + set hidden = 1 + set name = "throw_intent" + if(!(src.in_throw_mode)) + toggle_throw_mode() + +/mob/living/verb/throw_intent_keyUp() + set hidden = 1 + set name = "throw_intent_up" + if(src.in_throw_mode) + toggle_throw_mode() + +/** + * User by a macro in skin.dmf to toggle the running + */ +/mob/living/verb/run_intent_keyDown() + set hidden = 1 + set name = "run_intent" + + if(usr?.m_intent != M_WALK) + return + + if(hud_used?.move_intent) + hud_used.move_intent.Click() + +/mob/living/verb/run_intent_keyUp() + set hidden = 1 + set name = "run_intent_up" + + if(usr?.m_intent != M_RUN) + return + + if(hud_used?.move_intent) + hud_used.move_intent.Click() + /mob/living/proc/add_hallucinate(var/amount) hallucination += amount hallucination += amount diff --git a/html/changelogs/fluffyghost-morekeymaps.yml b/html/changelogs/fluffyghost-morekeymaps.yml new file mode 100644 index 00000000000..dd174dcf895 --- /dev/null +++ b/html/changelogs/fluffyghost-morekeymaps.yml @@ -0,0 +1,44 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Fluffyghost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added keymap R, to enable throw mode, lifting the R key disables throw mode, clicking the HUD icon works as before (toggle)." + - rscadd: "Added keymap SPACE, to enable run mode, lifting the SPACE key disables run mode, clicking the HUD icon works as before (toggle)." + - rscadd: "Added SHIFT+R as a keymap to resist." + - rscadd: "Added CTRL+PGUP/CTRL+PGDOWN as a keymap to Move-upwards and Move-down, respectively." diff --git a/interface/skin.dmf b/interface/skin.dmf index 15b9414c9a9..2c2c1603dc2 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -122,9 +122,6 @@ macro "borghotkeymode" elem name = "CTRL+Q" command = "unequip-module" - elem - name = "R" - command = ".southwest" elem name = "CTRL+R" command = ".southwest" @@ -218,6 +215,19 @@ macro "borghotkeymode" elem name = "NUMPAD3" command = "body-l-leg" + elem + name = "CTRL+Northeast" + command = "Move-Upwards" + elem + name = "CTRL+Southeast" + command = "Move-Down" + elem + name = "," + command = "Move-Upwards" + elem + name = "." + command = "Move-Down" + macro "macro" elem @@ -388,6 +398,34 @@ macro "macro" elem name = "CTRL+NUMPAD3" command = "body-l-leg" + elem + name = "CTRL+Northeast" + command = "Move-Upwards" + elem + name = "CTRL+Southeast" + command = "Move-Down" + elem + name = "," + command = "Move-Upwards" + elem + name = "." + command = "Move-Down" + elem + name = "Space" + command = "run_intent" + elem + name = "Space+UP" + command = "run_intent_up" + elem + name = "SHIFT+R" + command = "Resist" + elem + name = "R" + command = "throw_intent" + elem + name = "R+UP" + command = "throw_intent_up" + macro "hotkeymode" elem @@ -525,9 +563,6 @@ macro "hotkeymode" elem name = "CTRL+Q" command = ".northwest" - elem - name = "R" - command = ".southwest" elem name = "CTRL+R" command = ".southwest" @@ -621,12 +656,34 @@ macro "hotkeymode" elem name = "NUMPAD3" command = "body-l-leg" + elem + name = "CTRL+Northeast" + command = "Move-Upwards" + elem + name = "CTRL+Southeast" + command = "Move-Down" elem name = "," command = "move-upwards" elem name = "." - command = "move-down" + command = "Move-Down" + elem + name = "Space" + command = "run_intent" + elem + name = "Space+UP" + command = "run_intent_up" + elem + name = "SHIFT+R" + command = "Resist" + elem + name = "R" + command = "throw_intent" + elem + name = "R+UP" + command = "throw_intent_up" + macro "borgmacro" elem @@ -791,6 +848,18 @@ macro "borgmacro" elem name = "CTRL+NUMPAD3" command = "body-l-leg" + elem + name = "CTRL+Northeast" + command = "Move-Upwards" + elem + name = "CTRL+Southeast" + command = "Move-Down" + elem + name = "," + command = "Move-Upwards" + elem + name = "." + command = "Move-Down" menu "menu"