Files
Paradise/code/datums/keybindings/movement_keybinds.dm
Contrabang 3f87165a03 CI now bans files with the same name (PART 2) (#21051)
* CI change

* world.dm

* .dme world.dm

* subsystem renaming

* .dme for subsystems

* ai_laws.dm

* armor.dm

* emote.dm

* logging.dm

* spell.dm

* air_alarm.dm

* crew.dm

* decal.dm

* emissive_blocker.dm

* footstep.dm

* spawner.dm

* fire.dm

* carbon.dm

* living.dm

* mob.dm

* movement.dm

* thermal_drill.dm

* plasmamen.dm

* lavaland.dm

* chaplain.dm

* lightning.dm

* magnet.dm

* mimic.dm

* wizard.dm

* morph.dm

* vampire.dm

* click.dm

* self.dm

* radiation_storm.dm

* airlock.dm

* autolathe.dm

* mulebot.dm

* nuclearbomb.dm

* particle_accelerator.dm

* smartfridge.dm

* syndicatebomb.dm

* vending.dm

* wires.dm

* sound.dm

* mining.dm

* syndicate_space_base.dm

* monkey.dm

* guardian.dm

* bomb.dm

* standard.dm

* nuclear.dm

* pinpointer.dm

* access.dm

* departments.dm

* job.dm

* science.dm

* buttons.dm

* cloning.dm

* igniter.dm

* wishgranter.dm

* atmos_control.dm

* message.dm

* power_monitor.dm

* mecha.dm

* combat.dm

* mining_tools.dm

* meteors.dm

* spiders.dm

* contraband.dm

* aliens.dm

* uplinks.dm

* voice.dm

* intercom.dm

* lights.dm

* robot_items.dm

* mineral.dm

* dice.dm

* extinguisher.dm

* paint.dm

* signs.dm

* staff.dm

* smokebomb.dm

* boxes.dm

* random.dm

* janicart.dm

* statue.dm

* cargo.dm

* asteroid.dm

* headslug.dm

* fulton.dm

* atmospherics.dm

* pump.dm

* corpse.dm

* oldstation.dm

* gps.dm

* preferences.dm

* clothing.dm

* ears.dm

* glasses.dm

* boxing.dm

* color.dm

* renames ninja gear files

* recipes.dm

* error_handler.dm

* anomaly.dm

* floorcluwne.dm

* undead.dm

* overmind.dm

* shield.dm

* bottle.dm

* organ.dm

* piano.dm

* plasma_fist.dm

* language.dm

* mob_defines.dm

* mob_helpers.dm

* damage_procs.dm

* _defines.dm

* empress.dm and queen.dm

* brain.dm

* organ file renaming

* subsystems.dm

* constructs.dm

* bot.dm

* pet.dm

* nature.dm

* magic.dm

* colors.dm

* drugs.dm

* medicine.dm

* toxins.dm

* shuttle.dm

* surgery.dm

* moves a bunch of define files

* traits.dm

* names.dm

* other_mobs.dm

* flags.dm

* some final define files

* well turns out contractor_pinpointer.dm was  taken

* I forgot to remove this file

* how in the hell did this get unticked

* I DID INCLUDE IT, but there was a "w" there

* swaps the world definitions

* camera renamed to SScamera

* examine -> alien_examine
2023-06-02 14:30:17 -05: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