mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-21 06:25:59 +00:00
* custom keybindings * Update _lists.dm * Update robot.dm * modify weights and clean up some vars * Update say.dm * Apply suggestions from code review Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com> * some review changes * formatting * include focus hack, remove me_wrapper, give default keybinds to new characters, misc fixes * revert hack and more reviews * remove another focus hack this was causing issues with the keydown proc returning early
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
SUBSYSTEM_DEF(input)
|
|
name = "Input"
|
|
wait = 1 //SS_TICKER means this runs every tick
|
|
init_order = INIT_ORDER_INPUT
|
|
flags = SS_TICKER
|
|
priority = FIRE_PRIORITY_INPUT
|
|
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
|
|
|
|
var/list/macro_set
|
|
var/list/movement_keys
|
|
|
|
/datum/controller/subsystem/input/Initialize()
|
|
setup_default_macro_sets()
|
|
|
|
setup_default_movement_keys()
|
|
|
|
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" = "\".winset \\\"input.text=\\\"\\\"\\\"\"")
|
|
|
|
/datum/controller/subsystem/input/proc/setup_default_movement_keys()
|
|
var/static/list/default_movement_keys = list(
|
|
"W" = NORTH, "A" = WEST, "S" = SOUTH, "D" = EAST, // WASD
|
|
"North" = NORTH, "West" = WEST, "South" = SOUTH, "East" = EAST, // Arrow keys & Numpad
|
|
)
|
|
|
|
movement_keys = default_movement_keys.Copy()
|
|
|
|
// 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()
|
|
var/list/clients = GLOB.clients // Let's sing the list cache song
|
|
for(var/i in 1 to clients.len)
|
|
var/client/C = clients[i]
|
|
C.keyLoop()
|