Files
Bubberstation/code/datums/keybinding/_keybindings.dm
Ben10Omintrix efe62c5a72 Pet Commands QOL . makes pet commands easier to use (#88495)
## About The Pull Request
this PR improves the UX of pet commands a bit. i decided to expand on
their radial menu. You can now hold shift and hover over your pet to
display a menu of commands which you can choose from. alternatively, you
can still type out commands in chat


https://github.com/user-attachments/assets/9da7f7ea-58a3-4fd6-b040-45cc05cda51d



## Why It's Good For The Game
makes pet commands easier to give out when you're managing more than 1
pet. also fixes the fishing command not working.

## Changelog
🆑
qol: holding shift and hovering over your pet will display a list of
commands you can click from
fix: fixes the fishing pet command not working
/🆑
2024-12-22 03:05:30 +01:00

30 lines
778 B
Plaintext

/datum/keybinding
var/list/hotkey_keys
var/list/classic_keys
var/name
var/full_name
var/description = ""
var/category = CATEGORY_MISC
var/weight = WEIGHT_LOWEST
var/keybind_signal
/datum/keybinding/New()
if(!keybind_signal)
CRASH("Keybind [src] called unredefined down() without a keybind_signal.")
// Default keys to the master "hotkey_keys"
if(LAZYLEN(hotkey_keys) && !LAZYLEN(classic_keys))
classic_keys = hotkey_keys.Copy()
/datum/keybinding/proc/down(client/user)
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(user.mob, keybind_signal) & COMSIG_KB_ACTIVATED
/datum/keybinding/proc/up(client/user)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(user.mob, DEACTIVATE_KEYBIND(keybind_signal))
return FALSE
/datum/keybinding/proc/can_use(client/user)
return TRUE