diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index b138d19b513..8171efa7825 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -28,6 +28,46 @@ Thus, the two variables affect pump operation are set in New(): var/id = null var/datum/radio_frequency/radio_connection +/obj/machinery/atmospherics/binary/pump/CtrlClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + toggle() + return ..() + +/obj/machinery/atmospherics/binary/pump/AICtrlClick() + toggle() + return ..() + +/obj/machinery/atmospherics/binary/pump/AltClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + set_max() + return + +/obj/machinery/atmospherics/binary/pump/AIAltClick() + set_max() + return ..() + +/obj/machinery/atmospherics/binary/pump/proc/toggle() + if(powered()) + on = !on + update_icon() + +/obj/machinery/atmospherics/binary/pump/proc/set_max() + if(powered()) + target_pressure = MAX_OUTPUT_PRESSURE + update_icon() + /obj/machinery/atmospherics/binary/pump/Destroy() if(SSradio) SSradio.remove_object(src, frequency) @@ -203,7 +243,15 @@ Thus, the two variables affect pump operation are set in New(): update_icon() /obj/machinery/atmospherics/binary/pump/attackby(obj/item/W, mob/user, params) - if(!istype(W, /obj/item/wrench)) + if(istype(W, /obj/item/pen)) + var/t = copytext(stripped_input(user, "Enter the name for the pump.", "Rename", name), 1, MAX_NAME_LEN) + if(!t) + return + if(!in_range(src, usr) && loc != usr) + return + name = t + return + else if(!istype(W, /obj/item/wrench)) return ..() if(!(stat & NOPOWER) && on) to_chat(user, "You cannot unwrench this [src], turn it off first.") diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index 11874172340..6633c1ac10d 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -28,6 +28,46 @@ Thus, the two variables affect pump operation are set in New(): var/id = null var/datum/radio_frequency/radio_connection +/obj/machinery/atmospherics/binary/volume_pump/CtrlClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + toggle() + return ..() + +/obj/machinery/atmospherics/binary/volume_pump/AICtrlClick() + toggle() + return ..() + +/obj/machinery/atmospherics/binary/volume_pump/AltClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + set_max() + return + +/obj/machinery/atmospherics/binary/volume_pump/AIAltClick() + set_max() + return ..() + +/obj/machinery/atmospherics/binary/volume_pump/proc/toggle() + if(powered()) + on = !on + update_icon() + +/obj/machinery/atmospherics/binary/volume_pump/proc/set_max() + if(powered()) + transfer_rate = MAX_TRANSFER_RATE + update_icon() + /obj/machinery/atmospherics/binary/volume_pump/Destroy() if(SSradio) SSradio.remove_object(src, frequency) @@ -199,7 +239,15 @@ Thus, the two variables affect pump operation are set in New(): update_icon() /obj/machinery/atmospherics/binary/volume_pump/attackby(obj/item/W, mob/user, params) - if(!istype(W, /obj/item/wrench)) + if(istype(W, /obj/item/pen)) + var/t = copytext(stripped_input(user, "Enter the name for the volume pump.", "Rename", name), 1, MAX_NAME_LEN) + if(!t) + return + if(!in_range(src, usr) && loc != usr) + return + name = t + return + else if(!istype(W, /obj/item/wrench)) return ..() if(!(stat & NOPOWER) && on) to_chat(user, "You cannot unwrench this [src], turn it off first.") diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index c6720e45f6e..a778b01ea86 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -22,6 +22,45 @@ Filter types: var/frequency = 0 var/datum/radio_frequency/radio_connection +/obj/machinery/atmospherics/trinary/filter/CtrlClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + toggle() + return ..() + +/obj/machinery/atmospherics/trinary/filter/AICtrlClick() + toggle() + return ..() + +/obj/machinery/atmospherics/trinary/filter/AltClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + set_max() + return + +/obj/machinery/atmospherics/trinary/filter/AIAltClick() + set_max() + return ..() + +/obj/machinery/atmospherics/trinary/filter/proc/toggle() + if(powered()) + on = !on + update_icon() + +/obj/machinery/atmospherics/trinary/filter/proc/set_max() + if(powered()) + target_pressure = MAX_OUTPUT_PRESSURE + update_icon() /obj/machinery/atmospherics/trinary/filter/Destroy() if(SSradio) @@ -211,4 +250,16 @@ Filter types: . = TRUE update_icon() - SSnanoui.update_uis(src) \ No newline at end of file + SSnanoui.update_uis(src) + +/obj/machinery/atmospherics/trinary/filter/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/pen)) + var/t = copytext(stripped_input(user, "Enter the name for the filter.", "Rename", name), 1, MAX_NAME_LEN) + if(!t) + return + if(!in_range(src, usr) && loc != usr) + return + name = t + return + else + return ..() \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 0c64804b6da..e7c91172e3b 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -12,10 +12,50 @@ //node 3 is the outlet, nodes 1 & 2 are intakes +/obj/machinery/atmospherics/trinary/mixer/CtrlClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + toggle() + return ..() + +/obj/machinery/atmospherics/trinary/mixer/AICtrlClick() + toggle() + return ..() + +/obj/machinery/atmospherics/trinary/mixer/AltClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user) && !issilicon(usr)) + return + if(!ishuman(usr) && !issilicon(usr)) + return + set_max() + return + +/obj/machinery/atmospherics/trinary/mixer/AIAltClick() + set_max() + return ..() + /obj/machinery/atmospherics/trinary/mixer/flipped icon_state = "mmap" flipped = 1 +/obj/machinery/atmospherics/trinary/mixer/proc/toggle() + if(powered()) + on = !on + update_icon() + +/obj/machinery/atmospherics/trinary/mixer/proc/set_max() + if(powered()) + target_pressure = MAX_OUTPUT_PRESSURE + update_icon() + /obj/machinery/atmospherics/trinary/mixer/update_icon(safety = 0) if(flipped) icon_state = "m" @@ -176,4 +216,16 @@ . = TRUE update_icon() - SSnanoui.update_uis(src) \ No newline at end of file + SSnanoui.update_uis(src) + +/obj/machinery/atmospherics/trinary/mixer/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/pen)) + var/t = copytext(stripped_input(user, "Enter the name for the mixer.", "Rename", name), 1, MAX_NAME_LEN) + if(!t) + return + if(!in_range(src, usr) && loc != usr) + return + name = t + return + else + return ..() \ No newline at end of file