Files
Ghom 8c534a521e Maintenance PDA themes are added to roundstart PDAs on future rounds as well once installed (#92983)
## 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.
/🆑
2026-01-16 17:18:03 -05:00

105 lines
3.7 KiB
Plaintext

/datum/computer_file
///The name of the internal file shown in file management.
var/filename = "NewFile"
///The type of file format the file is in, placed after filename. PNG, TXT, ect. This would be NewFile.XXX
var/filetype = "XXX"
///How much GQ storage space the file will take to store. Integers only!
var/size = 1
///Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
var/undeletable = FALSE
///The computer file's personal ID
var/uid
///Static ID to ensure all IDs are unique.
var/static/file_uid = 0
///The modular computer hosting the file.
var/obj/item/modular_computer/computer
///The computer disk hosting the file.
var/obj/item/disk/computer/disk_host
/datum/computer_file/New()
..()
uid = file_uid++
RegisterSignal(src, COMSIG_COMPUTER_FILE_STORE, PROC_REF(on_install))
/datum/computer_file/Destroy(force)
if(computer)
computer = null
if(disk_host)
disk_host = null
return ..()
/**
* Used for special cases where an application
* Requires special circumstances to install on a PC
* Args:
* * potential_host - the ModPC that is attempting to store this file.
*/
/datum/computer_file/proc/can_store_file(obj/item/modular_computer/potential_host)
return TRUE
// Returns independent copy of this file.
/datum/computer_file/proc/clone(rename = FALSE)
var/datum/computer_file/temp = new type
temp.undeletable = undeletable
temp.size = size
if(rename)
temp.filename = filename + "(Copy)"
else
temp.filename = filename
temp.filetype = filetype
return temp
///Called post-installation of an application in a computer, after 'computer' var is set. Remember, the user is optional
/datum/computer_file/proc/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
SIGNAL_HANDLER
SHOULD_CALL_PARENT(TRUE)
computer_installing.stored_files.Add(src)
/**
* Called when examining a modular computer
* Args:
* Source - The tablet that's being examined
* User - Person examining the computer
*
* note: please replace this with signals when hdd's are removed and program's New() already has the tablet set.
*/
/datum/computer_file/proc/on_examine(obj/item/modular_computer/source, mob/user)
return null
/// Called on modular computer item_interaction, checking if any application uses the given item. Uses the item interaction chain flags.
/datum/computer_file/proc/application_item_interaction(mob/living/user, obj/item/tool, list/modifiers)
return NONE
/**
* Implement this when your program has an object that the user can eject.
*
* Examples include ejecting cells AI intellicards.
* Arguments:
* * user - The mob requesting the eject.
* * forced - Whether we are forced to eject everything (usually by the app being deleted)
*/
/datum/computer_file/proc/try_eject(mob/living/user, forced = FALSE)
return FALSE
/**
* Called when a computer program is shut down from the tablet's charge dying
* Arguments:
* * background - Whether the app is running in the background.
*/
/datum/computer_file/program/proc/event_powerfailure()
if(program_flags & PROGRAM_RUNS_WITHOUT_POWER)
return
kill_program()
/**
* Called when a computer program is crashing due to any required connection being shut off.
* Arguments:
* * background - Whether the app is running in the background.
*/
/datum/computer_file/program/proc/event_networkfailure(background)
kill_program()
if(background)
computer.visible_message(span_danger("\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error"))
else
computer.visible_message(span_danger("\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error."))