mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user