mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-15 20:52:41 +00:00
TGUI APCs TGUI vending machines Fix AI default_tgui_interaction TGUI Airlocks Station & Atmospheric Alert TGUI + Misc NTOS-TGUI Fixes TGUI Air Alarms & Central Atmospheric Control Airlock TGUI TG... got rid of UI for fire alarm. í´· TGUI Gas Heating/Cooling System TGUI Gas Pump & Passive Gate + Fixes TGUI Omni Atmospherics TGUI Pipe Dispensers & RPD TGUI IntelliCore & Vending Fix TGUI Handheld Tanks TGUI Portable Pump & Scrubber TGUI Tank Dispenser & Canisters TGUI Radios TGUI SMES & Air Alarm adjustment Tweak vending machine interfaces a tad TGUI Algae Farm TGUI general_air_control - Distro & Waste Console - Riot Control Console - Atmos Intake Console - Engine Cooling Console TGUI Heavy Scrubber Control (and body scanner fix) TGUI trinary devices & shutoff monitor TGUI Telecomms Log Browser TGUI Telecomms Machine Browser TGUI Spaceheater Internal Panel TGUI Gravity Generator TGUI Id Cards & Fix ID Card Images TGUI Id Card Redesign TGUI Turbolift TGUI Suit Cycler & Suit Storage Unit & Vending Fixes TGUI Power Monitor TGUI Signalers TGUI Employment Records TGUI Drone Console TGUI RIGSuits TGUI PA & PACMAN, and Margin Fix TGUI Solar Panels & Fix Power Monitor Adjust TGUI modules & their interaction with NTOS TGUI RCON TGUI Message Monitor Bump TGUI line limit to 120 (ParadiseSS13/Paradise#14002) TGUI Exonet & NTNet Relay TGUI Telecomms Multitool Menu TGUI Shield Capacitor & Shield Generator TGUI Supermatter-everything & Refactors
79 lines
2.4 KiB
Plaintext
79 lines
2.4 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
|
|
|
var/global/list/priority_air_alarms = list()
|
|
var/global/list/minor_air_alarms = list()
|
|
|
|
|
|
/obj/machinery/computer/atmos_alert
|
|
name = "atmospheric alert computer"
|
|
desc = "Used to access the station's atmospheric sensors."
|
|
circuit = /obj/item/weapon/circuitboard/atmos_alert
|
|
icon_keyboard = "atmos_key"
|
|
icon_screen = "alert:0"
|
|
light_color = "#e6ffff"
|
|
|
|
/obj/machinery/computer/atmos_alert/New()
|
|
..()
|
|
atmosphere_alarm.register_alarm(src, /obj/machinery/computer/station_alert/update_icon)
|
|
|
|
/obj/machinery/computer/atmos_alert/Destroy()
|
|
atmosphere_alarm.unregister_alarm(src)
|
|
..()
|
|
|
|
/obj/machinery/computer/atmos_alert/attack_hand(mob/user)
|
|
tgui_interact(user)
|
|
|
|
/obj/machinery/computer/atmos_alert/tgui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
ui = new(user, src, "AtmosAlertConsole", name)
|
|
ui.open()
|
|
|
|
/obj/machinery/computer/atmos_alert/tgui_data(mob/user)
|
|
var/list/data = list()
|
|
var/list/major_alarms = list()
|
|
var/list/minor_alarms = list()
|
|
|
|
for(var/datum/alarm/alarm in atmosphere_alarm.major_alarms(get_z(src)))
|
|
major_alarms[++major_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "\ref[alarm]")
|
|
|
|
for(var/datum/alarm/alarm in atmosphere_alarm.minor_alarms(get_z(src)))
|
|
minor_alarms[++minor_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "\ref[alarm]")
|
|
|
|
data["priority_alarms"] = major_alarms
|
|
data["minor_alarms"] = minor_alarms
|
|
|
|
return data
|
|
|
|
/obj/machinery/computer/atmos_alert/update_icon()
|
|
if(!(stat & (NOPOWER|BROKEN)))
|
|
var/list/alarms = atmosphere_alarm.major_alarms()
|
|
if(alarms.len)
|
|
icon_screen = "alert:2"
|
|
else
|
|
alarms = atmosphere_alarm.minor_alarms()
|
|
if(alarms.len)
|
|
icon_screen = "alert:1"
|
|
else
|
|
icon_screen = initial(icon_screen)
|
|
..()
|
|
|
|
/obj/machinery/computer/atmos_alert/tgui_act(action, params)
|
|
if(..())
|
|
return TRUE
|
|
|
|
switch(action)
|
|
if("clear")
|
|
var/datum/alarm/alarm = locate(params["ref"]) in atmosphere_alarm.alarms
|
|
if(alarm)
|
|
for(var/datum/alarm_source/alarm_source in alarm.sources)
|
|
var/obj/machinery/alarm/air_alarm = alarm_source.source
|
|
if(istype(air_alarm))
|
|
// I have to leave a note here:
|
|
// Once upon a time, this called air_alarm.Topic() with a custom topic state
|
|
// in order to perform three lines of code. In other words, pure insanity.
|
|
// Whyyyyyyyyyyyyyyyyyyyyyyy.
|
|
air_alarm.atmos_reset()
|
|
. = TRUE
|
|
update_icon()
|