mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
AAC fixings
This commit is contained in:
@@ -1,95 +1,126 @@
|
||||
/datum/automation/set_vent_pump_mode
|
||||
name="Vent Pump: Mode"
|
||||
name = "Vent Pump: Mode"
|
||||
|
||||
var/vent_pump=null
|
||||
var/mode="stabilize"
|
||||
var/vent_pump = null
|
||||
var/mode = "stabilize"
|
||||
var/vent_type = 0//0 for unary vents, 1 for DP vents
|
||||
|
||||
var/list/modes = list("stabilize","purge")
|
||||
var/list/modes = list("stabilize", "purge")
|
||||
|
||||
/datum/automation/set_vent_pump_mode/Export()
|
||||
var/list/json = ..()
|
||||
json["vent_pump"]=vent_pump
|
||||
json["mode"]=mode
|
||||
json["vent_pump"] = vent_pump
|
||||
json["mode"] = mode
|
||||
json["vent_type"] = vent_type
|
||||
return json
|
||||
|
||||
/datum/automation/set_vent_pump_mode/Import(var/list/json)
|
||||
..(json)
|
||||
vent_pump = json["vent_pump"]
|
||||
mode = json["mode"]
|
||||
vent_type = text2num(json["vent_type"])
|
||||
|
||||
/datum/automation/set_vent_pump_mode/New(var/obj/machinery/computer/general_air_control/atmos_automation/aa)
|
||||
..(aa)
|
||||
children=list(null)
|
||||
children = list(null)
|
||||
|
||||
/datum/automation/set_vent_pump_mode/process()
|
||||
if(vent_pump)
|
||||
parent.send_signal(list ("tag" = vent_pump, mode), RADIO_FROM_AIRALARM)
|
||||
parent.send_signal(list ("tag" = vent_pump, mode), filter = (vent_type ? RADIO_ATMOSIA : RADIO_FROM_AIRALARM))
|
||||
return 0
|
||||
|
||||
/datum/automation/set_vent_pump_mode/GetText()
|
||||
return "Set vent pump <a href=\"?src=\ref[src];set_vent_pump=1\">[fmtString(vent_pump)]</a> mode to <a href=\"?src=\ref[src];set_mode=1\">[mode]</a>."
|
||||
return "Set <a href=\"?src=\ref[src];toggle_type=1\">[vent_type ? "Dual-Port" : "Unary"]</a> vent pump <a href=\"?src=\ref[src];set_vent_pump=1\">[fmtString(vent_pump)]</a> mode to <a href=\"?src=\ref[src];set_mode=1\">[mode]</a>."
|
||||
|
||||
/datum/automation/set_vent_pump_mode/Topic(href,href_list)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(href_list["set_mode"])
|
||||
mode = input("Select a mode to put this pump into.",mode) in modes
|
||||
parent.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
if(href_list["set_vent_pump"])
|
||||
var/list/injector_names=list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names|=I.id_tag
|
||||
for(var/obj/machinery/atmospherics/binary/dp_vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names|=I.id_tag
|
||||
var/list/injector_names = list()
|
||||
|
||||
if(!mode)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names |=I.id_tag
|
||||
|
||||
else
|
||||
for(var/obj/machinery/atmospherics/binary/dp_vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names |= I.id_tag
|
||||
|
||||
vent_pump = input("Select a vent:", "Vent Pumps", vent_pump) as null|anything in injector_names
|
||||
parent.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
if(href_list["toggle_type"])
|
||||
vent_type = !vent_type
|
||||
parent.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
/datum/automation/set_vent_pump_power
|
||||
name="Vent Pump: Power"
|
||||
|
||||
var/vent_pump=null
|
||||
var/state=0
|
||||
var/vent_pump = null
|
||||
var/state = 0
|
||||
var/mode = 0//0 for unary vents, 1 for DP vents.
|
||||
|
||||
/datum/automation/set_vent_pump_power/Export()
|
||||
var/list/json = ..()
|
||||
json["vent_pump"]=vent_pump
|
||||
json["state"]=state
|
||||
json["vent_pump"] = vent_pump
|
||||
json["state"] = state
|
||||
json["mode"] = mode
|
||||
return json
|
||||
|
||||
/datum/automation/set_vent_pump_power/Import(var/list/json)
|
||||
..(json)
|
||||
vent_pump = json["vent_pump"]
|
||||
state = text2num(json["state"])
|
||||
|
||||
/datum/automation/set_vent_pump_power/New(var/obj/machinery/computer/general_air_control/atmos_automation/aa)
|
||||
..(aa)
|
||||
mode = text2num(json["mode"])
|
||||
|
||||
/datum/automation/set_vent_pump_power/process()
|
||||
if(vent_pump)
|
||||
parent.send_signal(list ("tag" = vent_pump, "power"=state), RADIO_FROM_AIRALARM)
|
||||
parent.send_signal(list ("tag" = vent_pump, "power"=state), filter = (mode ? RADIO_ATMOSIA : RADIO_FROM_AIRALARM))
|
||||
|
||||
/datum/automation/set_vent_pump_power/GetText()
|
||||
return "Set vent pump <a href=\"?src=\ref[src];set_vent_pump=1\">[fmtString(vent_pump)]</a> power to <a href=\"?src=\ref[src];set_power=1\">[state ? "on" : "off"]</a>."
|
||||
return "Set <a href=\"?src=\ref[src];toggle_mode=1\">[mode ? "Dual-Port" : "Unary"]</a> vent pump <a href=\"?src=\ref[src];set_vent_pump=1\">[fmtString(vent_pump)]</a> power to <a href=\"?src=\ref[src];set_power=1\">[state ? "on" : "off"]</a>."
|
||||
|
||||
/datum/automation/set_vent_pump_power/Topic(href,href_list)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(href_list["set_power"])
|
||||
state = !state
|
||||
parent.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
if(href_list["set_vent_pump"])
|
||||
var/list/injector_names=list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names|=I.id_tag
|
||||
for(var/obj/machinery/atmospherics/binary/dp_vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names|=I.id_tag
|
||||
var/list/injector_names = list()
|
||||
if(!mode)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names |= I.id_tag
|
||||
else
|
||||
for(var/obj/machinery/atmospherics/binary/dp_vent_pump/I in atmos_machines)
|
||||
if(!isnull(I.id_tag) && I.frequency == parent.frequency)
|
||||
injector_names |= I.id_tag
|
||||
|
||||
vent_pump = input("Select a vent:", "Vent Pumps", vent_pump) as null|anything in injector_names
|
||||
parent.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
if(href_list["toggle_mode"])
|
||||
mode = !mode
|
||||
parent.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
/datum/automation/set_vent_pump_pressure//controls the internal/external pressure bounds of a vent pump.
|
||||
name = "Vent Pump: Pressure Settings"
|
||||
|
||||
@@ -116,9 +147,6 @@
|
||||
extpressure = text2num(json["extpressure"])
|
||||
mode = text2num(json["mode"])
|
||||
|
||||
/datum/automation/set_vent_pump_pressure/New(var/obj/machinery/computer/general_air_control/atmos_automation/aa)
|
||||
..(aa)
|
||||
|
||||
/datum/automation/set_vent_pump_pressure/process()
|
||||
if(vent_pump)
|
||||
var/list/data = list( \
|
||||
@@ -212,7 +240,6 @@ checks bitflags
|
||||
4 = internal out (ignored by unaries)
|
||||
*/
|
||||
|
||||
|
||||
/datum/automation/set_vent_pressure_checks/Export()
|
||||
var/list/json = ..()
|
||||
json["vent_pump"] = vent_pump
|
||||
|
||||
4
html/changelogs/PJB3005-muhAAC.yml
Normal file
4
html/changelogs/PJB3005-muhAAC.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
author: PJB3005
|
||||
delete-after: true
|
||||
changes:
|
||||
- bugfix: The AAC's vent pump mode & power automations can now interact with DP vents again.
|
||||
Reference in New Issue
Block a user