Files
Paradise/code/modules/input/keybindings_procs.dm
Luc 1fe7819c1b Ports action button refactor from /tg/ (#24482)
* add the new stuff

* guh

* add the brunt of it

* action button stuff

* adds a lot of other stuff

* careful find and replace

* it loads

* so many huds

* ehh yeah this kinda works

* fixes this runtime

* hacks in some DMI stuff, we'll fix it later

* Adds better mouse pointer for dragging buttons

* gets dragging into place working again, updates DMI

* moves define

* remove extra hud defines, now it compiles

* CHECK GREP

* owww

* rename action defines

* ticks

* are we good

* let's try that again

* renames mob vars

* renames

* fixes some hud issues with huds getting the wrong variable

* fixes some alignment issues

* Adds mouse-wheel scroll support

* left -> right

* I am the entire circus

* first self-review pass

* Another review pass -- just realized I need to fix keybinds

* more testing

* update icons

* oops

* Fix spell icons not appearing properly

* fixes some outstanding issues
- Action button backgrounds now work properly
- Fixes some runtimes on dropping
- Fixes some misplaced icons

* hmm

* weh

* again?

* nah?

* maybe this?

* asdf

* should finally fix CI

* add client check

* move the ?

* add missing override causing runtimes

* shift-clicking now doesn't trigger the button

* better docs
2024-03-24 17:38:53 +00:00

24 lines
918 B
Plaintext

/client/proc/update_active_keybindings()
active_keybindings = list()
movement_kb_dirs = list()
for(var/key in prefs?.keybindings)
for(var/kb in prefs.keybindings[key])
var/datum/keybinding/KB = kb
if(!KB.can_use(src, mob))
continue
if(istype(KB, /datum/keybinding/movement))
var/datum/keybinding/movement/KBM = KB
movement_kb_dirs[key] = KBM.move_dir
else
active_keybindings[key] += list(KB)
if(!mob) // Clients can join before world/new is setup, so we gotta mob check em
return active_keybindings
for(var/atom/movable/screen/movable/action_button/button as anything in mob.hud_used.get_all_action_buttons())
// TODO VERIFY THIS (AND KEYBINDS) WORK PROPERLY
if(button.linked_keybind?.binded_to)
var/datum/keybinding/mob/trigger_action_button/linked_bind = button.linked_keybind
active_keybindings[linked_bind.binded_to] += list(linked_bind)
return active_keybindings