Files
Bubberstation/code/datums/keybinding/emote.dm
SkyratBot 13be1166fa [MIRROR] Fixes a bunch of hotkey preferences bugs (#6149)
* Fixes a bunch of hotkey preferences bugs (#59492)

This fixes the problem of the keybind conflict message being shown over and over again until you manually save your preferences with correct keybinds + resetting to classic keys works now
You had to manually save your prefs because the code didn't save the new unbound keys to the prefs file
Classic mode was broken because the emote hotkeys didn't have classic_keys set to Unbound by default

New hotkeys are now actually set to Unbound if no default key is set
This was broken for emote hotkeys because classic_keys = list("Unbound") was missing for them
It was also broken because the code assumed conflicting keys if some Unbound key already existed ...
The code also used classic key defaults even if you had hotkey mode enabled thats fixed now too

* Fixes a bunch of hotkey preferences bugs

* Mirror!

Co-authored-by: Gamer025 <33846895+Gamer025@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
2021-06-06 11:47:28 +12:00

20 lines
530 B
Plaintext

/datum/keybinding/emote
category = CATEGORY_EMOTE
weight = WEIGHT_EMOTE
keybind_signal = COMSIG_KB_EMOTE
var/emote_key
/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))
description = "Do the emote '*[emote_key]'"
/datum/keybinding/emote/down(client/user)
. = ..()
if(.)
return
return user.mob.emote(emote_key, intentional=TRUE)