From ead209f5071e10611cbdf3c55828c96ecd1aea80 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 27 Nov 2020 06:31:05 -0700
Subject: [PATCH] sigh
---
code/modules/client/client_defines.dm | 2 +
code/modules/client/client_procs.dm | 2 +-
code/modules/client/preferences.dm | 26 +++++----
code/modules/keybindings/keybind/_keybind.dm | 4 ++
.../keybindings/keybind/communication.dm | 7 +++
code/modules/keybindings/keybind/movement.dm | 1 +
code/modules/keybindings/setup.dm | 56 ++++++++++---------
7 files changed, 61 insertions(+), 37 deletions(-)
diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm
index 53ab7f7abb..b71521121b 100644
--- a/code/modules/client/client_defines.dm
+++ b/code/modules/client/client_defines.dm
@@ -89,6 +89,8 @@
var/list/char_render_holders //Should only be a key-value list of north/south/east/west = obj/screen.
+ /// Last time they used fix macros
+ var/last_macro_fix = 0
/// Keys currently held
var/list/keys_held = list()
/// These next two vars are to apply movement for keypresses and releases made while move delayed.
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index cd8aca134a..267ee3a5e1 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -269,7 +269,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
prefs = new /datum/preferences(src)
GLOB.preferences_datums[ckey] = prefs
- addtimer(CALLBACK(src, .proc/ensure_keys_set), 10) //prevents possible race conditions
+ addtimer(CALLBACK(src, .proc/ensure_keys_set, prefs), 10) //prevents possible race conditions
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 73486958d6..87adc31d8c 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -218,7 +218,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//we couldn't load character data so just randomize the character appearance + name
random_character() //let's create a random character then - rather than a fat, bald and naked man.
key_bindings = deepCopyList(GLOB.hotkey_keybinding_list_by_key) // give them default keybinds and update their movement keys
- C?.ensure_keys_set()
+ C?.ensure_keys_set(src)
real_name = pref_species.random_name(gender,1)
if(!loaded_preferences_successfully)
save_preferences()
@@ -951,7 +951,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/list/default_keys = hotkeys ? kb.hotkey_keys : kb.classic_keys
if(LAZYLEN(default_keys))
dat += "| Default: [default_keys.Join(", ")]"
- dat += "Independent Binding: [current_independent_binding]"
+ if(!kb.special && !kb.clientside)
+ dat += "Independent Binding: [current_independent_binding]"
dat += "
"
else
var/bound_key = user_binds[kb.name][1]
@@ -964,7 +965,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/list/default_keys = hotkeys ? kb.classic_keys : kb.hotkey_keys
if(LAZYLEN(default_keys))
dat += "| Default: [default_keys.Join(", ")]"
- dat += "Independent Binding: [current_independent_binding]"
+ if(!kb.special && !kb.clientside)
+ dat += "Independent Binding: [current_independent_binding]"
dat += "
"
dat += "
"
@@ -990,7 +992,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
#undef APPEARANCE_CATEGORY_COLUMN
#undef MAX_MUTANT_ROWS
-/datum/preferences/proc/CaptureKeybinding(mob/user, datum/keybinding/kb, old_key, independent = FALSE)
+/datum/preferences/proc/CaptureKeybinding(mob/user, datum/keybinding/kb, old_key, independent = FALSE, special = FALSE)
var/HTML = {"