mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-23 07:05:13 +01:00
8c534a521e
## About The Pull Request I'm making the ordeal of finding a maint disk (or buying blackmarket bootleg disk) with a theme in it a slightly more rewarding experience, while sticking to the concept that it's something you've to find, unlike default PDA themes. This PR also proves to be an opportunity to put the progress tab that I coded a year ago for the 'Fishdex' to good use. TODO: ~~Refactor preferences to allow specific choices to be shown/hidden depending on whether the player meets a defined criteria, otherwise you'll have to do it manually every round, which is lame~~ - [x] Make some simple ui icons associated with each unlockable theme to be shown in the cheevo progress tab - [x] Code to validate deserialized DB values, in the remote case that any theme is removed in the future, as well as unit test code for any non-abstract theme without ID - [x] Add sound cue and chat feedback when unlocking a theme (or when fishing a new kind of fish for the first time, like, the code's similar) - [x] Test all of this ## Why It's Good For The Game These themes are basically an end in itself, and I understand the reason behind their existence is to make for some cute, little maint loot, but relegating it to chance of finding a disk somewhere in maintenance, **every single round** really rots whatever little substance this purely cosmetic feature already has. ## Changelog 🆑 add: Once installed, special PDA themes from maintenance disks will be present on your roundstart PDA on future rounds (Sadly I couldn't figure out a way to add those to the preferences UI yet). You can check which PDA themes you've unlocked in the Progress tab of the achievements UI. /🆑
49 lines
2.0 KiB
Plaintext
49 lines
2.0 KiB
Plaintext
/datum/computer_file/program/alarm_monitor
|
|
filename = "alarmmonitor"
|
|
filedesc = "Canary"
|
|
downloader_category = PROGRAM_CATEGORY_ENGINEERING
|
|
ui_header = "alarm_green.gif"
|
|
program_open_overlay = "alert-green"
|
|
extended_desc = "This program provides visual interface for a station's alarm system."
|
|
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
|
|
size = 4
|
|
tgui_id = "NtosStationAlertConsole"
|
|
program_icon = "bell"
|
|
/// If there is any station alert
|
|
var/has_alert = FALSE
|
|
/// Station alert datum for showing alerts UI
|
|
var/datum/station_alert/alert_control
|
|
|
|
/datum/computer_file/program/alarm_monitor/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
|
. = ..()
|
|
//We want to send an alarm if we're in one of the mining home areas
|
|
//Or if we're on station. Otherwise, die.
|
|
var/list/allowed_areas = GLOB.the_station_areas + typesof(/area/mine)
|
|
alert_control = new(computer, list(ALARM_ATMOS, ALARM_FIRE, ALARM_POWER), listener_areas = allowed_areas)
|
|
RegisterSignals(alert_control.listener, list(COMSIG_ALARM_LISTENER_TRIGGERED, COMSIG_ALARM_LISTENER_CLEARED), PROC_REF(update_alarm_display))
|
|
|
|
/datum/computer_file/program/alarm_monitor/Destroy()
|
|
QDEL_NULL(alert_control)
|
|
return ..()
|
|
|
|
/datum/computer_file/program/alarm_monitor/ui_data(mob/user)
|
|
var/list/data = list()
|
|
data += alert_control.ui_data(user)
|
|
return data
|
|
|
|
/datum/computer_file/program/alarm_monitor/proc/update_alarm_display()
|
|
SIGNAL_HANDLER
|
|
// has_alert is true if there are any active alarms in our listener.
|
|
has_alert = (length(alert_control.listener.alarms) > 0)
|
|
|
|
if(!has_alert)
|
|
program_open_overlay = "alert-green"
|
|
ui_header = "alarm_green.gif"
|
|
else
|
|
// If we don't know the status, assume the worst.
|
|
// Technically we should never have anything other than a truthy or falsy value
|
|
// but this will allow for unknown values to fall through to be an actual alert.
|
|
program_open_overlay = "alert-red"
|
|
ui_header = "alarm_red.gif"
|
|
update_computer_icon() // Always update the icon after we check our conditional because we might've changed it
|