mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 11:32:20 +00:00
* Adds MC initialization stages. Earlier stages can fire while later ones init. Fixes tgui chat reconnection banner showing during init. (#66473) * Adds MC initialization stages. Earlier stages can fire while later ones init. Removes TICK_LIMIT_MC_INIT config for barely doing anything to speed up init and being inconvenient to work with if fires and inits can happen at the same time. * Adds MC initialization stages. Earlier stages can fire while later ones init. Fixes tgui chat reconnection banner showing during init. Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
SUBSYSTEM_DEF(input)
|
|
name = "Input"
|
|
wait = 1 //SS_TICKER means this runs every tick
|
|
init_order = INIT_ORDER_INPUT
|
|
init_stage = INITSTAGE_EARLY
|
|
flags = SS_TICKER
|
|
priority = FIRE_PRIORITY_INPUT
|
|
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
|
|
|
|
var/list/macro_set
|
|
|
|
/datum/controller/subsystem/input/Initialize()
|
|
setup_default_macro_sets()
|
|
|
|
initialized = TRUE
|
|
|
|
refresh_client_macro_sets()
|
|
|
|
return ..()
|
|
|
|
// This is for when macro sets are eventualy datumized
|
|
/datum/controller/subsystem/input/proc/setup_default_macro_sets()
|
|
macro_set = list(
|
|
"Any" = "\"KeyDown \[\[*\]\]\"",
|
|
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
|
|
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
|
|
"Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
|
|
"Escape" = "Reset-Held-Keys",
|
|
)
|
|
|
|
// Badmins just wanna have fun ♪
|
|
/datum/controller/subsystem/input/proc/refresh_client_macro_sets()
|
|
var/list/clients = GLOB.clients
|
|
for(var/i in 1 to clients.len)
|
|
var/client/user = clients[i]
|
|
user.set_macros()
|
|
|
|
/datum/controller/subsystem/input/fire()
|
|
for(var/mob/user as anything in GLOB.keyloop_list)
|
|
user.focus?.keyLoop(user.client)
|