diff --git a/code/datums/keybinding/emote.dm b/code/datums/keybinding/emote.dm index 5d6e7895ed9..157a45af51f 100644 --- a/code/datums/keybinding/emote.dm +++ b/code/datums/keybinding/emote.dm @@ -6,6 +6,7 @@ /datum/keybinding/emote/proc/link_to_emote(datum/emote/faketype) hotkey_keys = list("Unbound") + classic_keys = list("Unbound") emote_key = initial(faketype.key) name = initial(faketype.key) full_name = capitalize(initial(faketype.key)) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 3bdda004e13..651750b1ef4 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -111,17 +111,18 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car continue // key is unbound and or bound to something var/addedbind = FALSE if(hotkeys) - for(var/hotkeytobind in kb.classic_keys) - if(!length(key_bindings[hotkeytobind])) + for(var/hotkeytobind in kb.hotkey_keys) + if(!length(key_bindings[hotkeytobind]) || hotkeytobind == "Unbound") //Only bind to the key if nothing else is bound expect for Unbound LAZYADD(key_bindings[hotkeytobind], kb.name) addedbind = TRUE else for(var/classickeytobind in kb.classic_keys) - if(!length(key_bindings[classickeytobind])) + if(!length(key_bindings[classickeytobind]) || classickeytobind == "Unbound") //Only bind to the key if nothing else is bound expect for Unbound LAZYADD(key_bindings[classickeytobind], kb.name) addedbind = TRUE if(!addedbind) notadded += kb + save_preferences() //Save the players pref so that new keys that were set to Unbound as default are permanently stored if(length(notadded)) addtimer(CALLBACK(src, .proc/announce_conflict, notadded), 5 SECONDS) @@ -132,6 +133,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car var/datum/keybinding/conflicted = item to_chat(parent, "[conflicted.category]: [conflicted.full_name] needs updating") LAZYADD(key_bindings["Unbound"], conflicted.name) // set it to unbound to prevent this from opening up again in the future + save_preferences()