This commit is contained in:
silicons
2020-11-26 23:37:27 -07:00
parent 8a2e996817
commit 5e965d099f
8 changed files with 90 additions and 131 deletions
+48
View File
@@ -45,3 +45,51 @@
winset(src, null, "map.focus=true input.background-color=[COLOR_INPUT_DISABLED] mainwindow.macro=[SKIN_MACROSET_HOTKEYS]")
else
winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=[SKIN_MACROSET_CLASSIC_INPUT]")
/client/proc/ensure_keys_set()
if(SSinput.initialized)
full_macro_assert()
/client/proc/full_macro_assert(datum/preferences/prefs_override = refs)
set_macros(prefs_override)
update_special_keybinds(prefs_override)
/**
* Updates the keybinds for special keys
*
* Handles adding macros for the keys that need it
* And adding movement keys to the clients movement_keys list
* At the time of writing this, communication(OOC, Say, IC) require macros
* Arguments:
* * direct_prefs - the preference we're going to get keybinds from
*/
/client/proc/update_special_keybinds(datum/preferences/direct_prefs)
var/datum/preferences/D = prefs || direct_prefs
if(!D?.key_bindings)
return
movement_keys = list()
for(var/key in D.key_bindings)
for(var/kb_name in D.key_bindings[key])
switch(kb_name)
if("North")
movement_keys[key] = NORTH
if("East")
movement_keys[key] = EAST
if("West")
movement_keys[key] = WEST
if("South")
movement_keys[key] = SOUTH
if("Say")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=say")
if("OOC")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=ooc")
if("Me")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=me")
if("Subtle")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=subtle")
if("Subtler")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=subtler")
if("Whisper")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=whisper")
if("LOOC")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=looc")