From db424f9cc1aa1d00964b271a5685973fbde3d120 Mon Sep 17 00:00:00 2001 From: GregariousJB Date: Sat, 21 Feb 2026 19:55:12 -0500 Subject: [PATCH] Changed keybinding "Unbound" string to "..." for better visibility (#95142) ## About The Pull Request A very small change that slightly improves the keybinds section by changing the word "Unbound" to "...", also known as the [ellipses](https://www.thepunctuationguide.com/ellipses.html). This PR only changes string names, no other mechanics, so everything else _should_ be working normally. Every string in the code matching "Unbound" has been changed, including one comment for clarity. There doesn't seem to be any issue with existing custom keybinds. All of mine transferred seamlessly, so no one should need to redo their keybinds. ## Why It's Good For The Game Better visibility. Rather than playing 'find the numpad bind' scrolling through a long list of ~100 keybinds, they show up a little easier now. This is also the standard in other games, but not always an ellipses - sometimes a double dash "--", but I figured there's already a dash "-" bind by default (for the A.I. to reconnect to its shell) so the ellipses might fit better. The ellipses is also commonly used for "awaiting input" of some kind. ![unbound](https://github.com/user-attachments/assets/2f098852-f532-40e7-9266-6af00d60652c) ## Changelog :cl: qol: Keybinding visual improvements: "Unbound" is grayed out and custom binds are highlighted in green for better visibility /:cl: --- code/__DEFINES/keybinding.dm | 1 + code/_globalvars/lists/keybindings.dm | 2 +- code/datums/keybinding/admin.dm | 4 ++-- code/datums/keybinding/emote.dm | 4 ++-- code/datums/keybinding/living.dm | 2 +- code/datums/keybinding/mob.dm | 4 ++-- .../client/preferences/middleware/keybindings.dm | 1 + .../preferences/migrations/tgui_prefs_migration.dm | 4 ++-- code/modules/client/preferences_savefile.dm | 6 +++--- .../GamePreferences/KeybindingsPage.tsx | 14 ++++++++++++-- 10 files changed, 27 insertions(+), 15 deletions(-) diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index fde4dbdf268..9f9d22e2643 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -3,6 +3,7 @@ //General #define COMSIG_KB_ACTIVATED (1<<0) #define COMSIG_KB_EMOTE "keybinding_emote_down" +#define UNBOUND_KEY "Unbound" ///Signal sent when a keybind is deactivated #define DEACTIVATE_KEYBIND(A) "[A]_DEACTIVATED" diff --git a/code/_globalvars/lists/keybindings.dm b/code/_globalvars/lists/keybindings.dm index 90a7501f5e4..0730ff7d60c 100644 --- a/code/_globalvars/lists/keybindings.dm +++ b/code/_globalvars/lists/keybindings.dm @@ -14,7 +14,7 @@ // Hotkey if(LAZYLEN(instance.hotkey_keys)) for(var/bound_key in instance.hotkey_keys) - if (bound_key == "Unbound") + if (bound_key == UNBOUND_KEY) LAZYADD(GLOB.default_hotkeys[instance.name], list()) else LAZYADD(GLOB.default_hotkeys[instance.name], list(bound_key)) diff --git a/code/datums/keybinding/admin.dm b/code/datums/keybinding/admin.dm index 0e703d7e148..207610b4364 100644 --- a/code/datums/keybinding/admin.dm +++ b/code/datums/keybinding/admin.dm @@ -97,7 +97,7 @@ return TRUE /datum/keybinding/admin/deadmin - hotkey_keys = list("Unbound") + hotkey_keys = list(UNBOUND_KEY) name = "deadmin" full_name = "Deadmin" description = "Shed your admin powers" @@ -111,7 +111,7 @@ return TRUE /datum/keybinding/admin/readmin - hotkey_keys = list("Unbound") + hotkey_keys = list(UNBOUND_KEY) name = "readmin" full_name = "Readmin" description = "Regain your admin powers" diff --git a/code/datums/keybinding/emote.dm b/code/datums/keybinding/emote.dm index 71f9ba88135..38d48735631 100644 --- a/code/datums/keybinding/emote.dm +++ b/code/datums/keybinding/emote.dm @@ -5,8 +5,8 @@ var/emote_key /datum/keybinding/emote/proc/link_to_emote(datum/emote/faketype) - hotkey_keys = list("Unbound") - classic_keys = list("Unbound") + hotkey_keys = list(UNBOUND_KEY) + classic_keys = list(UNBOUND_KEY) emote_key = initial(faketype.key) name = initial(faketype.key) full_name = capitalize(initial(faketype.key)) diff --git a/code/datums/keybinding/living.dm b/code/datums/keybinding/living.dm index 1e3a682c97f..42eb96bf5da 100644 --- a/code/datums/keybinding/living.dm +++ b/code/datums/keybinding/living.dm @@ -152,7 +152,7 @@ return TRUE /datum/keybinding/living/toggle_move_intent_alternative - hotkey_keys = list("Unbound") + hotkey_keys = list(UNBOUND_KEY) name = "toggle_move_intent_alt" full_name = "press to cycle move intent" description = "Pressing this cycle to the opposite move intent, does not cycle back" diff --git a/code/datums/keybinding/mob.dm b/code/datums/keybinding/mob.dm index dc9b3756508..dd27763338b 100644 --- a/code/datums/keybinding/mob.dm +++ b/code/datums/keybinding/mob.dm @@ -21,7 +21,7 @@ return TRUE /datum/keybinding/mob/swap_hands - hotkey_keys = list("Unbound") + hotkey_keys = list(UNBOUND_KEY) name = "swap_hands" full_name = "Swap hands" description = "" @@ -166,7 +166,7 @@ keybind_signal = COMSIG_KB_MOB_TARGETCYCLEHEAD_DOWN /datum/keybinding/mob/target/head - hotkey_keys = list("Unbound") + hotkey_keys = list(UNBOUND_KEY) name = "target_head" full_name = "Target: Head" description = "Pressing this key targets the head. This will impact where you hit people, and can be used for surgery." diff --git a/code/modules/client/preferences/middleware/keybindings.dm b/code/modules/client/preferences/middleware/keybindings.dm index 07ec54d3cbc..5c1cddfa352 100644 --- a/code/modules/client/preferences/middleware/keybindings.dm +++ b/code/modules/client/preferences/middleware/keybindings.dm @@ -94,6 +94,7 @@ keybindings[keybinding.category][keybinding.name] = list( "name" = keybinding.full_name, "description" = keybinding.description, + "default" = keybinding.hotkey_keys, ) return keybindings diff --git a/code/modules/client/preferences/migrations/tgui_prefs_migration.dm b/code/modules/client/preferences/migrations/tgui_prefs_migration.dm index 2d852c96a02..50e9d5af526 100644 --- a/code/modules/client/preferences/migrations/tgui_prefs_migration.dm +++ b/code/modules/client/preferences/migrations/tgui_prefs_migration.dm @@ -15,11 +15,11 @@ /datum/preferences/proc/migrate_key_bindings() var/new_key_bindings = list() - for (var/unbound_hotkey in key_bindings["Unbound"]) + for (var/unbound_hotkey in key_bindings[UNBOUND_KEY]) new_key_bindings[unbound_hotkey] = list() for (var/hotkey in key_bindings) - if (hotkey == "Unbound") + if (hotkey == UNBOUND_KEY) continue for (var/keybind in key_bindings[hotkey]) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index e0d376add9d..6dd20be22f5 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -184,14 +184,14 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(parent.hotkeys) for(var/hotkeytobind in kb.hotkey_keys) - if(hotkeytobind == "Unbound") + if(hotkeytobind == UNBOUND_KEY) addedbind = TRUE else if(!length(binds_by_key[hotkeytobind])) //Only bind to the key if nothing else is bound key_bindings[kb.name] |= hotkeytobind addedbind = TRUE else for(var/classickeytobind in kb.classic_keys) - if(classickeytobind == "Unbound") + if(classickeytobind == UNBOUND_KEY) addedbind = TRUE else if(!length(binds_by_key[classickeytobind])) //Only bind to the key if nothing else is bound key_bindings[kb.name] |= classickeytobind @@ -199,7 +199,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(!addedbind) notadded += kb - save_preferences() //Save the players pref so that new keys that were set to Unbound as default are permanently stored + save_preferences() //Save the players pref so that new keys that were set to UNBOUND_KEY as default are permanently stored if(length(notadded)) addtimer(CALLBACK(src, PROC_REF(announce_conflict), notadded), 5 SECONDS) diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferences/KeybindingsPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferences/KeybindingsPage.tsx index 619c368baf2..42dc60e768e 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferences/KeybindingsPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferences/KeybindingsPage.tsx @@ -21,6 +21,7 @@ import { TabbedMenu } from './TabbedMenu'; type Keybinding = { name: string; description?: string; + default?: string[]; }; type Keybindings = Record>; @@ -121,6 +122,7 @@ class KeybindingButton extends Component<{ currentHotkey?: string; onClick?: () => void; typingHotkey?: string; + defaults?: string[]; }> { shouldComponentUpdate(nextProps) { return ( @@ -130,8 +132,9 @@ class KeybindingButton extends Component<{ } render() { - const { currentHotkey, onClick, typingHotkey } = this.props; + const { currentHotkey, onClick, typingHotkey, defaults } = this.props; + const keyText = typingHotkey || currentHotkey || 'Unbound'; const child = ( ); @@ -241,6 +250,7 @@ function getKeybindingNodes( currentHotkey={keys[key]} typingHotkey={getTypingHotkey(keybindingId, key)} onClick={getKeybindingOnClick(keybindingId, key)} + defaults={keybinding.default} /> ))}