Rips out the old keybind system and ports a better version from /tg/ (#17216)

* Initial version

Ripped out old version and added new version

* Update some of the keybinds

* More changes

* Added hotkey sanity checks

* Misc. fixes and features

* Small fix

* Refactor keys_held

* Adds emote keybinds

* Small spelling fixes

* I always forget this one

* Add 1 second cooldown on emotes

* Fix DME

* Don't spam

* Make linter happy

* New MC init
This commit is contained in:
Ling
2023-01-04 16:55:09 +01:00
committed by GitHub
parent b8e070f311
commit 50e3477a6e
66 changed files with 1363 additions and 1470 deletions

View File

@@ -29,6 +29,19 @@ GLOBAL_VAR_INIT(cmp_field, "name")
/proc/cmp_records_dsc(datum/data/record/a, datum/data/record/b)
return sorttext(a.fields[GLOB.cmp_field], b.fields[GLOB.cmp_field])
// Datum cmp with vars is always slower than a specialist cmp proc, use your judgement.
/proc/cmp_datum_numeric_asc(datum/a, datum/b, variable)
return cmp_numeric_asc(a.vars[variable], b.vars[variable])
/proc/cmp_datum_numeric_dsc(datum/a, datum/b, variable)
return cmp_numeric_dsc(a.vars[variable], b.vars[variable])
/proc/cmp_datum_text_asc(datum/a, datum/b, variable)
return sorttext(b.vars[variable], a.vars[variable])
/proc/cmp_datum_text_dsc(datum/a, datum/b, variable)
return sorttext(a.vars[variable], b.vars[variable])
/proc/cmp_ckey_asc(client/a, client/b)
return sorttext(b.ckey, a.ckey)

View File

@@ -59,7 +59,9 @@
var/datum/sprite_accessory/hair_gradient/H = new path()
GLOB.hair_gradients_list[H.name] = H
// Keybindings
init_keybindings()
GLOB.emote_list = init_emote_list()
//Skillcapes
for(var/path in subtypesof(/datum/skillcape))

View File

@@ -11,6 +11,12 @@
return text
return default
/proc/sanitize_islist(value, default)
if(islist(value) && length(value))
return value
if(default)
return default
/proc/sanitize_inlist(value, list/List, default)
if(value in List)
return value