mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +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
62 lines
2.0 KiB
Plaintext
62 lines
2.0 KiB
Plaintext
// POWERNET SENSOR MONITORING CONSOLE
|
|
// Connects to powernet sensors and loads data from them. Shows this data to the user.
|
|
// Newly supports NanoUI.
|
|
|
|
|
|
/obj/machinery/computer/power_monitor
|
|
name = "Power Monitoring Console"
|
|
desc = "Computer designed to remotely monitor power levels around the station"
|
|
icon_keyboard = "power_key"
|
|
icon_screen = "power_monitor"
|
|
light_color = "#ffcc33"
|
|
|
|
//computer stuff
|
|
density = 1
|
|
anchored = 1.0
|
|
circuit = /obj/item/weapon/circuitboard/powermonitor
|
|
var/alerting = 0
|
|
use_power = USE_POWER_IDLE
|
|
idle_power_usage = 300
|
|
active_power_usage = 300
|
|
var/datum/tgui_module/power_monitor/power_monitor
|
|
|
|
// Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update.
|
|
/obj/machinery/computer/power_monitor/process()
|
|
var/alert = check_warnings()
|
|
if(alert != alerting)
|
|
alerting = !alerting
|
|
update_icon()
|
|
/* VOREStation Move - Moved to VR File
|
|
// Updates icon of this computer according to current status.
|
|
/obj/machinery/computer/power_monitor/update_icon()
|
|
if(!(stat & (NOPOWER|BROKEN)))
|
|
if(alerting)
|
|
icon_screen = "[initial(icon_screen)]"
|
|
else
|
|
icon_screen = "[initial(icon_screen)]_warn"
|
|
..()
|
|
*/
|
|
// On creation automatically connects to active sensors. This is delayed to ensure sensors already exist.
|
|
/obj/machinery/computer/power_monitor/New()
|
|
..()
|
|
power_monitor = new(src)
|
|
|
|
// On user click opens the UI of this computer.
|
|
/obj/machinery/computer/power_monitor/attack_hand(mob/user)
|
|
add_fingerprint(user)
|
|
|
|
if(stat & (BROKEN|NOPOWER))
|
|
return
|
|
tgui_interact(user)
|
|
|
|
// Uses dark magic to operate the NanoUI of this computer.
|
|
/obj/machinery/computer/power_monitor/tgui_interact(mob/user, var/datum/tgui/ui = null)
|
|
power_monitor.tgui_interact(user, ui)
|
|
|
|
// Verifies if any warnings were registered by connected sensors.
|
|
/obj/machinery/computer/power_monitor/proc/check_warnings()
|
|
for(var/obj/machinery/power/sensor/S in power_monitor.grid_sensors)
|
|
if(S.check_grid_warning())
|
|
return 1
|
|
return 0
|