Create client preference for if hotkey mode is enabled by default on login or not.

* Adds preference setting for wether hotkeys should default to enabled or disabled.
* Fixes bug for CTRL+NUMPAD8 using old verb name for toggling head.
This commit is contained in:
Leshana
2018-02-23 14:12:54 -05:00
parent a47ce58f0a
commit 1d11b0d6e1
6 changed files with 27 additions and 3 deletions

View File

@@ -188,3 +188,14 @@ Any-Mode: (hotkey doesn't need to be on)
src << other
if(holder)
src << admin
// Set the DreamSeeker input macro to the type appropriate for its mob
/client/proc/set_hotkeys_macro(macro_name = "macro", hotkey_macro_name = "hotkeymode", hotkeys_enabled = null)
// If hotkeys mode was not specified, fall back to choice of default in client preferences.
if(isnull(hotkeys_enabled))
hotkeys_enabled = is_preference_enabled(/datum/client_preference/hotkeys_default)
if(hotkeys_enabled)
winset(src, null, "mainwindow.macro=[hotkey_macro_name] hotkey_toggle.is-checked=true mapwindow.map.focus=true")
else
winset(src, null, "mainwindow.macro=[macro_name] hotkey_toggle.is-checked=false input.focus=true")