mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 16:07:36 +01:00
Misc Modular Computer Fixes/Cleanup (#21092)
Prompted by [this](https://github.com/Aurorastation/Aurora.3/issues/21090) (Atmos control app not reliably updating all alarms from SSmachinery.processing). Did what I could but barring a larger refactor of how computer programs are initialized, didn't want to burn Too much time so implemented a Refresh button in the application interface as an in-game fallback option. Also fixes the bug with Loadout-spawned laptops not booting; their hard drives were being initialized with default software due to accidental codeblock removal [here](https://github.com/Aurorastation/Aurora.3/pull/20660/files#diff-40a75a936400e3c347fd8c3d4c804190a63ac9be980912f6a9995efd1b296a1e). Restored the affecting code. Updated several other files I discovered in passing while working on this with proper DMdocs formatting.
This commit is contained in:
@@ -32,23 +32,30 @@
|
||||
if(monitored_alarm_ids)
|
||||
for(var/obj/machinery/alarm/alarm in SSmachinery.processing)
|
||||
if(alarm.alarm_id && (alarm.alarm_id in monitored_alarm_ids) && AreConnectedZLevels(computer.z, alarm.z))
|
||||
monitored_alarms += alarm
|
||||
monitored_alarms |= alarm
|
||||
else
|
||||
/// The computer of a silicon has null Z, so...
|
||||
var/turf/T = get_turf(computer)
|
||||
for(var/obj/machinery/alarm/alarm in SSmachinery.processing)
|
||||
var/turf/T = get_turf(computer) /// The computer of a silicon has null Z, so...
|
||||
if(AreConnectedZLevels(T.z, alarm.z))
|
||||
monitored_alarms += alarm
|
||||
monitored_alarms |= alarm
|
||||
|
||||
/datum/computer_file/program/atmos_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(action == "alarm")
|
||||
var/obj/machinery/alarm/alarm = locate(params["alarm"]) in (monitored_alarms.len ? monitored_alarms : SSmachinery.processing)
|
||||
if(alarm)
|
||||
var/datum/ui_state/TS = generate_state(alarm)
|
||||
alarm.ui_interact(usr, state = TS) //what the fuck?
|
||||
return TRUE
|
||||
switch(action)
|
||||
// Opens the interface for the given air alarm.
|
||||
if("alarm")
|
||||
var/obj/machinery/alarm/alarm = locate(params["alarm"]) in (monitored_alarms.len ? monitored_alarms : SSmachinery.processing)
|
||||
if(alarm)
|
||||
var/datum/ui_state/TS = generate_state(alarm)
|
||||
alarm.ui_interact(usr, state = TS) //what the fuck?
|
||||
return TRUE
|
||||
// Manually clear and repopulate the alarm list.
|
||||
if("refresh")
|
||||
monitored_alarms = list()
|
||||
get_alarms()
|
||||
|
||||
/datum/computer_file/program/atmos_control/ui_data(mob/user)
|
||||
var/list/data = initial_data()
|
||||
|
||||
Reference in New Issue
Block a user