mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-12 15:47:04 +01:00
Is now possible to create a sub-list of air alarms the atmos control console will list.
Will be used to allow scientists on the outpost to remotely control their isolation cell air alarms.
This commit is contained in:
@@ -11,8 +11,17 @@
|
||||
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
|
||||
var/obj/machinery/alarm/current
|
||||
var/overridden = 0 //not set yet, can't think of a good way to do it
|
||||
req_access = list(access_atmospherics)
|
||||
req_access = list(access_ce)
|
||||
var/list/monitored_alarm_ids = null
|
||||
var/list/monitored_alarms = null
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/laptop
|
||||
name = "Atmospherics Laptop"
|
||||
desc = "Cheap Nanotrasen Laptop."
|
||||
icon_state = "medlaptop"
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob)
|
||||
return interact(user)
|
||||
@@ -25,17 +34,29 @@
|
||||
return
|
||||
return interact(user)
|
||||
|
||||
// Original implementation used "in typesof(/obj/machinery/alarm/)" in New()
|
||||
// but would throw runtime errors when attempting to access alarm_id
|
||||
obj/machinery/computer/atmoscontrol/proc/setup_monitor()
|
||||
if(!monitored_alarms && monitored_alarm_ids)
|
||||
monitored_alarms = new
|
||||
for(var/obj/machinery/alarm/alarm in machines)
|
||||
if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids)
|
||||
monitored_alarms += alarm
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/interact(mob/user)
|
||||
setup_monitor()
|
||||
user.set_machine(src)
|
||||
if(allowed(user))
|
||||
overridden = 1
|
||||
else if(!emagged)
|
||||
overridden = 0
|
||||
var/dat = "<a href='?src=\ref[src]&reset=1'>Main Menu</a><hr>"
|
||||
if(monitored_alarms && monitored_alarms.len == 1)
|
||||
current = monitored_alarms[1]
|
||||
if(current)
|
||||
dat += specific()
|
||||
else
|
||||
for(var/obj/machinery/alarm/alarm in dd_sortedObjectList(machines))
|
||||
for(var/obj/machinery/alarm/alarm in dd_sortedObjectList(monitored_alarms ? monitored_alarms : machines))
|
||||
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
|
||||
switch(max(alarm.danger_level, alarm.alarm_area.atmosalm))
|
||||
if (0)
|
||||
|
||||
Reference in New Issue
Block a user