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:
Batrachophreno
2025-08-03 16:12:30 +00:00
committed by GitHub
parent 1d51d94582
commit 6bba514a4d
7 changed files with 281 additions and 112 deletions
@@ -1,15 +1,23 @@
GLOBAL_VAR_INIT(file_uid, 0)
/datum/computer_file
var/filename = "NewFile" // Placehard_drive. No spacebars
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
/// Placehard_drive. No spacebars
var/filename = "NewFile"
/// File full names are [filename].[filetype] so like NewFile.XXX in this case
var/filetype = "XXX"
var/filedesc = null
var/size = 1 // File size in GQ. Integers only!
var/obj/item/computer_hardware/hard_drive/hard_drive // Harddrive that contains this file.
var/unsendable = FALSE // Whether the file may be sent to someone via NTNet transfer or other means.
var/undeletable = FALSE // Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc.
var/password = "" // Placeholder for password protected files.
var/uid // UID of this file
/// File size in GQ. Integers only!
var/size = 1
/// Harddrive that contains this file.
var/obj/item/computer_hardware/hard_drive/hard_drive
/// Whether the file may be sent to someone via NTNet transfer or other means.
var/unsendable = FALSE
/// Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc.
var/undeletable = FALSE
/// Placeholder for password protected files.
var/password = ""
/// UID of this file
var/uid
/datum/computer_file/New()
..()
@@ -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()