From 1fa8bd1e4e40a02e67dda14c1de568e16c40ebd0 Mon Sep 17 00:00:00 2001 From: Ectype <167669119+whooshboom@users.noreply.github.com> Date: Sat, 4 Jan 2025 04:06:16 -0600 Subject: [PATCH] Fixes and adds more atmospheric keybinds (#9785) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- .../components/binary_devices/pump.dm | 15 ++++++++++----- .../components/omni_devices/omni_base.dm | 18 ++++++++++++++++++ .../components/trinary_devices/trinary_base.dm | 16 ++++++++++++++++ .../components/unary/unary_base.dm | 17 +++++++++++++++++ 4 files changed, 61 insertions(+), 5 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 1dc63e217b..af86077562 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -255,23 +255,28 @@ Thus, the two variables affect pump operation are set in New(): "You hear ratchet.") deconstruct() + + //CHOMPEdit Start - Adds TGStation keybinds to save our engineers some time. -/obj/machinery/atmospherics/binary/pump/AltClick(mob/user as mob) +/obj/machinery/atmospherics/binary/pump/AltClick(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) - to_chat(user, span_notice("You set the pump to max output")) + to_chat(user, span_notice("You set the [name] to max output")) target_pressure = max_pressure_setting + add_fingerprint(user) else to_chat(user, span_warning("Access denied.")) -/obj/machinery/atmospherics/binary/pump/CtrlClick(mob/user as mob) +/obj/machinery/atmospherics/binary/pump/CtrlClick(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) update_use_power(!use_power) + update_icon() + add_fingerprint(user) if(use_power) - to_chat(user, span_notice("You turn the pump on.")) + to_chat(user, span_notice("You toggle the [name] on.")) else - to_chat(user, span_notice("You turn the pump off.")) + to_chat(user, span_notice("You toggle the [name] off.")) else to_chat(user, span_warning("Access denied.")) diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 9e6613ebf2..a2052662b0 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -301,3 +301,21 @@ update_ports() return null + +//CHOMPEdit Start - Keybinds for EVEEERYTHING +/obj/machinery/atmospherics/omni/CtrlClick(mob/user) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + if(allowed(user)) + update_use_power(!use_power) + update_icon() + add_fingerprint(user) + if(use_power) + configuring = 0 + to_chat(user, span_notice("You toggle the [name] on.")) + + else + to_chat(user, span_notice("You toggle the [name] off.")) + + else + to_chat(user, span_warning("Access denied.")) +//CHOMPEdit End diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 7e91b8941f..0c2031348c 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -246,3 +246,19 @@ node2_connect = turn(dir, -90) node3_connect = dir return list(node1_connect, node2_connect, node3_connect) + +//CHOMPEdit Start - Keybinds for EVEEERYTHING +/obj/machinery/atmospherics/trinary/CtrlClick(mob/user) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + if(allowed(user)) + update_use_power(!use_power) + update_icon() + add_fingerprint(user) + if(use_power) + to_chat(user, span_notice("You toggle the [name] on.")) + else + to_chat(user, span_notice("You toggle the [name] off.")) + + else + to_chat(user, span_warning("Access denied.")) +//CHOMPEdit End diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index da5e116dc9..0c6e789829 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -114,3 +114,20 @@ visible_message(span_warning("\The [src]'s connector can't be connected, there is already a pipe at that location!")) return TRUE return FALSE + +//CHOMPEdit Start - Keybinds for EVEEERYTHING* (* = not everything)) +/obj/machinery/atmospherics/unary/CtrlClick(mob/user) + if((power_rating != null) && !(pipe_state in list("scrubber", "uvent", "injector"))) //TODO: Add compatibility with air alarm. When not disabled, overrides air alarm state and doesn't tell the air alarm that. Injectors have their own, different bind for enabling. + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + if(allowed(user)) + update_use_power(!use_power) + update_icon() + add_fingerprint(user) + if(use_power) + to_chat(user, span_notice("You toggle the [name] on.")) + else + to_chat(user, span_notice("You toggle the [name] off.")) + + else + to_chat(user, span_warning("Access denied.")) +//CHOMPEdit End