Files
Bubberstation/code/datums/keybinding/emote.dm
TiviPlus d53fb89b86 Keyboard presses (and thus keybindings) will now report the turf the mouse was over when a player presses or releases a key (#90480)
## About The Pull Request

Semi WIP cus I need to probably make an issue report for lummox, but
apart from that ready for review

Uses the new mouse-pos so we can combine it with screen size and size to
estimate very accurately the mouse position in turf terms. In future
also will need to add a way to continously poll the users mouse pos but
this alone is very useful

## Why It's Good For The Game

This isnt used yet, but the benefits are pretty damn obvious (hitting E
and dashing towards where your mouse??? 1990s features?????)

## Changelog
🆑
refactor: Added the possibility for keybindings to report the turf they
clicked on.
/🆑

---------

Co-authored-by: TiviPlus <572233640+TiviPlus@users.noreply.com>
2025-05-16 22:03:01 -07:00

19 lines
498 B
Plaintext

/datum/keybinding/emote
category = CATEGORY_EMOTE
weight = WEIGHT_EMOTE
keybind_signal = COMSIG_KB_EMOTE
var/emote_key
/datum/keybinding/emote/proc/link_to_emote(datum/emote/faketype)
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
emote_key = initial(faketype.key)
name = initial(faketype.key)
full_name = capitalize(initial(faketype.key))
/datum/keybinding/emote/down(client/user, turf/target)
. = ..()
if(.)
return
return user.mob.emote(emote_key, intentional=TRUE)