mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-08 15:47:52 +01:00
2ef5704c30
## About The Pull Request https://github.com/user-attachments/assets/531f1456-72a1-4215-ae9e-4f4bf143b8c5 <img width="429" height="93" alt="image" src="https://github.com/user-attachments/assets/1440fb60-a6b8-46c3-9bee-5a30017e2265" /> ## Why It's Good For The Game There's been SS14 players moving to SS13 and finding dropping in 14 is better, which I kinda agree as it allows you to be more precise with x/y dropping. ## Changelog 🆑 qol: There's a keybind (default is Ctrl+X, rebindable) for the drop hotkey to drop where your mouse is (similar to SS14). /🆑
30 lines
844 B
Plaintext
30 lines
844 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, turf/target, mousepos_x, mousepos_y)
|
|
SHOULD_CALL_PARENT(TRUE)
|
|
return SEND_SIGNAL(user.mob, keybind_signal, target) & COMSIG_KB_ACTIVATED
|
|
|
|
/datum/keybinding/proc/up(client/user, turf/target)
|
|
SHOULD_CALL_PARENT(TRUE)
|
|
SEND_SIGNAL(user.mob, DEACTIVATE_KEYBIND(keybind_signal), target)
|
|
return FALSE
|
|
|
|
/datum/keybinding/proc/can_use(client/user)
|
|
return TRUE
|