Files
Paradise/code/datums/keybindings/movement.dm
S34N 3f95392c82 Lets go rebind things (#18166)
* SSinput Rewrite, Custom Keybindings

* hmm yes, safety

* azerty begone

* address AA and SteelSlayer

* Address the old man

* what

* CI dbconfig too

* Address TM issues

Unicode support
Better numpad support
Fix no perms message
Fix modifier screwing movement

* pre-TM tweak, nitfix

* pre TM change 2

* Display others

* MERGE ME

* unduplicates your rows

* reverts some changes, makes this work for now (not TM safe)

* fixes direction facing, removes hotkey help item

* weird keys

* TM commit revert later

* fixed asay/msay keybind

* adds ALL the emotes

* flip and spin

* makes old people happy

* and fixes admins not being able to msay

* lets borgs stow modules

* saves prefs when someone changes a keybind

* reverts skin changes and manually applies
HEAVEN HELP YOU IF YOU USE THE DM SKIN EDITOR IT BREAKS EVERYTHING

* tidies menu, unduplicates rest

* sql file pls come back

* Update SQL/updates/40-41.sql

* why did you not throw an error?!

* inits keybinds if your prefs somehow fail, i guess

* restores these spaces, i guess

* fixes local testing, i guess

* emote cooldown returns (oops)

* movement lock improvements

* Pageup does Swap Hands

* LOOC

* whisper for living mobs

* oops

* fix dsay

* fix IPC silicon emote hotkeys

* category name

* backspace only clears if input is focused

* Makes TAB and BACKSPACE rebindable

* charlie review

* define move

* yeet

* Lewcc review

* brings back legacy mode

* restores legacy mode

* tell legacy mode what is going on

* Update code/controllers/subsystem/input.dm

* Update code/controllers/subsystem/input.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* safeties!

* legacy mode is a pref now

* undo TM changes

* null prefs safeties

* Revert "legacy mode is a pref now"

This reverts commit b45af65139.

* revert this too thanks

Co-authored-by: mochi <shenesis@gmail.com>
Co-authored-by: dearmochi <1496804+dearmochi@users.noreply.github.com>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
2022-07-13 21:34:41 +01:00

54 lines
1.3 KiB
Plaintext

/datum/keybinding/movement
category = KB_CATEGORY_MOVEMENT
/// The direction to move to when held.
var/move_dir
/datum/keybinding/movement/north
name = "Move North"
keys = list("W", "North")
move_dir = NORTH
/datum/keybinding/movement/south
name = "Move South"
keys = list("S", "South")
move_dir = SOUTH
/datum/keybinding/movement/east
name = "Move East"
keys = list("D", "East")
move_dir = EAST
/datum/keybinding/movement/west
name = "Move West"
keys = list("A", "West")
move_dir = WEST
/datum/keybinding/lock
name = "Movement Lock (Prevents Moving When Held)"
category = KB_CATEGORY_MOVEMENT
keys = list("Ctrl")
/datum/keybinding/lock/down(client/C)
. = ..()
C.input_data.move_lock = TRUE
movement_restore(C)
/datum/keybinding/lock/up(client/C)
. = ..()
C.input_data.move_lock = FALSE
movement_restore(C)
/datum/keybinding/lock/proc/movement_restore(client/C)
var/datum/input_data/ID = C.input_data
for(var/_key in C.input_data.keys_held)
var/move_dir = C.movement_kb_dirs[_key]
if(move_dir && ID.move_lock)
ID.desired_move_dir &= ~move_dir
if(!(ID.desired_move_dir_add & move_dir))
ID.desired_move_dir_sub |= move_dir
else if(move_dir)
SSinput.processing[C] = world.time
ID.desired_move_dir |= move_dir
if(!(ID.desired_move_dir_sub & move_dir))
ID.desired_move_dir_add |= move_dir