mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 10:42:37 +00:00
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous. There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this. Hi codeowners! Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
/datum/computer_file
|
|
var/filename = "NewFile" // Placeholder. No spacebars
|
|
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
|
|
var/size = 1 // File size in GQ. Integers only!
|
|
var/obj/item/computer_hardware/hard_drive/holder // Holder 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 TRUE prevents deletion/renaming/etc.
|
|
var/uid // UID of this file
|
|
var/static/file_uid = 0
|
|
|
|
/datum/computer_file/New()
|
|
..()
|
|
uid = file_uid++
|
|
|
|
/datum/computer_file/Destroy()
|
|
if(!holder)
|
|
return ..()
|
|
|
|
holder.remove_file(src)
|
|
// holder.holder is the computer that has drive installed. If we are Destroy()ing program that's currently running kill it.
|
|
if(holder.holder && holder.holder.active_program == src)
|
|
holder.holder.kill_program(forced = TRUE)
|
|
holder = null
|
|
return ..()
|
|
|
|
// Returns independent copy of this file.
|
|
/datum/computer_file/proc/clone(rename = FALSE)
|
|
var/datum/computer_file/temp = new type
|
|
temp.unsendable = unsendable
|
|
temp.undeletable = undeletable
|
|
temp.size = size
|
|
if(rename)
|
|
temp.filename = filename + "(Copy)"
|
|
else
|
|
temp.filename = filename
|
|
temp.filetype = filetype
|
|
return temp
|