From 8487cd2c9513fdd490392c2031551c5d7a6a03f0 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:53:58 +0000 Subject: [PATCH] thingy --- code/modules/client/tgui_macro.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/client/tgui_macro.dm b/code/modules/client/tgui_macro.dm index f245f1d657d4..5159a8b7414c 100644 --- a/code/modules/client/tgui_macro.dm +++ b/code/modules/client/tgui_macro.dm @@ -101,6 +101,7 @@ GLOBAL_LIST_EMPTY(ui_data_keybindings) prefs.save_preferences() INVOKE_ASYNC(owner, /client/proc/set_macros) return TRUE + if("clear_keybind") var/list/kbinds = prefs.key_bindings var/kb_name = params["keybinding"] @@ -111,13 +112,15 @@ GLOBAL_LIST_EMPTY(ui_data_keybindings) for(var/key in keys) if(kbinds[key]) kbinds[key] -= kb_name - kbinds["Unbound"] += kb_name if(!length(kbinds[key])) kbinds -= key + // Add the keybind name to the 'unbound' list if it's not already in there. + kbinds["Unbound"] |= kb_name prefs.save_preferences() INVOKE_ASYNC(owner, /client/proc/set_macros) return TRUE + if("clear_all_keybinds") var/choice = tgui_alert(owner, "Would you prefer 'hotkey' or 'classic' defaults?", "Setup keybindings", list("Hotkey", "Classic", "Cancel")) if(choice == "Cancel")