Files
Bubberstation/code/datums/keybinding/movement.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

60 lines
1.6 KiB
Plaintext

/datum/keybinding/movement
category = CATEGORY_MOVEMENT
weight = WEIGHT_HIGHEST
/datum/keybinding/movement/north
hotkey_keys = list("W", "North")
name = "North"
full_name = "Move North"
description = "Moves your character north"
keybind_signal = COMSIG_KB_MOVEMENT_NORTH_DOWN
/datum/keybinding/movement/south
hotkey_keys = list("S", "South")
name = "South"
full_name = "Move South"
description = "Moves your character south"
keybind_signal = COMSIG_KB_MOVEMENT_SOUTH_DOWN
/datum/keybinding/movement/west
hotkey_keys = list("A", "West")
name = "West"
full_name = "Move West"
description = "Moves your character left"
keybind_signal = COMSIG_KB_MOVEMENT_WEST_DOWN
/datum/keybinding/movement/east
hotkey_keys = list("D", "East")
name = "East"
full_name = "Move East"
description = "Moves your character east"
keybind_signal = COMSIG_KB_MOVEMENT_EAST_DOWN
/datum/keybinding/movement/zlevel_upwards
hotkey_keys = list("Northeast") // PGUP
name = "Upwards"
full_name = "Move Upwards"
description = "Moves your character up a z-level if possible"
keybind_signal = COMSIG_KB_MOVEMENT_ZLEVEL_MOVEUP_DOWN
/datum/keybinding/movement/zlevel_upwards/down(client/user, turf/target)
. = ..()
if(.)
return
user.mob.up()
return TRUE
/datum/keybinding/movement/zlevel_downwards
hotkey_keys = list("Southeast") // PGDOWN
name = "Downwards"
full_name = "Move Downwards"
description = "Moves your character down a z-level if possible"
keybind_signal = COMSIG_KB_MOVEMENT_ZLEVEL_MOVEDOWN_DOWN
/datum/keybinding/movement/zlevel_downwards/down(client/user, turf/target)
. = ..()
if(.)
return
user.mob.down()
return TRUE