diff --git a/baystation12.dme b/baystation12.dme index 64bb7f88d5..70f38378d6 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1225,9 +1225,9 @@ #include "code\modules\nano\JSON Reader.dm" #include "code\modules\nano\JSON Writer.dm" #include "code\modules\nano\nanoexternal.dm" +#include "code\modules\nano\nanointeraction.dm" #include "code\modules\nano\nanomanager.dm" #include "code\modules\nano\nanomapgen.dm" -#include "code\modules\nano\nanoprocs.dm" #include "code\modules\nano\nanoui.dm" #include "code\modules\nano\modules\crew_monitor.dm" #include "code\modules\nano\modules\power_monitor.dm" diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 068f7efdb3..63a0549acc 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -173,7 +173,7 @@ use_power = !use_power if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing - panic = text2num(signal.data["panic_siphon"] != null) + panic = text2num(signal.data["panic_siphon"]) if(panic) use_power = 1 scrubbing = 0 @@ -189,8 +189,12 @@ if(signal.data["scrubbing"] != null) scrubbing = text2num(signal.data["scrubbing"]) + if(scrubbing) + panic = 0 if(signal.data["toggle_scrubbing"]) scrubbing = !scrubbing + if(scrubbing) + panic = 0 var/list/toggle = list() diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 2ffdcc6e2f..a2e78a10f9 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -195,7 +195,6 @@ if(RCON_YES) remote_control = 1 - updateDialog() return /obj/machinery/alarm/proc/handle_heating_cooling(var/datum/gas_mixture/environment) @@ -468,7 +467,7 @@ frequency.post_signal(src, alert_signal) /obj/machinery/alarm/attack_ai(mob/user) - return interact(user) + ui_interact(user) /obj/machinery/alarm/attack_hand(mob/user) . = ..() @@ -477,315 +476,179 @@ return interact(user) /obj/machinery/alarm/interact(mob/user) - user.set_machine(src) + ui_interact(user) + wires.Interact(user) - if(buildstage!=2) - return +/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/custom_state = null) + var/data[0] + var/remote_connection = 0 + var/remote_access = 0 + if(custom_state) + var/list/state = custom_state.href_list(user) + remote_connection = state["remote_connection"] // Remote connection means we're non-adjacent/connecting from another computer + remote_access = state["remote_access"] // Remote access means we also have the privilege to alter the air alarm. - if((get_dist(src, user) > 1 )) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=air_alarm") - user << browse(null, "window=AAlarmwires") - return + data["locked"] = locked && !user.isSilicon() + data["remote_connection"] = remote_connection + data["remote_access"] = remote_access + data["rcon"] = rcon_setting + data["screen"] = screen + populate_status(data) - else if (istype(user, /mob/living/silicon) && aidisabled) - user << "AI control for this Air Alarm interface has been disabled." - user << browse(null, "window=air_alarm") - return + if(!(locked && !remote_connection) || remote_access || user.isSilicon()) + populate_controls(data) - if(wiresexposed && (!istype(user, /mob/living/silicon/ai))) - wires.Interact(user) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if(!ui) + ui = new(user, src, ui_key, "air_alarm.tmpl", src.name, 625, 625, master_ui = master_ui, custom_state = custom_state) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) - if(!shorted) - user << browse(return_text(user),"window=air_alarm") - onclose(user, "air_alarm") - - return - -/obj/machinery/alarm/proc/return_text(mob/user) - if(!(istype(user, /mob/living/silicon)) && locked) - return "
| Remote Control: " - if(rcon_setting == RCON_NO) - dat += "Off" - else - dat += "Off" - dat += " | " - if(rcon_setting == RCON_AUTO) - dat += "Auto" - else - dat += "Auto" - dat += " | " - if(rcon_setting == RCON_YES) - dat += "On" - else - dat += "On | "
-
- //Hackish, I know. I didn't feel like bothering to rework all of this.
- dat += "Thermostat: [target_temperature - T0C]C |
| min2 | min1 | max1 | max2 | |
|---|---|---|---|---|
| [gases[g]] | " + "other" = "Other") + for (var/g in gas_names) + thresholds[++thresholds.len] = list("name" = gas_names[g], "settings" = list()) selected = TLV[g] for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"] | " - output += "|||
| Pressure | " + thresholds[++thresholds.len] = list("name" = "Pressure", "settings" = list()) for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"] | " - output += "|||
| Temperature | " + thresholds[++thresholds.len] = list("name" = "Temperature", "settings" = list()) for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"] | " - output += "
| + | |
+ Remote Control+ |
+
+ Thermostat+ |
+ + |
|
+
+
+
+ {{:helper.link('Off', null, { 'rcon' : 1}, data.remote_connection && !data.remote_access ? (data.rcon == 1 ? 'yellowButton' : 'disabled') : null, data.rcon == 1 ? 'selected' : null)}}
+ {{:helper.link('Auto', null, { 'rcon' : 2}, data.remote_connection && !data.remote_access ? (data.rcon == 2 ? 'yellowButton' : 'disabled') : null, data.rcon == 2 ? 'selected' : null)}}
+ {{:helper.link('On', null, { 'rcon' : 3}, data.remote_connection && !data.remote_access ? (data.rcon == 3 ? 'yellowButton' : 'disabled') : null, data.rcon == 3 ? 'selected' : null)}}
+
+ |
+ + {{:helper.link(data.target_temperature, null, { 'temperature' : 1})}} + | +
| min2 | min1 | max1 | max2 | +|
| {{:value.name}} | + {{for value.settings :settingsValue:settingsIndex}} ++ {{:helper.link(settingsValue.selected >= 0 ? helper.fixed(settingsValue.selected, 2) : "Off", null, { 'command' : 'set_threshold', 'env' : settingsValue.env, 'var' : settingsValue.val })}} + | + {{/for}} +