From ca55e5f8b066d1552731102fa3527fdb01a600ee Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 14 Nov 2019 16:36:55 -0700 Subject: [PATCH 1/4] Merge pull request #9804 from Ghommie/Ghommie-cit351 Unmodularize keybindings. --- code/modules/keybindings/bindings_carbon.dm | 3 +++ code/modules/keybindings/bindings_human.dm | 12 +++++++++++- code/modules/keybindings/bindings_robot.dm | 12 +++++++++++- .../code/modules/keybindings/bindings_carbon.dm | 6 ------ .../code/modules/keybindings/bindings_human.dm | 13 ------------- .../code/modules/keybindings/bindings_robot.dm | 13 ------------- tgstation.dme | 3 --- 7 files changed, 25 insertions(+), 37 deletions(-) delete mode 100644 modular_citadel/code/modules/keybindings/bindings_carbon.dm delete mode 100644 modular_citadel/code/modules/keybindings/bindings_human.dm delete mode 100644 modular_citadel/code/modules/keybindings/bindings_robot.dm diff --git a/code/modules/keybindings/bindings_carbon.dm b/code/modules/keybindings/bindings_carbon.dm index d17f10e9..a982273c 100644 --- a/code/modules/keybindings/bindings_carbon.dm +++ b/code/modules/keybindings/bindings_carbon.dm @@ -15,4 +15,7 @@ if("4") a_intent_change("harm") return + if("C") + toggle_combat_mode() + return return ..() \ No newline at end of file diff --git a/code/modules/keybindings/bindings_human.dm b/code/modules/keybindings/bindings_human.dm index 5d02d9ae..38870c38 100644 --- a/code/modules/keybindings/bindings_human.dm +++ b/code/modules/keybindings/bindings_human.dm @@ -1,4 +1,7 @@ /mob/living/carbon/human/key_down(_key, client/user) + if("Shift") + sprint_hotkey(TRUE) + return if(client.keys_held["Shift"]) switch(_key) if("E") // Put held thing in belt or take out most recent thing from belt @@ -56,4 +59,11 @@ return stored.attack_hand(src) // take out thing from backpack return - return ..() \ No newline at end of file + return ..() + +/mob/living/carbon/human/key_up(_key, client/user) + switch(_key) + if("Shift") + sprint_hotkey(FALSE) + return + return ..() diff --git a/code/modules/keybindings/bindings_robot.dm b/code/modules/keybindings/bindings_robot.dm index 2354f33c..29fb36fa 100644 --- a/code/modules/keybindings/bindings_robot.dm +++ b/code/modules/keybindings/bindings_robot.dm @@ -9,4 +9,14 @@ if("Q") uneq_active() return - return ..() \ No newline at end of file + if("Shift") + sprint_hotkey(TRUE) + return + return ..() + +/mob/living/silicon/robot/key_up(_key, client/user) + switch(_key) + if("Shift") + sprint_hotkey(FALSE) + return + return ..() diff --git a/modular_citadel/code/modules/keybindings/bindings_carbon.dm b/modular_citadel/code/modules/keybindings/bindings_carbon.dm deleted file mode 100644 index d49cbcf4..00000000 --- a/modular_citadel/code/modules/keybindings/bindings_carbon.dm +++ /dev/null @@ -1,6 +0,0 @@ -/mob/living/carbon/key_down(_key, client/user) - switch(_key) - if("C") - toggle_combat_mode() - return - return ..() diff --git a/modular_citadel/code/modules/keybindings/bindings_human.dm b/modular_citadel/code/modules/keybindings/bindings_human.dm deleted file mode 100644 index ffe88bd4..00000000 --- a/modular_citadel/code/modules/keybindings/bindings_human.dm +++ /dev/null @@ -1,13 +0,0 @@ -/mob/living/carbon/human/key_down(_key, client/user) - switch(_key) - if("Shift") - sprint_hotkey(TRUE) - return - return ..() - -/mob/living/carbon/human/key_up(_key, client/user) - switch(_key) - if("Shift") - sprint_hotkey(FALSE) - return - return ..() diff --git a/modular_citadel/code/modules/keybindings/bindings_robot.dm b/modular_citadel/code/modules/keybindings/bindings_robot.dm deleted file mode 100644 index d3b6248f..00000000 --- a/modular_citadel/code/modules/keybindings/bindings_robot.dm +++ /dev/null @@ -1,13 +0,0 @@ -/mob/living/silicon/robot/key_down(_key, client/user) - switch(_key) - if("Shift") - sprint_hotkey(TRUE) - return - return ..() - -/mob/living/silicon/robot/key_up(_key, client/user) - switch(_key) - if("Shift") - sprint_hotkey(FALSE) - return - return ..() diff --git a/tgstation.dme b/tgstation.dme index 0c4aed70..f53f9053 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3192,9 +3192,6 @@ #include "modular_citadel\code\modules\food_and_drinks\snacks\meat.dm" #include "modular_citadel\code\modules\integrated_electronics\subtypes\manipulation.dm" #include "modular_citadel\code\modules\jobs\dresscode_values.dm" -#include "modular_citadel\code\modules\keybindings\bindings_carbon.dm" -#include "modular_citadel\code\modules\keybindings\bindings_human.dm" -#include "modular_citadel\code\modules\keybindings\bindings_robot.dm" #include "modular_citadel\code\modules\mentor\follow.dm" #include "modular_citadel\code\modules\mentor\mentor.dm" #include "modular_citadel\code\modules\mentor\mentor_memo.dm" From 6810aa0a94b6e3860da799f38102474459d251f6 Mon Sep 17 00:00:00 2001 From: Lin Date: Thu, 19 Dec 2019 23:42:06 +0000 Subject: [PATCH 2/4] Merge pull request #10214 from Ghommie/Ghommie-cit472 Brings carbon action intent hotkeys down to living. --- code/modules/keybindings/bindings_carbon.dm | 12 ------------ code/modules/keybindings/bindings_living.dm | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/code/modules/keybindings/bindings_carbon.dm b/code/modules/keybindings/bindings_carbon.dm index a982273c..eef170ce 100644 --- a/code/modules/keybindings/bindings_carbon.dm +++ b/code/modules/keybindings/bindings_carbon.dm @@ -3,18 +3,6 @@ if("R", "Southwest") // Southwest is End toggle_throw_mode() return - if("1") - a_intent_change("help") - return - if("2") - a_intent_change("disarm") - return - if("3") - a_intent_change("grab") - return - if("4") - a_intent_change("harm") - return if("C") toggle_combat_mode() return diff --git a/code/modules/keybindings/bindings_living.dm b/code/modules/keybindings/bindings_living.dm index 7ae8b996..0a9a7ef8 100644 --- a/code/modules/keybindings/bindings_living.dm +++ b/code/modules/keybindings/bindings_living.dm @@ -3,5 +3,22 @@ if("B") resist() return + if("1") + if(possible_a_intents) + a_intent_change(INTENT_HELP) + return + if("2") + if(possible_a_intents) + a_intent_change(INTENT_DISARM) + return + if("3") + if(possible_a_intents) + a_intent_change(INTENT_GRAB) + return + if("4") + if(possible_a_intents) + a_intent_change(INTENT_HARM) + return + return ..() From 00a753d6322c170e1bd4430399b25dff21594674 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sat, 16 Nov 2019 03:02:43 -0700 Subject: [PATCH 3/4] Merge pull request #9817 from Ghommie/Ghommie-cit357 Fixing a keybinding issue. --- code/modules/keybindings/bindings_human.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/keybindings/bindings_human.dm b/code/modules/keybindings/bindings_human.dm index 38870c38..a9eaface 100644 --- a/code/modules/keybindings/bindings_human.dm +++ b/code/modules/keybindings/bindings_human.dm @@ -1,7 +1,4 @@ /mob/living/carbon/human/key_down(_key, client/user) - if("Shift") - sprint_hotkey(TRUE) - return if(client.keys_held["Shift"]) switch(_key) if("E") // Put held thing in belt or take out most recent thing from belt @@ -59,6 +56,10 @@ return stored.attack_hand(src) // take out thing from backpack return + switch(_key) + if("Shift") + sprint_hotkey(TRUE) + return return ..() /mob/living/carbon/human/key_up(_key, client/user) From 21cbe5095ad477ebb3513cc2c8952f80d0b0ee50 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Tue, 31 Dec 2019 19:29:47 -0800 Subject: [PATCH 4/4] Merge pull request #10356 from deathride58/sprintprefs Adds space to sprint and toggle sprint as preferences --- code/modules/client/preferences.dm | 11 +++++++++++ code/modules/client/preferences_savefile.dm | 6 ++++++ code/modules/keybindings/bindings_human.dm | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index db412292..6606a846 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -225,6 +225,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/auto_fit_viewport = TRUE var/uplink_spawn_loc = UPLINK_PDA + + var/sprint_spacebar = FALSE + var/sprint_toggle = FALSE var/list/exp = list() var/list/menuoptions @@ -1014,6 +1017,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "
" dat += "Ambient Occlusion: [ambientocclusion ? "Enabled" : "Disabled"]
" dat += "Fit Viewport: [auto_fit_viewport ? "Auto" : "Manual"]
" + dat += "Sprint Key: [sprint_spacebar ? "Space" : "Shift"]
" + dat += "Toggle Sprint: [sprint_toggle ? "Enabled" : "Disabled"]
" if (CONFIG_GET(flag/maprotation) && CONFIG_GET(flag/tgstyle_maprotation)) var/p_map = preferred_map @@ -2521,6 +2526,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(auto_fit_viewport && parent) parent.fit_viewport() + if("sprint_key") + sprint_spacebar = !sprint_spacebar + + if("sprint_toggle") + sprint_toggle = !sprint_toggle + if("save") save_preferences() save_character() diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 1de8ccf0..76c98014 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -116,6 +116,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["parallax"] >> parallax S["ambientocclusion"] >> ambientocclusion S["auto_fit_viewport"] >> auto_fit_viewport + S["sprint_spacebar"] >> sprint_spacebar + S["sprint_toggle"] >> sprint_toggle S["menuoptions"] >> menuoptions S["enable_tips"] >> enable_tips S["tip_delay"] >> tip_delay @@ -161,6 +163,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null) ambientocclusion = sanitize_integer(ambientocclusion, 0, 1, initial(ambientocclusion)) auto_fit_viewport = sanitize_integer(auto_fit_viewport, 0, 1, initial(auto_fit_viewport)) + sprint_spacebar = sanitize_integer(sprint_spacebar, 0, 1, initial(sprint_spacebar)) + sprint_toggle = sanitize_integer(sprint_toggle, 0, 1, initial(sprint_toggle)) ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form)) ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit)) ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION) @@ -226,6 +230,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["parallax"], parallax) WRITE_FILE(S["ambientocclusion"], ambientocclusion) WRITE_FILE(S["auto_fit_viewport"], auto_fit_viewport) + WRITE_FILE(S["sprint_spacebar"], sprint_spacebar) + WRITE_FILE(S["sprint_toggle"], sprint_toggle) WRITE_FILE(S["menuoptions"], menuoptions) WRITE_FILE(S["enable_tips"], enable_tips) WRITE_FILE(S["tip_delay"], tip_delay) diff --git a/code/modules/keybindings/bindings_human.dm b/code/modules/keybindings/bindings_human.dm index a9eaface..ed033935 100644 --- a/code/modules/keybindings/bindings_human.dm +++ b/code/modules/keybindings/bindings_human.dm @@ -58,13 +58,23 @@ return switch(_key) if("Shift") - sprint_hotkey(TRUE) + if(!user.prefs.sprint_spacebar) + user.prefs.sprint_toggle ? togglesprint() : sprint_hotkey(TRUE) //Yes, this looks hacky. Yes, this works. + return + if("Space") + if(user.prefs.sprint_spacebar) + user.prefs.sprint_toggle ? togglesprint() : sprint_hotkey(TRUE) return return ..() /mob/living/carbon/human/key_up(_key, client/user) switch(_key) if("Shift") - sprint_hotkey(FALSE) + if(!user.prefs.sprint_spacebar && !user.prefs.sprint_toggle) + sprint_hotkey(FALSE) + return + if("Space") + if(user.prefs.sprint_spacebar && !user.prefs.sprint_toggle) + sprint_hotkey(FALSE) return return ..()