Add record programs, keeps old consoles to avoid converting main maps. (#7225)

Add record printing (fixes #6042)
This commit is contained in:
Karolis
2019-12-23 09:46:15 +02:00
committed by Erki
parent c586d6a98c
commit 4e56f6e66e
21 changed files with 734 additions and 161 deletions
@@ -7,6 +7,8 @@
icon = 'icons/obj/modular_laptop.dmi'
icon_state = "laptop-open"
icon_state_broken = "laptop-broken"
randpixel = 6
center_of_mass = list("x"=14, "y"=10)
base_idle_power_usage = 25
base_active_power_usage = 200
max_hardware_size = 2
@@ -22,16 +22,19 @@
// Engineering
/obj/item/modular_computer/console/preset/engineering/
name = "engineering console"
_app_preset_name = "engineering"
enrolled = 1
// Medical
/obj/item/modular_computer/console/preset/medical/
name = "medical console"
_app_preset_name = "medical"
enrolled = 1
// Research
/obj/item/modular_computer/console/preset/research/
name = "research console"
_app_preset_name = "research"
enrolled = 1
@@ -41,6 +44,7 @@
// Command
/obj/item/modular_computer/console/preset/command/
name = "command console"
_app_preset_name = "command"
enrolled = 1
@@ -52,6 +56,7 @@
card_slot = new/obj/item/computer_hardware/card_slot(src)
/obj/item/modular_computer/console/preset/captain/
name = "captain's console"
_app_preset_name = "captain"
enrolled = 1
@@ -64,16 +69,29 @@
// Security
/obj/item/modular_computer/console/preset/security/
name = "security console"
_app_preset_name = "security"
enrolled = 1
/obj/item/modular_computer/console/preset/security/investigations
name = "investigations console"
_app_preset_name = "security_inv"
enrolled = 1
/obj/item/modular_computer/console/preset/security/hos
name = "head of security's console"
_app_preset_name = "security_head"
enrolled = 1
// Civilian
/obj/item/modular_computer/console/preset/civilian/
name = "civilian console"
_app_preset_name = "civilian"
enrolled = 1
// Supply
/obj/item/modular_computer/console/preset/supply/
name = "supply console"
_app_preset_name = "supply"
enrolled = 1
@@ -0,0 +1,107 @@
/obj/item/modular_computer/laptop/preset
anchored = 0
screen_on = 0
icon_state = "laptop-closed"
/obj/item/modular_computer/laptop/preset/install_default_hardware()
..()
processor_unit = new/obj/item/computer_hardware/processor_unit(src)
hard_drive = new/obj/item/computer_hardware/hard_drive(src)
network_card = new/obj/item/computer_hardware/network_card(src)
battery_module = new/obj/item/computer_hardware/battery_module(src)
battery_module.charge_to_full()
nano_printer = new/obj/item/computer_hardware/nano_printer(src)
nano_printer.max_paper = 10
nano_printer.stored_paper = 5
/obj/item/modular_computer/laptop/preset/install_default_programs()
..()
// Engineering
/obj/item/modular_computer/laptop/preset/engineering/
name = "engineering laptop"
desc = "A portable computer belonging to the engineering department. It appears to have been used as a door stop at one point or another."
_app_preset_name = "engineering"
enrolled = 1
/obj/item/modular_computer/laptop/preset/engineering/ce/
name = "chief engineer's laptop"
desc = "A portable computer belonging to the chief engineer."
_app_preset_name = "engineering_head"
// Medical
/obj/item/modular_computer/laptop/preset/medical/
name = "medical laptop"
desc = "A portable computer belonging to the medical department."
_app_preset_name = "medical"
enrolled = 1
/obj/item/modular_computer/laptop/preset/medical/cmo/
name = "chief medical officer's laptop"
desc = "A portable computer belonging to the chief medical officer."
_app_preset_name = "medical_head"
// Research
/obj/item/modular_computer/laptop/preset/research/
name = "research laptop"
desc = "A portable computer belonging to the research department."
_app_preset_name = "research"
enrolled = 1
/obj/item/modular_computer/laptop/preset/research/install_default_hardware()
..()
ai_slot = new/obj/item/computer_hardware/ai_slot(src)
/obj/item/modular_computer/laptop/preset/research/rd/
name = "research director's laptop"
desc = "A portable computer belonging to the research director. The edges are stained and partially melted."
_app_preset_name = "research_head"
// Command
/obj/item/modular_computer/laptop/preset/command/
name = "command laptop"
_app_preset_name = "command"
enrolled = 1
/obj/item/modular_computer/laptop/preset/command/hop/
name = "head of personnel's laptop"
desc = "A portable computer beloning to the head of personnel. The fan is filled with dog hair."
_app_preset_name = "command_hop"
/obj/item/modular_computer/laptop/preset/command/captain/
name = "captain's laptop"
desc = "A portable computer belonging to the captain."
_app_preset_name = "captain"
// Security
/obj/item/modular_computer/laptop/preset/security/
name = "security laptop"
desc = "A portable computer belonging to the security department."
_app_preset_name = "security"
enrolled = 1
/obj/item/modular_computer/laptop/preset/security/hos/
name = "head of security's laptop"
desc = "A portable computer belonging to the head of security. It smells faintly of gunpowder."
_app_preset_name = "security_head"
// Civilian
/obj/item/modular_computer/laptop/preset/civilian/
_app_preset_name = "civilian"
enrolled = 1
// Supply
/obj/item/modular_computer/laptop/preset/supply/
name = "supply laptop"
desc = "A portable computer belonging to cargo."
_app_preset_name = "supply"
enrolled = 1
// Representative
/obj/item/modular_computer/laptop/preset/representative/
name = "representative's laptop"
desc = "A portable computer belonging to the representative's office."
_app_preset_name = "representative"
enrolled = 1
@@ -37,6 +37,28 @@
)
return _prg_list
/datum/modular_computer_app_presets/engineering/ce
name = "engineering_head"
display_name = "Engineering - CE"
description = "Contains the most common engineering programs and command software."
available = 0
/datum/modular_computer_app_presets/engineering/ce/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/power_monitor(),
new/datum/computer_file/program/alarm_monitor(),
new/datum/computer_file/program/atmos_control(),
new/datum/computer_file/program/rcon_console(),
new/datum/computer_file/program/camera_monitor(),
new/datum/computer_file/program/lighting_control(),
new/datum/computer_file/program/comm(),
new/datum/computer_file/program/records/employment()
)
return _prg_list
/datum/modular_computer_app_presets/medical
name = "medical"
display_name = "Medical"
@@ -47,7 +69,25 @@
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/suit_sensors()
new/datum/computer_file/program/suit_sensors(),
new/datum/computer_file/program/records/medical()
)
return _prg_list
/datum/modular_computer_app_presets/medical/cmo
name = "medical_head"
display_name = "Medical - CMO"
description = "Contains the most common medical programs and command software."
available = 0
/datum/modular_computer_app_presets/medical/cmo/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/suit_sensors(),
new/datum/computer_file/program/comm(),
new/datum/computer_file/program/records/employment(),
new/datum/computer_file/program/records/medical()
)
return _prg_list
@@ -66,6 +106,24 @@
)
return _prg_list
/datum/modular_computer_app_presets/research/rd
name = "research_head"
display_name = "Research - RD"
description = "Contains the most common research programs and command software."
available = 0
/datum/modular_computer_app_presets/research/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/ntnetmonitor(),
new/datum/computer_file/program/aidiag(),
//new/datum/computer_file/program/exosuit_monitor(),
new/datum/computer_file/program/comm(1),
new/datum/computer_file/program/records/employment()
)
return _prg_list
/datum/modular_computer_app_presets/command
name = "command"
display_name = "Command"
@@ -77,7 +135,26 @@
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/card_mod(),
new/datum/computer_file/program/comm(1)
new/datum/computer_file/program/comm(1),
new/datum/computer_file/program/records/employment()
)
return _prg_list
/datum/modular_computer_app_presets/command/hop
name = "command_hop"
display_name = "Command - HoP"
description = "Contains the most common command programs."
available = 0
/datum/modular_computer_app_presets/command/hop/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/civilian/cargocontrol(),
new/datum/computer_file/program/card_mod(),
new/datum/computer_file/program/comm(),
new/datum/computer_file/program/records/employment(),
new/datum/computer_file/program/records/security()
)
return _prg_list
@@ -91,12 +168,15 @@
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/card_mod(),
new/datum/computer_file/program/comm(1,1),
new/datum/computer_file/program/comm(1),
new/datum/computer_file/program/camera_monitor(),
new/datum/computer_file/program/digitalwarrant(),
new/datum/computer_file/program/civilian/cargocontrol(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/alarm_monitor()
new/datum/computer_file/program/alarm_monitor(),
new/datum/computer_file/program/records/employment(),
new/datum/computer_file/program/records/medical(),
new/datum/computer_file/program/records/security()
)
return _prg_list
@@ -112,7 +192,45 @@
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/camera_monitor(),
new/datum/computer_file/program/comm(),
new/datum/computer_file/program/digitalwarrant()
new/datum/computer_file/program/digitalwarrant(),
new/datum/computer_file/program/records/security(),
new/datum/computer_file/program/records/employment()
)
return _prg_list
/datum/modular_computer_app_presets/security/investigations
name = "security_inv"
display_name = "Security - Investigations"
description = "Contains the most common security and forensics programs."
available = 0
/datum/modular_computer_app_presets/security/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/camera_monitor(),
new/datum/computer_file/program/digitalwarrant(),
new/datum/computer_file/program/records/security(),
new/datum/computer_file/program/records/employment(),
new/datum/computer_file/program/records/medical()
)
return _prg_list
/datum/modular_computer_app_presets/security/hos
name = "security_head"
display_name = "Security - HoS"
description = "Contains the most common security programs and command software."
available = 0
/datum/modular_computer_app_presets/security/hos/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/camera_monitor(),
new/datum/computer_file/program/comm(),
new/datum/computer_file/program/digitalwarrant(),
new/datum/computer_file/program/records/security(),
new/datum/computer_file/program/comm(1),
new/datum/computer_file/program/records/employment()
)
return _prg_list
@@ -159,6 +277,21 @@
)
return _prg_list
/datum/modular_computer_app_presets/representative
name = "representative"
display_name = "Representative"
description = "Contains software intended for representatives."
available = 0
/datum/modular_computer_app_presets/representative/return_install_programs()
var/list/_prg_list = list(
new/datum/computer_file/program/filemanager(),
new/datum/computer_file/program/chatclient(),
new/datum/computer_file/program/game/sudoku(),
new/datum/computer_file/program/civilian/cargoorder(),
new/datum/computer_file/program/records/employment()
)
return _prg_list
/datum/modular_computer_app_presets/wall_generic
name = "wallgeneric"
display_name = "Wall - Generic"
@@ -201,7 +334,8 @@
new/datum/computer_file/program/suit_sensors(),
new/datum/computer_file/program/alarm_monitor(),
new/datum/computer_file/program/lighting_control(),
new/datum/computer_file/program/aidiag()
new/datum/computer_file/program/aidiag(),
new/datum/computer_file/program/records()
)
return _prg_list
@@ -0,0 +1,340 @@
/datum/computer_file/program/records
filename = "record"
filedesc = "Records"
extended_desc = "Used to view, edit and maintain records."
program_icon_state = "generic"
color = LIGHT_COLOR_BLUE
available_on_ntnet = 0
size = 6
requires_ntnet = 1
requires_ntnet_feature = NTNET_SYSTEMCONTROL
requires_access_to_run = PROGRAM_ACCESS_LIST_ONE
var/records_type = RECORD_GENERAL | RECORD_MEDICAL | RECORD_SECURITY | RECORD_VIRUS | RECORD_WARRANT | RECORD_LOCKED
var/edit_type = RECORD_GENERAL | RECORD_MEDICAL | RECORD_SECURITY | RECORD_VIRUS | RECORD_WARRANT | RECORD_LOCKED
var/datum/record/general/active
var/datum/record/virus/active_virus
var/listener/record/rconsole/listener
var/isEditing = FALSE
var/authenticated = 0
var/default_screen = "general"
var/record_prefix = ""
var/typechoices = list(
"physical_status" = list("Active", "*Deceased*", "*SSD*", "Physically Unfit", "Disabled"),
"mental_status" = list("Stable", "*Insane*", "*Unstable*", "*Watch*"),
"medical" = list(
"blood_type" = list("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+")
)
)
/datum/computer_file/program/records/medical
filename = "medrec"
filedesc = "Medical records"
extended_desc = "Used to view, edit and maintain medical records."
record_prefix = "Medical "
required_access_run = list(access_medical_equip, access_forensics_lockers, access_detective, access_hop)
required_access_download = access_heads
available_on_ntnet = 1
records_type = RECORD_MEDICAL | RECORD_VIRUS
edit_type = RECORD_MEDICAL
default_screen = "medical"
program_icon_state = "medical_record"
color = LIGHT_COLOR_CYAN
/datum/computer_file/program/records/security
filename = "secrec"
filedesc = "Security records"
extended_desc = "Used to view, edit and maintain security records"
record_prefix = "Security "
required_access_run = list(access_security, access_forensics_lockers, access_lawyer, access_hop)
required_access_download = access_heads
available_on_ntnet = 1
records_type = RECORD_SECURITY
edit_type = RECORD_SECURITY
default_screen = "security"
program_icon_state = "security_record"
color = LIGHT_COLOR_RED
/datum/computer_file/program/records/employment
filename = "emprec"
filedesc = "Employment records"
extended_desc = "Used to view, edit and maintain employment records."
record_prefix = "Employment "
required_access_run = list(access_security, access_forensics_lockers, access_lawyer, access_hop)
required_access_download = access_heads
available_on_ntnet = 1
records_type = RECORD_GENERAL | RECORD_SECURITY
edit_type = RECORD_GENERAL
program_icon_state = "employment_record"
color = LIGHT_COLOR_BLUE
/datum/computer_file/program/records/New()
. = ..()
listener = new(src)
/datum/computer_file/program/records/ui_interact(mob/user as mob)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
if (!ui)
ui = new /datum/vueui/modularcomputer(user, src, "records-main", 450, 520, filedesc)
if(!authenticated)
ui.activeui = "records-login"
ui.open()
/datum/computer_file/program/records/vueui_transfer(oldobj)
var/ui_name = "records-main"
if(!authenticated)
ui_name = "records-login"
SSvueui.transfer_uis(oldobj, src, ui_name, 450, 520, filedesc)
return TRUE
/datum/computer_file/program/records/vueui_data_change(list/data, mob/user, datum/vueui/ui)
if(!data)
. = data = list(
"activeview" = "list",
"defaultview" = default_screen,
"editingvalue" = "",
"choices" = typechoices
)
var/headerdata = get_header_data(data["_PC"])
if(headerdata)
data["_PC"] = headerdata
. = data
if(!authenticated)
VUEUI_SET_CHECK(ui.activeui, "records-login", ., data)
else
VUEUI_SET_CHECK(ui.activeui, "records-main", ., data)
VUEUI_SET_CHECK(data["canprint"], !!(computer?.nano_printer), ., data)
VUEUI_SET_CHECK(data["avaivabletypes"], records_type, ., data)
VUEUI_SET_CHECK(data["editable"], edit_type, ., data)
LAZYINITLIST(data["allrecords"])
LAZYINITLIST(data["allrecords_locked"])
LAZYINITLIST(data["record_viruses"])
if(authenticated)
if(data["allrecords"].len != SSrecords.records.len)
data["allrecords"].Cut()
for(var/tR in sortRecord(SSrecords.records))
var/datum/record/general/R = tR
LAZYINITLIST(data["allrecords"][R.id])
VUEUI_SET_CHECK(data["allrecords"][R.id]["id"], R.id, ., data)
VUEUI_SET_CHECK(data["allrecords"][R.id]["name"], R.name, ., data)
VUEUI_SET_CHECK(data["allrecords"][R.id]["rank"], R.rank, ., data)
VUEUI_SET_CHECK(data["allrecords"][R.id]["sex"], R.sex, ., data)
VUEUI_SET_CHECK(data["allrecords"][R.id]["age"], R.age, ., data)
VUEUI_SET_CHECK(data["allrecords"][R.id]["fingerprint"], R.fingerprint, ., data)
if(R.medical)
VUEUI_SET_CHECK(data["allrecords"][R.id]["blood"], R.medical.blood_type, ., data)
VUEUI_SET_CHECK(data["allrecords"][R.id]["dna"], R.medical.blood_dna, ., data)
if(records_type & RECORD_LOCKED)
if(data["allrecords_locked"].len != SSrecords.records_locked.len)
data["allrecords_locked"].Cut()
for(var/tR in sortRecord(SSrecords.records_locked))
var/datum/record/general/R = tR
LAZYINITLIST(data["allrecords_locked"][R.id])
VUEUI_SET_CHECK(data["allrecords_locked"][R.id]["id"], R.id, ., data)
VUEUI_SET_CHECK(data["allrecords_locked"][R.id]["name"], R.name, ., data)
VUEUI_SET_CHECK(data["allrecords_locked"][R.id]["rank"], R.rank, ., data)
if(records_type & RECORD_VIRUS)
if(data["record_viruses"].len != SSrecords.viruses.len)
data["record_viruses"].Cut()
for(var/tR in sortRecord(SSrecords.viruses))
var/datum/record/virus/R = tR
LAZYINITLIST(data["record_viruses"]["[R.id]"])
VUEUI_SET_CHECK(data["record_viruses"]["[R.id]"]["id"], R.id, ., data)
VUEUI_SET_CHECK(data["record_viruses"]["[R.id]"]["name"], R.name, ., data)
if(active_virus)
var/returned = active_virus.Listify(1, list(), data["active_virus"])
if(returned)
data["active_virus"] = returned
. = data
else
if(data["activeview"] == "virus")
VUEUI_SET_CHECK(data["activeview"], "list", ., data)
VUEUI_SET_CHECK(data["active_virus"], 0, ., data)
if(active)
if(!ui.assets["front"] || !ui.assets["side"])
ui.add_asset("front", active.photo_front)
ui.add_asset("side", active.photo_side)
var/excluded = list()
if(!(records_type & RECORD_GENERAL))
excluded += active.advanced_fields
if(!(records_type & RECORD_SECURITY))
excluded += "security"
if(!(records_type & RECORD_MEDICAL))
excluded += "medical"
var/returned = active.Listify(1, excluded, data["active"])
if(returned)
data["active"] = returned
. = data
else
if(data["activeview"] in list("general", "medical", "security"))
VUEUI_SET_CHECK(data["activeview"], "list", ., data)
VUEUI_SET_CHECK(data["active"], 0, ., data)
else
VUEUI_SET_CHECK(data["active_virus"], 0, ., data)
VUEUI_SET_CHECK(data["active"], 0, ., data)
/datum/computer_file/program/records/Topic(href, href_list)
if(..())
return 1
var/datum/vueui/ui = href_list["vueui"]
if(!istype(ui))
return
if(href_list["login"])
if(can_run(usr, TRUE))
authenticated = TRUE
else
to_chat(usr, "[src] beeps: Access Denied")
SSvueui.check_uis_for_change(src)
if(href_list["logout"])
authenticated = 0
active = null
active_virus = null
ui.remove_asset("front")
ui.remove_asset("side")
ui.data = null
SSvueui.check_uis_for_change(src)
if(!authenticated)
return
if(href_list["setactive"])
active = SSrecords.find_record("id", href_list["setactive"])
if(active)
ui.add_asset("front", active.photo_front)
ui.add_asset("side", active.photo_side)
ui.send_asset("front")
ui.send_asset("side")
else
ui.remove_asset("front")
ui.remove_asset("side")
SSvueui.check_uis_for_change(src)
if(href_list["setactive_locked"] && (records_type & RECORD_LOCKED))
active = SSrecords.find_record("id", href_list["setactive_locked"], RECORD_GENERAL | RECORD_LOCKED)
SSvueui.check_uis_for_change(src)
if(href_list["setactive_virus"] && (records_type & RECORD_VIRUS))
active_virus = SSrecords.find_record("id", text2num(href_list["setactive_virus"]), RECORD_VIRUS)
SSvueui.check_uis_for_change(src)
if(href_list["editrecord"])
var/list/key = href_list["editrecord"]["key"]
var/value = sanitize(href_list["editrecord"]["value"], encode = 0, extra = 0)
if(key.len >= 2 && canEdit(key))
if(isnum(obj_query_get(null, src, null, key)))
value = text2num(value)
isEditing = TRUE
obj_query_set(null, src, value, null, key)
obj_query_set(null, ui.data, value, null, key)
SSrecords.onModify(vars[key[1]])
isEditing = FALSE
. = TRUE
if(href_list["deleterecord"])
if(canEdit(list("active", "name")))
var/confirm = alert("Are you sure you want to delete this record?", "Confirm Deletion", "No", "Yes")
if(confirm == "Yes")
isEditing = TRUE
SSrecords.remove_record(active)
ui.data["allrecords"] -= active.id
active = null
ui.data["activeview"] = default_screen
isEditing = FALSE
SSvueui.check_uis_for_change(src)
if(href_list["newrecord"])
if(edit_type & RECORD_GENERAL)
active = new /datum/record/general()
SSrecords.add_record(active)
ui.add_asset("front", active.photo_front)
ui.add_asset("side", active.photo_side)
ui.send_asset("front")
ui.send_asset("side")
SSvueui.check_uis_for_change(src)
if(href_list["addtorecord"])
var/list/key = href_list["addtorecord"]["key"]
var/value = sanitize(href_list["addtorecord"]["value"], encode = 0, extra = 0)
if(key.len >= 2 && canEdit(key))
isEditing = TRUE
obj_query_set(null, src, obj_query_get(null, src, null, key) + value, null, key)
obj_query_set(null, ui.data, obj_query_get(null, ui.data, null, key) + value, null, key)
SSrecords.onModify(vars[key[1]])
isEditing = FALSE
. = TRUE
if(href_list["removefromrecord"])
var/list/key = href_list["removefromrecord"]["key"]
var/value = sanitize(href_list["removefromrecord"]["value"], encode = 0, extra = 0)
if(key.len >= 2 && canEdit(key))
isEditing = TRUE
obj_query_set(null, src, obj_query_get(null, src, null, key) - value, null, key)
obj_query_set(null, ui.data, obj_query_get(null, ui.data, null, key) - value, null, key)
SSrecords.onModify(vars[key[1]])
isEditing = FALSE
. = TRUE
if(href_list["print"])
if(!(href_list["print"] in list("active", "active_virus")))
return
if(computer?.nano_printer && vars[href_list["print"]])
var/excluded = list()
if(href_list["print"] == "active")
if(!(records_type & RECORD_GENERAL))
excluded += active.advanced_fields
if(!(records_type & RECORD_SECURITY))
excluded += "security"
if(!(records_type & RECORD_MEDICAL))
excluded += "medical"
var/out = vars[href_list["print"]].Printify(excluded)
computer.nano_printer.print_text(out, "[record_prefix]Record ([vars[href_list["print"]].name])")
/datum/computer_file/program/records/proc/canEdit(list/key)
if(!(key[1] in list("active", "active_virus")))
return FALSE
if(vars[key[1]] == null)
return FALSE
if(key[1] == "active_virus" && !(edit_type & RECORD_VIRUS))
return FALSE
if(key[1] == "active")
switch(key[2])
if("security")
if(!(edit_type & RECORD_SECURITY))
return FALSE
if("medical")
if(!(edit_type & RECORD_MEDICAL))
return FALSE
else
if(key.len == 2 && !(edit_type & RECORD_GENERAL))
return FALSE
return TRUE
/*
* Listener for record changes
*/
/listener/record/rconsole/on_delete(var/datum/record/r)
. = FALSE
var/datum/computer_file/program/records/t = target
if(istype(t) && !t.isEditing)
if(t.active == r)
t.active = null
. = TRUE
if(t.active_virus == r)
t.active_virus = null
. = TRUE
if(.)
SSvueui.check_uis_for_change(t)
/listener/record/rconsole/on_modify(var/datum/record/r)
var/datum/computer_file/program/records/t = target
if(istype(t) && !t.isEditing)
if(t.active == r || t.active_virus == r)
SSvueui.check_uis_for_change(t)
@@ -25,6 +25,7 @@
if(damage > damage_malfunction)
text_to_print = stars(text_to_print, 100-malfunction_probability)
var/obj/item/paper/P = new /obj/item/paper(get_turf(holder2),text_to_print, paper_title)
P.info = text_to_print
if (paper_color)
P.color = paper_color