From b30e69da89f6013eb512612ec5854cd5259f6024 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 02:32:06 -0500 Subject: [PATCH 01/47] idk --- code/__DEFINES/datacore.dm | 42 +++ code/__DEFINES/subsystems.dm | 1 + code/controllers/subsystem/datacore.dm | 376 +++++++++++++++++++++++++ code/datums/datacore.dm | 28 -- code/modules/datacore/crime.dm | 9 + code/modules/datacore/library.dm | 21 ++ code/modules/datacore/records.dm | 131 +++++++++ shiptest.dme | 5 + 8 files changed, 585 insertions(+), 28 deletions(-) create mode 100644 code/__DEFINES/datacore.dm create mode 100644 code/controllers/subsystem/datacore.dm create mode 100644 code/modules/datacore/crime.dm create mode 100644 code/modules/datacore/library.dm create mode 100644 code/modules/datacore/records.dm diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm new file mode 100644 index 000000000000..87d4eaaf5a42 --- /dev/null +++ b/code/__DEFINES/datacore.dm @@ -0,0 +1,42 @@ +#define DATACORE_ID "id" +#define DATACORE_NAME "name" +#define DATACORE_AGE "age" +#define DATACORE_GENDER "gender" +#define DATACORE_SPECIES "species" +#define DATACORE_FINGERPRINT "fingerprint" +#define DATACORE_APPEARANCE "character_appearance" +#define DATACORE_MINDREF "mind" +#define DATACORE_DNA_IDENTITY "identity" +#define DATACORE_DNA_FEATURES "features" + +#define DATACORE_PHYSICAL_HEALTH "p_stat" +#define DATACORE_MENTAL_HEALTH "m_stat" +#define DATACORE_BLOOD_TYPE "blood_type" +#define DATACORE_BLOOD_DNA "b_dna" +#define DATACORE_DISEASES "cdi" +#define DATACORE_DISEASES_DETAILS "cdi_d" +#define DATACORE_DISABILITIES "ma_dis" +#define DATACORE_DISABILITIES_DETAILS "ma_dis_d" + +#define DATACORE_NOTES "notes" +#define DATACORE_NOTES_DETAILS "notes_d" + +#define DATACORE_RANK "rank" +#define DATACORE_INITIAL_RANK "initial_rank" +#define DATACORE_TRIM "trim" +#define DATACORE_PDA_ID "pda_id" + +#define DATACORE_CRIMES "crim" +#define DATACORE_CRIMINAL_STATUS "criminal" +#define DATACORE_CITATIONS "citation" + +/// Keys for SSdatacore.library +#define DATACORE_RECORDS_STATION "general" +#define DATACORE_RECORDS_SECURITY "security" +#define DATACORE_RECORDS_MEDICAL "medical" +#define DATACORE_RECORDS_LOCKED "locked" + +#define DATACORE_RECORDS_AETHER "aether" +#define DATACORE_RECORDS_DAEDALUS "daedalus" +#define DATACORE_RECORDS_HERMES "hermes" +#define DATACORE_RECORDS_MARS "mars" diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 629755487849..800fc4f92598 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -120,6 +120,7 @@ #define INIT_ORDER_EVENTS 70 #define INIT_ORDER_JOBS 65 #define INIT_ORDER_QUIRKS 60 +#define INIT_ORDER_DATACORE 57 // Must come before SSticker so datacore reading things can access it #define INIT_ORDER_TICKER 55 #define INIT_ORDER_MAPPING 50 #define INIT_ORDER_TIMETRACK 47 diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm new file mode 100644 index 000000000000..e13100a08a13 --- /dev/null +++ b/code/controllers/subsystem/datacore.dm @@ -0,0 +1,376 @@ + +///Dummy mob reserve slot for manifest +#define DUMMY_HUMAN_SLOT_MANIFEST "dummy_manifest_generation" + +SUBSYSTEM_DEF(datacore) + name = "Data Core" + flags = SS_NO_FIRE + init_order = INIT_ORDER_DATACORE + + /// A list of data libraries keyed by DATACORE_RECORDS_* + var/list/datum/data_library/library = list( + DATACORE_RECORDS_STATION, + DATACORE_RECORDS_SECURITY, + DATACORE_RECORDS_MEDICAL, + DATACORE_RECORDS_LOCKED, + DATACORE_RECORDS_DAEDALUS, + DATACORE_RECORDS_AETHER, + DATACORE_RECORDS_HERMES, + DATACORE_RECORDS_MARS + ) + + var/securityPrintCount = 0 + var/securityCrimeCounter = 0 + var/medicalPrintCount = 0 + + /// Set to TRUE when the initial roundstart manifest is complete + var/finished_setup = FALSE + + var/list/datum/callback/datacore_ready_callbacks = list() + +/datum/controller/subsystem/datacore/Initialize(start_timeofday) + for(var/id in library) + library[id] = new /datum/data_library + return ..() + +/datum/controller/subsystem/datacore/Recover() + library = SSdatacore.library + securityCrimeCounter = SSdatacore.securityCrimeCounter + medicalPrintCount = SSdatacore.medicalPrintCount + finished_setup = SSdatacore.finished_setup + +/// Returns a data record or null. +/datum/controller/subsystem/datacore/proc/get_record_by_name(name, record_type = DATACORE_RECORDS_STATION) + RETURN_TYPE(/datum/data/record) + + return library[record_type].get_record_by_name(name) + +/// Returns a data library's records list +/datum/controller/subsystem/datacore/proc/get_records(record_type = DATACORE_RECORDS_STATION) + RETURN_TYPE(/list) + return library[record_type].records + +/datum/controller/subsystem/datacore/proc/find_record(field, needle, haystack) + RETURN_TYPE(/datum/data/record) + for(var/datum/data/record/record_to_check in get_records(haystack)) + if(record_to_check.fields[field] == needle) + return record_to_check + +/// Empties out a library +/datum/controller/subsystem/datacore/proc/wipe_records(record_type) + var/datum/data_library/to_wipe = library[record_type] + if(!to_wipe) + return + + QDEL_LIST(to_wipe.records) + +/// Grab all PDA network IDs by department. +/datum/controller/subsystem/datacore/proc/get_pda_netids(record_type = DATACORE_RECORDS_STATION) + RETURN_TYPE(/list) + . = list() + + for(var/datum/data/record/R as anything in get_records(record_type)) + var/id = R.fields[DATACORE_PDA_ID] + if(id) + . += id + +/// Removes a person from history. Except locked. That's permanent history. +/datum/controller/subsystem/datacore/proc/demanifest(name) + for(var/id in library - DATACORE_RECORDS_LOCKED) + var/datum/data/record/R = get_record_by_name(name, id) + qdel(R) + +/datum/controller/subsystem/datacore/proc/inject_record(datum/data/record/R, record_type) + if(isnull(record_type)) + CRASH("inject_record() called with no record type") + + library[record_type].inject_record(R) + +/// Create the roundstart manifest using the newplayer list. +/datum/controller/subsystem/datacore/proc/generate_manifest() + for(var/mob/dead/new_player/N as anything in GLOB.new_player_list) + if(N.new_character) + log_manifest(N.ckey, N.new_character.mind, N.new_character) + + if(ishuman(N.new_character)) + manifest_inject(N.new_character, N.client) + + CHECK_TICK + + finished_setup = TRUE + //SEND_GLOBAL_SIGNAL(COMSIG_GLOB_DATACORE_READY, src) + invoke_datacore_callbacks() + +/// Add a callback to execute when the datacore has loaded +/datum/controller/subsystem/datacore/proc/OnReady(datum/callback/CB) + if(finished_setup) + CB.InvokeAsync() + else + datacore_ready_callbacks += CB + +/datum/controller/subsystem/datacore/proc/invoke_datacore_callbacks() + for(var/datum/callback/CB as anything in datacore_ready_callbacks) + CB.InvokeAsync() + + datacore_ready_callbacks.Cut() + +/datum/controller/subsystem/datacore/proc/manifest_modify(name, assignment, trim) + var/datum/data/record/foundrecord = library[DATACORE_RECORDS_STATION].get_record_by_name(name) + if(foundrecord) + foundrecord.fields[DATACORE_RANK] = assignment + foundrecord.fields[DATACORE_TRIM] = trim + +/datum/controller/subsystem/datacore/proc/get_manifest(record_type = DATACORE_RECORDS_STATION) + // First we build up the order in which we want the departments to appear in. + var/list/manifest_out = list() + for(var/datum/job_department/department as anything in SSjob.departments) + if(department.exclude_from_latejoin) + continue + manifest_out[department.department_name] = list() + + manifest_out[DEPARTMENT_UNASSIGNED] = list() + + var/list/departments_by_type = SSjob.departments_by_type + + for(var/datum/data/record/record as anything in SSdatacore.get_records(record_type)) + var/name = record.fields[DATACORE_NAME] + var/rank = record.fields[DATACORE_RANK] // user-visible job + var/trim = record.fields[DATACORE_TRIM] // internal jobs by trim type + var/datum/job/job = SSjob.GetJob(trim) + + // Filter out jobs that aren't on the manifest, move them to "unassigned" + if(!job || !(job.job_flags & JOB_CREW_MANIFEST) || !LAZYLEN(job.departments_list)) + var/list/misc_list = manifest_out[DEPARTMENT_UNASSIGNED] + misc_list[++misc_list.len] = list( + "name" = name, + "rank" = rank, + "trim" = trim, + ) + continue + + for(var/department_type as anything in job.departments_list) + var/datum/job_department/department = departments_by_type[department_type] + + if(!department) + stack_trace("get_manifest() failed to get job department for [department_type] of [job.type]") + continue + + if(department.is_not_real_department) + continue + + var/list/entry = list( + "name" = name, + "rank" = rank, + "trim" = trim, + ) + + var/list/department_list = manifest_out[department.department_name] + if(istype(job, department.department_head)) + department_list.Insert(1, null) + department_list[1] = entry + else + department_list[++department_list.len] = entry + + // Trim the empty categories. + for (var/department in manifest_out) + if(!length(manifest_out[department])) + manifest_out -= department + + return manifest_out + +/datum/controller/subsystem/datacore/proc/get_manifest_html(record_key = DATACORE_RECORDS_STATION, monochrome = FALSE) + var/list/manifest = get_manifest(record_key) + var/dat = {" + + + + "} + for(var/department in manifest) + var/list/entries = manifest[department] + dat += "" + //JUST + var/even = FALSE + for(var/entry in entries) + var/list/entry_list = entry + dat += "" + even = !even + + dat += "
NameRank
[department]
[entry_list["name"]][entry_list["rank"] == entry_list["trim"] ? entry_list["rank"] : "[entry_list["rank"]] ([entry_list["trim"]])"]
" + dat = replacetext(dat, "\n", "") + dat = replacetext(dat, "\t", "") + return dat + +/datum/controller/subsystem/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) + SHOULD_NOT_SLEEP(TRUE) + var/static/list/show_directions = list(SOUTH, WEST) + if(!(H.mind?.assigned_role.job_flags & JOB_CREW_MANIFEST)) + return + + var/datum/job/job = H.mind.assigned_role + var/assignment = H.mind.assigned_role.title + + //PARIAH EDIT ADDITION + // The alt job title, if user picked one, or the default + var/chosen_assignment = C?.prefs.alt_job_titles[assignment] || assignment + //PARIAH EDIT END + + var/static/record_id_num = 1001 + var/id = num2hex(record_id_num++,6) + if(!C) + C = H.client + + var/mutable_appearance/character_appearance = new(H.appearance) + remove_non_canon_overlays(character_appearance) + + //General Record + var/datum/data/record/general/G = new() + G.fields[DATACORE_ID] = id + + G.fields[DATACORE_NAME] = H.real_name + G.fields[DATACORE_RANK] = chosen_assignment //PARIAH EDIT + G.fields[DATACORE_TRIM] = assignment + G.fields[DATACORE_INITIAL_RANK] = assignment + G.fields[DATACORE_AGE] = H.age + G.fields[DATACORE_SPECIES] = H.dna.species.name + G.fields[DATACORE_FINGERPRINT] = H.get_fingerprints(TRUE) + G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" + G.fields[DATACORE_MENTAL_HEALTH] = "Stable" + G.fields[DATACORE_GENDER] = H.gender + if(H.gender == "male") + G.fields[DATACORE_GENDER] = "Male" + else if(H.gender == "female") + G.fields[DATACORE_GENDER] = "Female" + else + G.fields[DATACORE_GENDER] = "Other" + G.fields[DATACORE_APPEARANCE] = character_appearance + var/obj/item/modular_computer/tablet/pda/pda = locate() in H + if(pda) + var/obj/item/computer_hardware/network_card/packetnet/rfcard = pda.all_components[MC_NET] + if(istype(rfcard)) + G.fields[DATACORE_PDA_ID] = rfcard.hardware_id + + library[DATACORE_RECORDS_STATION].inject_record(G) + + // Add to company-specific manifests + var/datum/job_department/department = SSjob.departments_by_type[job.departments_list?[1]] + if(department?.manifest_key) + library[department.manifest_key].inject_record(G) + + //Medical Record + var/datum/data/record/medical/M = new() + M.fields[DATACORE_ID] = id + M.fields[DATACORE_NAME] = H.real_name + M.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type.name + M.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes + M.fields[DATACORE_DISABILITIES] = H.get_quirk_string(FALSE, CAT_QUIRK_DISABILITIES) + M.fields[DATACORE_DISABILITIES_DETAILS] = H.get_quirk_string(TRUE, CAT_QUIRK_DISABILITIES) + M.fields[DATACORE_DISEASES] = "None" + M.fields[DATACORE_DISEASES_DETAILS] = "No diseases have been diagnosed at the moment." + M.fields[DATACORE_NOTES] = H.get_quirk_string(FALSE, CAT_QUIRK_NOTES) + M.fields[DATACORE_NOTES_DETAILS] = H.get_quirk_string(TRUE, CAT_QUIRK_NOTES) + library[DATACORE_RECORDS_MEDICAL].inject_record(M) + + //Security Record + var/datum/data/record/security/S = new() + S.fields[DATACORE_ID] = id + S.fields[DATACORE_NAME] = H.real_name + S.fields[DATACORE_CRIMINAL_STATUS] = CRIMINAL_NONE + S.fields[DATACORE_CITATIONS] = list() + S.fields[DATACORE_CRIMES] = list() + S.fields[DATACORE_NOTES] = "No notes." + library[DATACORE_RECORDS_SECURITY].inject_record(S) + + //Locked Record + var/datum/data/record/locked/L = new() + L.fields[DATACORE_ID] = id + L.fields[DATACORE_NAME] = H.real_name + // L.fields[DATACORE_RANK] = assignment //ORIGINAL + L.fields[DATACORE_RANK] = chosen_assignment //PARIAH EDIT + L.fields[DATACORE_TRIM] = assignment + G.fields[DATACORE_INITIAL_RANK] = assignment + L.fields[DATACORE_AGE] = H.age + L.fields[DATACORE_GENDER] = H.gender + if(H.gender == "male") + G.fields[DATACORE_GENDER] = "Male" + else if(H.gender == "female") + G.fields[DATACORE_GENDER] = "Female" + else + G.fields[DATACORE_GENDER] = "Other" + L.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type + L.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes + L.fields[DATACORE_DNA_IDENTITY] = H.dna.unique_identity + L.fields[DATACORE_SPECIES] = H.dna.species.type + L.fields[DATACORE_DNA_FEATURES] = H.dna.features + L.fields[DATACORE_APPEARANCE] = character_appearance + L.fields[DATACORE_MINDREF] = H.mind + library[DATACORE_RECORDS_LOCKED].inject_record(L) + + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MANIFEST_INJECT, G, M, S, L) + return + +/** + * Supporing proc for getting general records + * and using them as pAI ui data. This gets + * medical information - or what I would deem + * medical information - and sends it as a list. + * + * @return - list(general_records_out) + */ +/datum/controller/subsystem/datacore/proc/get_general_records() + if(!get_records(DATACORE_RECORDS_STATION)) + return list() + + /// The array of records + var/list/general_records_out = list() + for(var/datum/data/record/gen_record as anything in get_records(DATACORE_RECORDS_STATION)) + /// The object containing the crew info + var/list/crew_record = list() + crew_record["ref"] = REF(gen_record) + crew_record["name"] = gen_record.fields[DATACORE_NAME] + crew_record["physical_health"] = gen_record.fields[DATACORE_PHYSICAL_HEALTH] + crew_record["mental_health"] = gen_record.fields[DATACORE_MENTAL_HEALTH] + general_records_out += list(crew_record) + return general_records_out + +/** + * Supporing proc for getting secrurity records + * and using them as pAI ui data. Sends it as a + * list. + * + * @return - list(security_records_out) + */ +/datum/controller/subsystem/datacore/proc/get_security_records() + if(!get_records(DATACORE_RECORDS_SECURITY)) + return list() + + /// The array of records + var/list/security_records_out = list() + for(var/datum/data/record/sec_record as anything in get_records(DATACORE_RECORDS_SECURITY)) + /// The object containing the crew info + var/list/crew_record = list() + crew_record["ref"] = REF(sec_record) + crew_record["name"] = sec_record.fields[DATACORE_NAME] + crew_record["status"] = sec_record.fields[DATACORE_CRIMINAL_STATUS] // wanted status + crew_record["crimes"] = length(sec_record.fields[DATACORE_CRIMES]) + security_records_out += list(crew_record) + return security_records_out + +/// Creates a new crime entry and hands it back. +/datum/controller/subsystem/datacore/proc/new_crime_entry(cname = "", cdetails = "", author = "", time = "", fine = 0) + var/datum/data/crime/c = new /datum/data/crime + c.crimeName = cname + c.crimeDetails = cdetails + c.author = author + c.time = time + c.fine = fine + c.paid = 0 + c.dataId = ++securityCrimeCounter + return c + +#undef DUMMY_HUMAN_SLOT_MANIFEST diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 0103be96ce03..dd198e429eb6 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -9,34 +9,6 @@ ///This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). var/list/locked = list() -/datum/data - var/name = "data" - -/datum/data/record - name = "record" - var/list/fields = list() - -/datum/data/record/Destroy() - if(src in GLOB.data_core.medical) - GLOB.data_core.medical -= src - if(src in GLOB.data_core.security) - GLOB.data_core.security -= src - if(src in GLOB.data_core.general) - GLOB.data_core.general -= src - if(src in GLOB.data_core.locked) - GLOB.data_core.locked -= src - . = ..() - -/datum/data/crime - name = "crime" - var/crimeName = "" - var/crimeDetails = "" - var/author = "" - var/time = "" - var/fine = 0 - var/paid = 0 - var/dataId = 0 - /datum/datacore/proc/createCrimeEntry(cname = "", cdetails = "", author = "", time = "", fine = 0) var/datum/data/crime/c = new /datum/data/crime c.crimeName = cname diff --git a/code/modules/datacore/crime.dm b/code/modules/datacore/crime.dm new file mode 100644 index 000000000000..1028ba9818e7 --- /dev/null +++ b/code/modules/datacore/crime.dm @@ -0,0 +1,9 @@ +/datum/data/crime + name = "crime" + var/crimeName = "" + var/crimeDetails = "" + var/author = "" + var/time = "" + var/fine = 0 + var/paid = 0 + var/dataId = 0 diff --git a/code/modules/datacore/library.dm b/code/modules/datacore/library.dm new file mode 100644 index 000000000000..f375b99d9844 --- /dev/null +++ b/code/modules/datacore/library.dm @@ -0,0 +1,21 @@ +/datum/data_library + var/list/datum/data/record/records = list() + var/list/datum/data/record/records_by_name = list() + +/// Returns a data record or null. +/datum/data_library/proc/get_record_by_name(name) + RETURN_TYPE(/datum/data/record) + + return records_by_name[name] + +/// Inject a record into this library. +/datum/data_library/proc/inject_record(datum/data/record/new_record) + if(!istype(new_record)) + CRASH("You fucked it this time!!!") + + if(!new_record.fields["name"]) + CRASH("Cannot inject a record with no name!") + + records += new_record + records_by_name[new_record.fields["name"]] = new_record + new_record.library = src diff --git a/code/modules/datacore/records.dm b/code/modules/datacore/records.dm new file mode 100644 index 000000000000..7a761c319ead --- /dev/null +++ b/code/modules/datacore/records.dm @@ -0,0 +1,131 @@ +/datum/data + var/name = "data" + +/datum/data/record + name = "record" + /// A ref to the library we're contained in. + var/datum/data_library/library + /// The data + var/list/fields = list() + +/datum/data/record/Destroy(force, ...) + if(library) + library.records -= src + library.records_by_name -= fields["name"] + return ..() + +/// Creates a copy of the record, without it's library. +/datum/data/record/proc/Copy() + var/datum/data/record/new_record = new type() + new_record.fields = fields.Copy() + return new_record + +/// A helper proc to get the front photo of a character from the record. +/// Handles calling `get_photo()`, read its documentation for more information. +/datum/data/record/proc/get_front_photo() + return get_photo("photo_front", SOUTH) + +/// A helper proc to get the side photo of a character from the record. +/// Handles calling `get_photo()`, read its documentation for more information. +/datum/data/record/proc/get_side_photo() + return get_photo("photo_side", WEST) + +/** + * You shouldn't be calling this directly, use `get_front_photo()` or `get_side_photo()` + * instead. + * + * This is the proc that handles either fetching (if it was already generated before) or + * generating (if it wasn't) the specified photo from the specified record. This is only + * intended to be used by records that used to try to access `fields["photo_front"]` or + * `fields["photo_side"]`, and will return an empty icon if there isn't any of the necessary + * fields. + * + * Arguments: + * * field_name - The name of the key in the `fields` list, of the record itself. + * * orientation - The direction in which you want the character appearance to be rotated + * in the outputed photo. + * + * Returns an empty `/icon` if there was no `character_appearance` entry in the `fields` list, + * returns the generated/cached photo otherwise. + */ +/datum/data/record/proc/get_photo(field_name, orientation) + if(fields[field_name]) + return fields[field_name] + + if(!fields[DATACORE_APPEARANCE]) + return new /icon() + + var/mutable_appearance/character_appearance = fields[DATACORE_APPEARANCE] + character_appearance.setDir(orientation) + + var/icon/picture_image = getFlatIcon(character_appearance) + + var/datum/picture/picture = new + picture.picture_name = "[fields[DATACORE_NAME]]" + picture.picture_desc = "This is [fields[DATACORE_NAME]]." + picture.picture_image = picture_image + + var/obj/item/photo/photo = new(null, picture) + fields[field_name] = photo + return photo + +/datum/data/record/general + +/datum/data/record/medical + +/datum/data/record/locked + +/datum/data/record/security + +/// Set the criminal status of a crew member in the security records. +/datum/data/record/security/proc/set_criminal_status(new_status) + var/old_status = DATACORE_CRIMINAL_STATUS + if(old_status == new_status) + return FALSE + + fields[DATACORE_CRIMINAL_STATUS] = new_status + return TRUE + +/datum/data/record/security/proc/add_citation(datum/data/crime/crime) + fields[DATACORE_CITATIONS] |= crime + +/datum/data/record/security/proc/remove_citation(cDataId) + if(istext(cDataId)) + cDataId = text2num(cDataId) + + for(var/datum/data/crime/crime in fields[DATACORE_CITATIONS]) + if(crime.dataId == cDataId) + fields[DATACORE_CITATIONS] -= crime + return + +/datum/data/record/security/proc/pay_citation(cDataId, amount) + if(istext(cDataId)) + cDataId = text2num(cDataId) + + for(var/datum/data/crime/crime in fields[DATACORE_CITATIONS]) + if(crime.dataId == cDataId) + crime.paid = crime.paid + amount + var/datum/bank_account/D = SSeconomy.department_accounts_by_id[ACCOUNT_SEC] + D.adjust_money(amount) + return + +/datum/data/record/security/proc/add_crime(datum/data/crime/crime) + fields[DATACORE_CRIMES] |= crime + +/datum/data/record/security/proc/remove_crime(cDataId) + if(istext(cDataId)) + cDataId = text2num(cDataId) + + for(var/datum/data/crime/crime in fields[DATACORE_CRIMES]) + if(crime.dataId == cDataId) + fields[DATACORE_CRIMES] -= crime + return + +/datum/data/record/security/proc/add_crime_details(cDataId, details) + if(istext(cDataId)) + cDataId = text2num(cDataId) + + for(var/datum/data/crime/crime in fields[DATACORE_CRIMES]) + if(crime.dataId == cDataId) + crime.crimeDetails = details + return diff --git a/shiptest.dme b/shiptest.dme index 113d1da2b1ff..82e0b02d4052 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -49,6 +49,7 @@ #include "code\__DEFINES\contracts.dm" #include "code\__DEFINES\cooldowns.dm" #include "code\__DEFINES\cult.dm" +#include "code\__DEFINES\datacore.dm" #include "code\__DEFINES\directional.dm" #include "code\__DEFINES\diseases.dm" #include "code\__DEFINES\DNA.dm" @@ -310,6 +311,7 @@ #include "code\controllers\subsystem\callback.dm" #include "code\controllers\subsystem\chat.dm" #include "code\controllers\subsystem\communications.dm" +#include "code\controllers\subsystem\datacore.dm" #include "code\controllers\subsystem\dbcore.dm" #include "code\controllers\subsystem\dcs.dm" #include "code\controllers\subsystem\discord.dm" @@ -2046,6 +2048,9 @@ #include "code\modules\clothing\under\jobs\Plasmaman\engineering.dm" #include "code\modules\clothing\under\jobs\Plasmaman\medsci.dm" #include "code\modules\clothing\under\jobs\Plasmaman\security.dm" +#include "code\modules\datacore\crime.dm" +#include "code\modules\datacore\library.dm" +#include "code\modules\datacore\records.dm" #include "code\modules\detectivework\detective_work.dm" #include "code\modules\detectivework\evidence.dm" #include "code\modules\detectivework\footprints_and_rag.dm" From bd219588d279105db6195db1520e8563a2d65a0c Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 03:18:52 -0500 Subject: [PATCH 02/47] subsystem! --- code/__DEFINES/datacore.dm | 21 +-- code/__DEFINES/dcs/signals.dm | 5 + code/controllers/subsystem/datacore.dm | 179 +++++++++++-------------- code/modules/datacore/records.dm | 27 +--- 4 files changed, 102 insertions(+), 130 deletions(-) diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm index 87d4eaaf5a42..e73fa2c625cf 100644 --- a/code/__DEFINES/datacore.dm +++ b/code/__DEFINES/datacore.dm @@ -4,7 +4,9 @@ #define DATACORE_GENDER "gender" #define DATACORE_SPECIES "species" #define DATACORE_FINGERPRINT "fingerprint" -#define DATACORE_APPEARANCE "character_appearance" +//#define DATACORE_APPEARANCE "character_appearance" +#define DATACORE_PHOTO "photo_front" +#define DATACORE_PHOTO_SIDE "photo_side" #define DATACORE_MINDREF "mind" #define DATACORE_DNA_IDENTITY "identity" #define DATACORE_DNA_FEATURES "features" @@ -19,16 +21,15 @@ #define DATACORE_DISABILITIES_DETAILS "ma_dis_d" #define DATACORE_NOTES "notes" -#define DATACORE_NOTES_DETAILS "notes_d" +//#define DATACORE_NOTES_DETAILS "notes_d" #define DATACORE_RANK "rank" #define DATACORE_INITIAL_RANK "initial_rank" -#define DATACORE_TRIM "trim" -#define DATACORE_PDA_ID "pda_id" +//#define DATACORE_PDA_ID "pda_id" #define DATACORE_CRIMES "crim" #define DATACORE_CRIMINAL_STATUS "criminal" -#define DATACORE_CITATIONS "citation" +//#define DATACORE_CITATIONS "citation" /// Keys for SSdatacore.library #define DATACORE_RECORDS_STATION "general" @@ -36,7 +37,9 @@ #define DATACORE_RECORDS_MEDICAL "medical" #define DATACORE_RECORDS_LOCKED "locked" -#define DATACORE_RECORDS_AETHER "aether" -#define DATACORE_RECORDS_DAEDALUS "daedalus" -#define DATACORE_RECORDS_HERMES "hermes" -#define DATACORE_RECORDS_MARS "mars" +//#define DATACORE_RECORDS_AETHER "aether" +//#define DATACORE_RECORDS_DAEDALUS "daedalus" +//#define DATACORE_RECORDS_HERMES "hermes" +//#define DATACORE_RECORDS_MARS "mars" + +#define DATACORE_IMAGE "image" diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index d9edeb83202c..e19ded48d009 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -773,3 +773,8 @@ ///called in /obj/item/gun/process_chamber (src) #define COMSIG_GUN_CHAMBER_PROCESSED "gun_chamber_processed" + +///Global signal sent when the Datacore's initial manifest is complete +#define COMSIG_GLOB_DATACORE_READY "datacore_ready" +///Global signal sent when the datacore is added to via manifest_inject() (datum/data/record/general, datum/data/record/medical, datum/data/record/security, datum/data/record/locked) +#define COMSIG_GLOB_MANIFEST_INJECT "manifest_inject" diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index e13100a08a13..02b11a3831b5 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -12,11 +12,7 @@ SUBSYSTEM_DEF(datacore) DATACORE_RECORDS_STATION, DATACORE_RECORDS_SECURITY, DATACORE_RECORDS_MEDICAL, - DATACORE_RECORDS_LOCKED, - DATACORE_RECORDS_DAEDALUS, - DATACORE_RECORDS_AETHER, - DATACORE_RECORDS_HERMES, - DATACORE_RECORDS_MARS + DATACORE_RECORDS_LOCKED ) var/securityPrintCount = 0 @@ -64,16 +60,6 @@ SUBSYSTEM_DEF(datacore) QDEL_LIST(to_wipe.records) -/// Grab all PDA network IDs by department. -/datum/controller/subsystem/datacore/proc/get_pda_netids(record_type = DATACORE_RECORDS_STATION) - RETURN_TYPE(/list) - . = list() - - for(var/datum/data/record/R as anything in get_records(record_type)) - var/id = R.fields[DATACORE_PDA_ID] - if(id) - . += id - /// Removes a person from history. Except locked. That's permanent history. /datum/controller/subsystem/datacore/proc/demanifest(name) for(var/id in library - DATACORE_RECORDS_LOCKED) @@ -98,7 +84,7 @@ SUBSYSTEM_DEF(datacore) CHECK_TICK finished_setup = TRUE - //SEND_GLOBAL_SIGNAL(COMSIG_GLOB_DATACORE_READY, src) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_DATACORE_READY, src) invoke_datacore_callbacks() /// Add a callback to execute when the datacore has loaded @@ -114,67 +100,51 @@ SUBSYSTEM_DEF(datacore) datacore_ready_callbacks.Cut() -/datum/controller/subsystem/datacore/proc/manifest_modify(name, assignment, trim) +/datum/controller/subsystem/datacore/proc/manifest_modify(name, assignment) var/datum/data/record/foundrecord = library[DATACORE_RECORDS_STATION].get_record_by_name(name) if(foundrecord) foundrecord.fields[DATACORE_RANK] = assignment - foundrecord.fields[DATACORE_TRIM] = trim /datum/controller/subsystem/datacore/proc/get_manifest(record_type = DATACORE_RECORDS_STATION) - // First we build up the order in which we want the departments to appear in. var/list/manifest_out = list() - for(var/datum/job_department/department as anything in SSjob.departments) - if(department.exclude_from_latejoin) - continue - manifest_out[department.department_name] = list() - - manifest_out[DEPARTMENT_UNASSIGNED] = list() - - var/list/departments_by_type = SSjob.departments_by_type - + var/list/departments = list( + "Command" = GLOB.command_positions, + "Security" = GLOB.security_positions, + "Engineering" = GLOB.engineering_positions, + "Medical" = GLOB.medical_positions, + "Science" = GLOB.science_positions, + "Supply" = GLOB.supply_positions, + "Service" = GLOB.service_positions, + "Silicon" = GLOB.nonhuman_positions + ) for(var/datum/data/record/record as anything in SSdatacore.get_records(record_type)) var/name = record.fields[DATACORE_NAME] var/rank = record.fields[DATACORE_RANK] // user-visible job - var/trim = record.fields[DATACORE_TRIM] // internal jobs by trim type - var/datum/job/job = SSjob.GetJob(trim) - - // Filter out jobs that aren't on the manifest, move them to "unassigned" - if(!job || !(job.job_flags & JOB_CREW_MANIFEST) || !LAZYLEN(job.departments_list)) - var/list/misc_list = manifest_out[DEPARTMENT_UNASSIGNED] - misc_list[++misc_list.len] = list( - "name" = name, - "rank" = rank, - "trim" = trim, - ) - continue - - for(var/department_type as anything in job.departments_list) - var/datum/job_department/department = departments_by_type[department_type] - - if(!department) - stack_trace("get_manifest() failed to get job department for [department_type] of [job.type]") - continue - - if(department.is_not_real_department) - continue - - var/list/entry = list( + var/has_department = FALSE + for(var/department in departments) + var/list/jobs = departments[department] + if((rank in jobs)) + if(!manifest_out[department]) + manifest_out[department] = list() + // Append to beginning of list if captain or department head + if (rank == "Captain" || (department != "Command" && (rank in GLOB.command_positions))) + manifest_out[department] = list(list( + "name" = name, + "rank" = rank + )) + manifest_out[department] + else + manifest_out[department] += list(list( + "name" = name, + "rank" = rank + )) + has_department = TRUE + if(!has_department) + if(!manifest_out["Misc"]) + manifest_out["Misc"] = list() + manifest_out["Misc"] += list(list( "name" = name, - "rank" = rank, - "trim" = trim, - ) - - var/list/department_list = manifest_out[department.department_name] - if(istype(job, department.department_head)) - department_list.Insert(1, null) - department_list[1] = entry - else - department_list[++department_list.len] = entry - - // Trim the empty categories. - for (var/department in manifest_out) - if(!length(manifest_out[department])) - manifest_out -= department + "rank" = rank + )) return manifest_out @@ -198,7 +168,7 @@ SUBSYSTEM_DEF(datacore) var/even = FALSE for(var/entry in entries) var/list/entry_list = entry - dat += "[entry_list["name"]][entry_list["rank"] == entry_list["trim"] ? entry_list["rank"] : "[entry_list["rank"]] ([entry_list["trim"]])"]" + dat += "[entry_list["name"]][entry_list["rank"]]" even = !even dat += "" @@ -209,36 +179,44 @@ SUBSYSTEM_DEF(datacore) /datum/controller/subsystem/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) SHOULD_NOT_SLEEP(TRUE) var/static/list/show_directions = list(SOUTH, WEST) - if(!(H.mind?.assigned_role.job_flags & JOB_CREW_MANIFEST)) + if(!(H.mind && (H.mind.assigned_role != H.mind.special_role))) return - var/datum/job/job = H.mind.assigned_role - var/assignment = H.mind.assigned_role.title - - //PARIAH EDIT ADDITION - // The alt job title, if user picked one, or the default - var/chosen_assignment = C?.prefs.alt_job_titles[assignment] || assignment - //PARIAH EDIT END + var/assignment + if(H.mind.assigned_role) + assignment = H.mind.assigned_role + else if(H.job) + assignment = H.job + else + assignment = "Unassigned" var/static/record_id_num = 1001 var/id = num2hex(record_id_num++,6) if(!C) C = H.client - var/mutable_appearance/character_appearance = new(H.appearance) - remove_non_canon_overlays(character_appearance) + var/image = get_id_photo(H, C, show_directions) + var/datum/picture/pf = new + var/datum/picture/ps = new + pf.picture_name = "[H]" + ps.picture_name = "[H]" + pf.picture_desc = "This is [H]." + ps.picture_desc = "This is [H]." + pf.picture_image = icon(image, dir = SOUTH) + ps.picture_image = icon(image, dir = WEST) + var/obj/item/photo/photo_front = new(null, pf) + var/obj/item/photo/photo_side = new(null, ps) //General Record var/datum/data/record/general/G = new() G.fields[DATACORE_ID] = id G.fields[DATACORE_NAME] = H.real_name - G.fields[DATACORE_RANK] = chosen_assignment //PARIAH EDIT - G.fields[DATACORE_TRIM] = assignment + G.fields[DATACORE_RANK] = assignment G.fields[DATACORE_INITIAL_RANK] = assignment G.fields[DATACORE_AGE] = H.age G.fields[DATACORE_SPECIES] = H.dna.species.name - G.fields[DATACORE_FINGERPRINT] = H.get_fingerprints(TRUE) + G.fields[DATACORE_FINGERPRINT] = md5(H.dna.uni_identity) G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" G.fields[DATACORE_MENTAL_HEALTH] = "Stable" G.fields[DATACORE_GENDER] = H.gender @@ -248,19 +226,18 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_GENDER] = "Female" else G.fields[DATACORE_GENDER] = "Other" - G.fields[DATACORE_APPEARANCE] = character_appearance - var/obj/item/modular_computer/tablet/pda/pda = locate() in H - if(pda) - var/obj/item/computer_hardware/network_card/packetnet/rfcard = pda.all_components[MC_NET] - if(istype(rfcard)) - G.fields[DATACORE_PDA_ID] = rfcard.hardware_id + //G.fields[DATACORE_APPEARANCE] = character_appearance + G.fields[DATACORE_PHOTO] = photo_front + G.fields[DATACORE_PHOTO_SIDE] = photo_side library[DATACORE_RECORDS_STATION].inject_record(G) +/* // Add to company-specific manifests var/datum/job_department/department = SSjob.departments_by_type[job.departments_list?[1]] if(department?.manifest_key) library[department.manifest_key].inject_record(G) +*/ //Medical Record var/datum/data/record/medical/M = new() @@ -268,20 +245,19 @@ SUBSYSTEM_DEF(datacore) M.fields[DATACORE_NAME] = H.real_name M.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type.name M.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes - M.fields[DATACORE_DISABILITIES] = H.get_quirk_string(FALSE, CAT_QUIRK_DISABILITIES) - M.fields[DATACORE_DISABILITIES_DETAILS] = H.get_quirk_string(TRUE, CAT_QUIRK_DISABILITIES) + M.fields[DATACORE_DISABILITIES] = "None" + M.fields[DATACORE_DISABILITIES_DETAILS] = "No minor disabilities have been declared." M.fields[DATACORE_DISEASES] = "None" M.fields[DATACORE_DISEASES_DETAILS] = "No diseases have been diagnosed at the moment." - M.fields[DATACORE_NOTES] = H.get_quirk_string(FALSE, CAT_QUIRK_NOTES) - M.fields[DATACORE_NOTES_DETAILS] = H.get_quirk_string(TRUE, CAT_QUIRK_NOTES) + M.fields[DATACORE_NOTES] = H.get_trait_string() library[DATACORE_RECORDS_MEDICAL].inject_record(M) //Security Record var/datum/data/record/security/S = new() S.fields[DATACORE_ID] = id S.fields[DATACORE_NAME] = H.real_name - S.fields[DATACORE_CRIMINAL_STATUS] = CRIMINAL_NONE - S.fields[DATACORE_CITATIONS] = list() + S.fields[DATACORE_CRIMINAL_STATUS] = "None" + //S.fields[DATACORE_CITATIONS] = list() S.fields[DATACORE_CRIMES] = list() S.fields[DATACORE_NOTES] = "No notes." library[DATACORE_RECORDS_SECURITY].inject_record(S) @@ -290,9 +266,7 @@ SUBSYSTEM_DEF(datacore) var/datum/data/record/locked/L = new() L.fields[DATACORE_ID] = id L.fields[DATACORE_NAME] = H.real_name - // L.fields[DATACORE_RANK] = assignment //ORIGINAL - L.fields[DATACORE_RANK] = chosen_assignment //PARIAH EDIT - L.fields[DATACORE_TRIM] = assignment + L.fields[DATACORE_RANK] = assignment G.fields[DATACORE_INITIAL_RANK] = assignment L.fields[DATACORE_AGE] = H.age L.fields[DATACORE_GENDER] = H.gender @@ -304,10 +278,11 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_GENDER] = "Other" L.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type L.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes - L.fields[DATACORE_DNA_IDENTITY] = H.dna.unique_identity + L.fields[DATACORE_DNA_IDENTITY] = H.dna.uni_identity L.fields[DATACORE_SPECIES] = H.dna.species.type L.fields[DATACORE_DNA_FEATURES] = H.dna.features - L.fields[DATACORE_APPEARANCE] = character_appearance + //L.fields[DATACORE_APPEARANCE] = character_appearance + L.fields[DATACORE_IMAGE] = image L.fields[DATACORE_MINDREF] = H.mind library[DATACORE_RECORDS_LOCKED].inject_record(L) @@ -373,4 +348,12 @@ SUBSYSTEM_DEF(datacore) c.dataId = ++securityCrimeCounter return c +/datum/controller/subsystem/datacore/proc/get_id_photo(mob/living/carbon/human/H, client/C, show_directions = list(SOUTH), datum/job/J) + var/datum/preferences/P + if(!C) + C = H.client + if(C) + P = C.prefs + return get_flat_human_icon(null, J, P, DUMMY_HUMAN_SLOT_MANIFEST, show_directions) + #undef DUMMY_HUMAN_SLOT_MANIFEST diff --git a/code/modules/datacore/records.dm b/code/modules/datacore/records.dm index 7a761c319ead..146f0bda40ce 100644 --- a/code/modules/datacore/records.dm +++ b/code/modules/datacore/records.dm @@ -20,6 +20,7 @@ new_record.fields = fields.Copy() return new_record +/* /// A helper proc to get the front photo of a character from the record. /// Handles calling `get_photo()`, read its documentation for more information. /datum/data/record/proc/get_front_photo() @@ -29,6 +30,7 @@ /// Handles calling `get_photo()`, read its documentation for more information. /datum/data/record/proc/get_side_photo() return get_photo("photo_side", WEST) +*/ /** * You shouldn't be calling this directly, use `get_front_photo()` or `get_side_photo()` @@ -48,6 +50,7 @@ * Returns an empty `/icon` if there was no `character_appearance` entry in the `fields` list, * returns the generated/cached photo otherwise. */ +/* /datum/data/record/proc/get_photo(field_name, orientation) if(fields[field_name]) return fields[field_name] @@ -68,6 +71,7 @@ var/obj/item/photo/photo = new(null, picture) fields[field_name] = photo return photo +*/ /datum/data/record/general @@ -86,29 +90,6 @@ fields[DATACORE_CRIMINAL_STATUS] = new_status return TRUE -/datum/data/record/security/proc/add_citation(datum/data/crime/crime) - fields[DATACORE_CITATIONS] |= crime - -/datum/data/record/security/proc/remove_citation(cDataId) - if(istext(cDataId)) - cDataId = text2num(cDataId) - - for(var/datum/data/crime/crime in fields[DATACORE_CITATIONS]) - if(crime.dataId == cDataId) - fields[DATACORE_CITATIONS] -= crime - return - -/datum/data/record/security/proc/pay_citation(cDataId, amount) - if(istext(cDataId)) - cDataId = text2num(cDataId) - - for(var/datum/data/crime/crime in fields[DATACORE_CITATIONS]) - if(crime.dataId == cDataId) - crime.paid = crime.paid + amount - var/datum/bank_account/D = SSeconomy.department_accounts_by_id[ACCOUNT_SEC] - D.adjust_money(amount) - return - /datum/data/record/security/proc/add_crime(datum/data/crime/crime) fields[DATACORE_CRIMES] |= crime From bb8d31457e29bcbeac4a27c7fd2d4ebcdf6841b3 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 03:27:37 -0500 Subject: [PATCH 03/47] default records is outpost --- code/__DEFINES/datacore.dm | 2 +- code/controllers/subsystem/datacore.dm | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm index e73fa2c625cf..9099bef5c0a5 100644 --- a/code/__DEFINES/datacore.dm +++ b/code/__DEFINES/datacore.dm @@ -32,7 +32,7 @@ //#define DATACORE_CITATIONS "citation" /// Keys for SSdatacore.library -#define DATACORE_RECORDS_STATION "general" +#define DATACORE_RECORDS_OUTPOST "general" #define DATACORE_RECORDS_SECURITY "security" #define DATACORE_RECORDS_MEDICAL "medical" #define DATACORE_RECORDS_LOCKED "locked" diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index 02b11a3831b5..2e87e6f5661c 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -9,7 +9,7 @@ SUBSYSTEM_DEF(datacore) /// A list of data libraries keyed by DATACORE_RECORDS_* var/list/datum/data_library/library = list( - DATACORE_RECORDS_STATION, + DATACORE_RECORDS_OUTPOST, DATACORE_RECORDS_SECURITY, DATACORE_RECORDS_MEDICAL, DATACORE_RECORDS_LOCKED @@ -36,13 +36,13 @@ SUBSYSTEM_DEF(datacore) finished_setup = SSdatacore.finished_setup /// Returns a data record or null. -/datum/controller/subsystem/datacore/proc/get_record_by_name(name, record_type = DATACORE_RECORDS_STATION) +/datum/controller/subsystem/datacore/proc/get_record_by_name(name, record_type = DATACORE_RECORDS_OUTPOST) RETURN_TYPE(/datum/data/record) return library[record_type].get_record_by_name(name) /// Returns a data library's records list -/datum/controller/subsystem/datacore/proc/get_records(record_type = DATACORE_RECORDS_STATION) +/datum/controller/subsystem/datacore/proc/get_records(record_type = DATACORE_RECORDS_OUTPOST) RETURN_TYPE(/list) return library[record_type].records @@ -101,11 +101,11 @@ SUBSYSTEM_DEF(datacore) datacore_ready_callbacks.Cut() /datum/controller/subsystem/datacore/proc/manifest_modify(name, assignment) - var/datum/data/record/foundrecord = library[DATACORE_RECORDS_STATION].get_record_by_name(name) + var/datum/data/record/foundrecord = library[DATACORE_RECORDS_OUTPOST].get_record_by_name(name) if(foundrecord) foundrecord.fields[DATACORE_RANK] = assignment -/datum/controller/subsystem/datacore/proc/get_manifest(record_type = DATACORE_RECORDS_STATION) +/datum/controller/subsystem/datacore/proc/get_manifest(record_type = DATACORE_RECORDS_OUTPOST) var/list/manifest_out = list() var/list/departments = list( "Command" = GLOB.command_positions, @@ -148,7 +148,7 @@ SUBSYSTEM_DEF(datacore) return manifest_out -/datum/controller/subsystem/datacore/proc/get_manifest_html(record_key = DATACORE_RECORDS_STATION, monochrome = FALSE) +/datum/controller/subsystem/datacore/proc/get_manifest_html(record_key = DATACORE_RECORDS_OUTPOST, monochrome = FALSE) var/list/manifest = get_manifest(record_key) var/dat = {" - - - "} - for(var/department in manifest) - var/list/entries = manifest[department] - dat += "" - //JUST - var/even = FALSE - for(var/entry in entries) - var/list/entry_list = entry - dat += "" - even = !even - - dat += "
NameRank
[department]
[entry_list["name"]][entry_list["rank"]]
" - dat = replacetext(dat, "\n", "") - dat = replacetext(dat, "\t", "") - return dat - - -/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) - set waitfor = FALSE - var/static/list/show_directions = list(SOUTH, WEST) - if(H.mind && (H.mind.assigned_role != H.mind.special_role)) - var/assignment - if(H.mind.assigned_role) - assignment = H.mind.assigned_role - else if(H.job) - assignment = H.job - else - assignment = "Unassigned" - - var/static/record_id_num = 1001 - var/id = num2hex(record_id_num++,6) - if(!C) - C = H.client - var/image = get_id_photo(H, C, show_directions) - var/datum/picture/pf = new - var/datum/picture/ps = new - pf.picture_name = "[H]" - ps.picture_name = "[H]" - pf.picture_desc = "This is [H]." - ps.picture_desc = "This is [H]." - pf.picture_image = icon(image, dir = SOUTH) - ps.picture_image = icon(image, dir = WEST) - var/obj/item/photo/photo_front = new(null, pf) - var/obj/item/photo/photo_side = new(null, ps) - - //These records should ~really~ be merged or something - //General Record - var/datum/data/record/G = new() - G.fields["id"] = id - G.fields["name"] = H.real_name - G.fields["rank"] = assignment - G.fields["age"] = H.age - G.fields["species"] = H.dna.species.name - G.fields["fingerprint"] = md5(H.dna.uni_identity) - G.fields["p_stat"] = "Active" - G.fields["m_stat"] = "Stable" - G.fields["gender"] = H.gender - if(H.gender == "male") - G.fields["gender"] = "Male" - else if(H.gender == "female") - G.fields["gender"] = "Female" - else - G.fields["gender"] = "Other" - G.fields["photo_front"] = photo_front - G.fields["photo_side"] = photo_side - general += G - - //Medical Record - var/datum/data/record/M = new() - M.fields["id"] = id - M.fields["name"] = H.real_name - M.fields["blood_type"] = H.dna.blood_type.name - M.fields["b_dna"] = H.dna.unique_enzymes - M.fields["mi_dis"] = "None" - M.fields["mi_dis_d"] = "No minor disabilities have been declared." - M.fields["ma_dis"] = "None" - M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." - M.fields["alg"] = "None" - M.fields["alg_d"] = "No allergies have been detected in this patient." - M.fields["cdi"] = "None" - M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - M.fields["notes"] = H.get_trait_string(medical) - medical += M - - //Security Record - var/datum/data/record/S = new() - S.fields["id"] = id - S.fields["name"] = H.real_name - S.fields["criminal"] = "None" - S.fields["crim"] = list() - S.fields["notes"] = "No notes." - security += S - - //Locked Record - var/datum/data/record/L = new() - L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others? - L.fields["name"] = H.real_name - L.fields["rank"] = H.mind.assigned_role - L.fields["age"] = H.age - L.fields["gender"] = H.gender - if(H.gender == "male") - G.fields["gender"] = "Male" - else if(H.gender == "female") - G.fields["gender"] = "Female" - else - G.fields["gender"] = "Other" - L.fields["blood_type"] = H.dna.blood_type - L.fields["b_dna"] = H.dna.unique_enzymes - L.fields["identity"] = H.dna.uni_identity - L.fields["species"] = H.dna.species.type - L.fields["features"] = H.dna.features - L.fields["image"] = image - L.fields["mindref"] = H.mind - locked += L - return - -/datum/datacore/proc/get_id_photo(mob/living/carbon/human/H, client/C, show_directions = list(SOUTH), datum/job/J) - var/datum/preferences/P - if(!C) - C = H.client - if(C) - P = C.prefs - return get_flat_human_icon(null, J, P, DUMMY_HUMAN_SLOT_MANIFEST, show_directions) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 13617c2c3277..d2d799307d23 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -369,7 +369,7 @@ else if(href_list["view_rec"]) playsound(src, "terminal_type", 25, FALSE) - active_record = SSdatacore.find_record("id", href_list["view_rec"], records) + active_record = SSdatacore.find_record(DATACORE_ID, href_list["view_rec"], records) if(active_record) menu = 3 else @@ -459,7 +459,7 @@ playsound(src, "terminal_type", 25, FALSE) else if (href_list["clone"]) - var/datum/data/record/C = SSdatacore.find_record("id", href_list["clone"], records) + var/datum/data/record/C = SSdatacore.find_record(DATACORE_ID, href_list["clone"], records) var/empty = href_list["empty"] //Look for that player! They better be dead! if(C) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index faf43295d490..7dbae6d9204c 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -434,9 +434,9 @@ active2 = null else if(href_list["d_rec"]) - active1 = SSdatacore.find_record("id", href_list["d_rec"], DATACORE_RECORDS_OUTPOST) + active1 = SSdatacore.find_record(DATACORE_ID, href_list["d_rec"], DATACORE_RECORDS_OUTPOST) if(active1) - active2 = SSdatacore.find_record("id", href_list["d_rec"], DATACORE_RECORDS_MEDICAL) + active2 = SSdatacore.find_record(DATACORE_ID, href_list["d_rec"], DATACORE_RECORDS_MEDICAL) if(!active2) active1 = null screen = 4 diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index bd410a997219..c12f8bced9f1 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -470,17 +470,17 @@ Code: switch(href_list["choice"]) if("Medical Records") - active1 = SSdatacore.find_record("id", href_list["target"], DATACORE_RECORDS_OUTPOST) + active1 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_OUTPOST) if(active1) - active2 = SSdatacore.find_record("id", href_list["target"], DATACORE_RECORDS_MEDICAL) + active2 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_MEDICAL) host_pda.mode = 441 if(!active2) active1 = null if("Security Records") - active1 = SSdatacore.find_record("id", href_list["target"], DATACORE_RECORDS_OUTPOST) + active1 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_OUTPOST) if(active1) - active3 = SSdatacore.find_record("id", href_list["target"], DATACORE_RECORDS_SECURITY) + active3 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_SECURITY) host_pda.mode = 451 if(!active3) active1 = null diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index a4a3723ecc29..00e1b1564284 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -308,18 +308,18 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( if("medicalrecord") // Accessing medical records if(subscreen == 1) - medicalActive1 = SSdatacore.find_record("id", href_list["med_rec"], DATACORE_RECORDS_OUTPOST) + medicalActive1 = SSdatacore.find_record(DATACORE_ID, href_list["med_rec"], DATACORE_RECORDS_OUTPOST) if(medicalActive1) - medicalActive2 = SSdatacore.find_record("id", href_list["med_rec"], DATACORE_RECORDS_MEDICAL) + medicalActive2 = SSdatacore.find_record(DATACORE_ID, href_list["med_rec"], DATACORE_RECORDS_MEDICAL) if(!medicalActive2) medicalActive1 = null temp = "Unable to locate requested security record. Record may have been deleted, or never have existed." if("securityrecord") if(subscreen == 1) - securityActive1 = SSdatacore.find_record("id", href_list["sec_rec"], DATACORE_RECORDS_OUTPOST) + securityActive1 = SSdatacore.find_record(DATACORE_ID, href_list["sec_rec"], DATACORE_RECORDS_OUTPOST) if(securityActive1) - securityActive2 = SSdatacore.find_record("id", href_list["sec_rec"], DATACORE_RECORDS_SECURITY) + securityActive2 = SSdatacore.find_record(DATACORE_ID, href_list["sec_rec"], DATACORE_RECORDS_SECURITY) if(!securityActive2) securityActive1 = null temp = "Unable to locate requested security record. Record may have been deleted, or never have existed." From 8c3c63f4dae1a32852e9bb36dcf91456c6c115cd Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 04:54:47 -0500 Subject: [PATCH 06/47] alot of defines --- code/__HELPERS/names.dm | 2 +- code/game/data_huds.dm | 2 +- code/game/machinery/computer/arcade.dm | 4 +- code/game/machinery/computer/card.dm | 4 +- code/game/machinery/computer/cloning.dm | 48 ++-- code/game/machinery/computer/medical.dm | 200 +++++++------- .../computer/prisoner/gulag_teleporter.dm | 4 +- code/game/machinery/computer/security.dm | 252 +++++++++--------- code/game/machinery/computer/warrant.dm | 12 +- code/game/machinery/cryopod.dm | 8 +- code/game/machinery/gulag_teleporter.dm | 2 +- .../machinery/porta_turret/portable_turret.dm | 2 +- code/game/machinery/scan_gate.dm | 2 +- code/game/objects/items/devices/PDA/cart.dm | 50 ++-- .../antagonists/traitor/syndicate_contract.dm | 2 +- code/modules/datacore/library.dm | 4 +- .../mob/living/carbon/human/examine.dm | 8 +- code/modules/mob/living/carbon/human/human.dm | 28 +- code/modules/mob/living/silicon/ai/ai.dm | 2 +- .../mob/living/silicon/pai/software.dm | 14 +- code/modules/paperwork/filingcabinet.dm | 18 +- 21 files changed, 334 insertions(+), 334 deletions(-) diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index 5cee279f5e04..b898286c1697 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -180,7 +180,7 @@ GLOBAL_DATUM(syndicate_code_response_regex, /regex) var/list/names = list() for(var/datum/data/record/t in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))//Picks from crew manifest. - names += t.fields["name"] + names += t.fields[DATACORE_NAME] var/maxwords = words//Extra var to check for duplicates. diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index ff283453d55f..63c0bc38023e 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -292,7 +292,7 @@ Security HUDs! Basic mode shows only the job. if(perpname) var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) if(R) - switch(R.fields["criminal"]) + switch(R.fields[DATACORE_CRIMINAL_STATUS]) if("*Arrest*") holder.icon_state = "hudwanted" return diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 776cf1d314c9..fbb7eac529a1 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -544,8 +544,8 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( if(!isnull(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - if(R.fields["name"] == gamer.name) - R.fields["m_stat"] = "*Unstable*" + if(R.fields[DATACORE_NAME] == gamer.name) + R.fields[DATACORE_MENTAL_HEALTH] = "*Unstable*" return /obj/machinery/computer/arcade/orion_trail/ui_interact(mob/user) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index ca1bfd33f4c3..cb8cee14dfb3 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -181,7 +181,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if (mode == 1) // accessing crew manifest dat += "Crew Manifest:
Please use security record computer to modify entries.

" for(var/datum/data/record/t in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - dat += {"[t.fields["name"]] - [t.fields["rank"]]
"} + dat += {"[t.fields[DATACORE_NAME]] - [t.fields[DATACORE_RANK]]
"} dat += "Print

Access ID modification console.
" else @@ -465,7 +465,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/obj/item/paper/printed_paper = new /obj/item/paper(loc) var/t1 = "Crew Manifest:
" for(var/datum/data/record/t in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - t1 += t.fields["name"] + " - " + t.fields["rank"] + "
" + t1 += t.fields[DATACORE_NAME] + " - " + t.fields[DATACORE_RANK] + "
" printed_paper.add_raw_text(t1) printed_paper.name = "paper- 'Crew Manifest'" printing = null diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index d2d799307d23..9acbcecf808d 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -63,7 +63,7 @@ . = pod /proc/grow_clone_from_record(obj/machinery/clonepod/pod, datum/data/record/R, empty) - return pod.growclone(R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mindref"], R.fields["last_death"], R.fields["blood_type"], R.fields["mrace"], R.fields["features"], R.fields["factions"], R.fields["quirks"], R.fields["bank_account"], R.fields["traumas"], empty) + return pod.growclone(R.fields[DATACORE_NAME], R.fields["UI"], R.fields["SE"], R.fields[DATACORE_MINDREF], R.fields["last_death"], R.fields[DATACORE_BLOOD_TYPE], R.fields["mrace"], R.fields[DATACORE_DNA_FEATURES], R.fields["factions"], R.fields["quirks"], R.fields["bank_account"], R.fields["traumas"], empty) /obj/machinery/computer/cloning/process() if(!(scanner && LAZYLEN(pods) && autoprocess)) @@ -73,7 +73,7 @@ scan_occupant(scanner.occupant) for(var/datum/data/record/R in records) - var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mindref"]) + var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields[DATACORE_MINDREF]) if(!pod) return @@ -83,8 +83,8 @@ var/result = grow_clone_from_record(pod, R) if(result & CLONING_SUCCESS) - temp = "[R.fields["name"]] => Cloning cycle in progress..." - log_cloning("Cloning of [key_name(R.fields["mindref"])] automatically started via autoprocess - [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].") + temp = "[R.fields[DATACORE_NAME]] => Cloning cycle in progress..." + log_cloning("Cloning of [key_name(R.fields[DATACORE_MINDREF])] automatically started via autoprocess - [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].") if(result & CLONING_DELETE_RECORD) records -= R @@ -231,7 +231,7 @@ dat += "

Current records

" dat += "<< Back

" for(var/datum/data/record/R in records) - dat += "

[R.fields["name"]]

Scan ID [R.fields["id"]] View Record" + dat += "

[R.fields[DATACORE_NAME]]

Scan ID [R.fields[DATACORE_ID]] View Record" if(3) dat += "

Selected Record

" dat += "<< Back
" @@ -240,10 +240,10 @@ dat += "Record not found." else var/body_only = active_record.fields["body_only"] - dat += "

[active_record.fields["name"]][body_only ? " - BODY-ONLY" : ""]

" - dat += "Scan ID [active_record.fields["id"]] \ - [!body_only ? "Clone" : "" ]\ - Empty Clone
" + dat += "

[active_record.fields[DATACORE_NAME]][body_only ? " - BODY-ONLY" : ""]

" + dat += "Scan ID [active_record.fields[DATACORE_ID]] \ + [!body_only ? "Clone" : "" ]\ + Empty Clone
" var/obj/item/implant/health/H = locate(active_record.fields["imp"]) @@ -269,7 +269,7 @@ var/list/L = list() if(diskette.fields["UI"]) L += "Unique Identifier" - if(diskette.fields["UE"] && diskette.fields["name"] && diskette.fields["blood_type"]) + if(diskette.fields["UE"] && diskette.fields[DATACORE_NAME] && diskette.fields[DATACORE_BLOOD_TYPE]) L += "Unique Enzymes" if(diskette.fields["SE"]) L += "Structural Enzymes" @@ -399,8 +399,8 @@ else if (menu == 4) - log_cloning("[key_name(usr)] deleted [key_name(active_record.fields["mindref"])]'s cloning records from [src] at [AREACOORD(src)].") - temp = "[active_record.fields["name"]] => Record deleted." + log_cloning("[key_name(usr)] deleted [key_name(active_record.fields[DATACORE_MINDREF])]'s cloning records from [src] at [AREACOORD(src)].") + temp = "[active_record.fields[DATACORE_NAME]] => Record deleted." records.Remove(active_record) active_record = null playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) @@ -432,7 +432,7 @@ if(include_se) overwrite_field_if_available(active_record, diskette, "SE") - log_cloning("[key_name(usr)] uploaded [key_name(active_record.fields["mindref"])]'s cloning records to [src] at [AREACOORD(src)] via [diskette].") + log_cloning("[key_name(usr)] uploaded [key_name(active_record.fields[DATACORE_MINDREF])]'s cloning records to [src] at [AREACOORD(src)] via [diskette].") temp = "Load successful." playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) @@ -448,9 +448,9 @@ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE) return - log_cloning("[key_name(usr)] added [key_name(active_record.fields["mindref"])]'s cloning records to [diskette] via [src] at [AREACOORD(src)].") + log_cloning("[key_name(usr)] added [key_name(active_record.fields[DATACORE_MINDREF])]'s cloning records to [diskette] via [src] at [AREACOORD(src)].") diskette.fields = active_record.fields.Copy() - diskette.name = "data disk - '[diskette.fields["name"]]'" + diskette.name = "data disk - '[diskette.fields[DATACORE_NAME]]'" temp = "Save successful." playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) @@ -484,16 +484,16 @@ else var/result = grow_clone_from_record(pod, C, empty) if(result & CLONING_SUCCESS) - temp = "[C.fields["name"]] => Cloning cycle in progress..." + temp = "[C.fields[DATACORE_NAME]] => Cloning cycle in progress..." playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) if(active_record == C) active_record = null menu = 1 success = TRUE if(!empty) - log_cloning("[key_name(usr)] initiated cloning of [key_name(C.fields["mindref"])] via [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].") + log_cloning("[key_name(usr)] initiated cloning of [key_name(C.fields[DATACORE_MINDREF])] via [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].") else - log_cloning("[key_name(usr)] initiated EMPTY cloning of [key_name(C.fields["mindref"])] via [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].") + log_cloning("[key_name(usr)] initiated EMPTY cloning of [key_name(C.fields[DATACORE_MINDREF])] via [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].") if(result & CLONING_DELETE_RECORD) if(active_record == C) active_record = null @@ -501,7 +501,7 @@ records -= C if(!success) - temp = "[C.fields["name"]] => Initialisation failure." + temp = "[C.fields[DATACORE_NAME]] => Initialisation failure." playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE) else @@ -575,13 +575,13 @@ var/datum/species/rando_race = pick(GLOB.roundstart_races) R.fields["mrace"] = rando_race.type - R.fields["name"] = mob_occupant.real_name - R.fields["id"] = copytext_char(md5(mob_occupant.real_name), 2, 6) + R.fields[DATACORE_NAME] = mob_occupant.real_name + R.fields[DATACORE_ID] = copytext_char(md5(mob_occupant.real_name), 2, 6) R.fields["UE"] = dna.unique_enzymes R.fields["UI"] = dna.uni_identity R.fields["SE"] = dna.mutation_index - R.fields["blood_type"] = dna.blood_type - R.fields["features"] = dna.features + R.fields[DATACORE_BLOOD_TYPE] = dna.blood_type + R.fields[DATACORE_DNA_FEATURES] = dna.features R.fields["factions"] = mob_occupant.faction R.fields["quirks"] = list() for(var/V in mob_occupant.roundstart_quirks) @@ -595,7 +595,7 @@ R.fields["traumas"] = B.get_traumas() R.fields["bank_account"] = has_bank_account - R.fields["mindref"] = "[REF(mob_occupant.mind)]" + R.fields[DATACORE_MINDREF] = "[REF(mob_occupant.mind)]" R.fields["last_death"] = mob_occupant.stat == DEAD && mob_occupant.mind ? mob_occupant.mind.last_death : -1 R.fields["body_only"] = body_only diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 7dbae6d9204c..624010c1b19f 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -67,26 +67,26 @@ var/blood_type = "" var/b_dna = "" for(var/datum/data/record/E in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - if((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) - blood_type = E.fields["blood_type"] - b_dna = E.fields["b_dna"] + if((E.fields[DATACORE_NAME] == R.fields[DATACORE_NAME] && E.fields[DATACORE_ID] == R.fields[DATACORE_ID])) + blood_type = E.fields[DATACORE_BLOOD_TYPE] + b_dna = E.fields[DATACORE_BLOOD_DNA] var/background - if(R.fields["m_stat"] == "*Insane*" || R.fields["p_stat"] == "*Deceased*") + if(R.fields[DATACORE_MENTAL_HEALTH] == "*Insane*" || R.fields[DATACORE_PHYSICAL_HEALTH] == "*Deceased*") background = "'background-color:#990000;'" - else if(R.fields["p_stat"] == "*Unconscious*" || R.fields["m_stat"] == "*Unstable*") + else if(R.fields[DATACORE_PHYSICAL_HEALTH] == "*Unconscious*" || R.fields[DATACORE_MENTAL_HEALTH] == "*Unstable*") background = "'background-color:#CD6500;'" - else if(R.fields["p_stat"] == "Physically Unfit" || R.fields["m_stat"] == "*Watch*") + else if(R.fields[DATACORE_PHYSICAL_HEALTH] == "Physically Unfit" || R.fields[DATACORE_MENTAL_HEALTH] == "*Watch*") background = "'background-color:#3BB9FF;'" else background = "'background-color:#4F7529;'" - dat += text("[]", background, R.fields["id"], R.fields["name"]) - dat += text("[]", R.fields["id"]) - dat += text("F: []
D: []", R.fields["fingerprint"], b_dna) + dat += text("[]", background, R.fields[DATACORE_ID], R.fields[DATACORE_NAME]) + dat += text("[]", R.fields[DATACORE_ID]) + dat += text("F: []
D: []", R.fields[DATACORE_FINGERPRINT], b_dna) dat += text("[]", blood_type) - dat += text("[]", R.fields["p_stat"]) - dat += text("[]", R.fields["m_stat"]) + dat += text("[]", R.fields[DATACORE_PHYSICAL_HEALTH]) + dat += text("[]", R.fields[DATACORE_MENTAL_HEALTH]) dat += "
" dat += "
Back" if(3) @@ -95,38 +95,38 @@ dat += "" if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - if(istype(active1.fields["photo_front"], /obj/item/photo)) - var/obj/item/photo/P1 = active1.fields["photo_front"] + if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) + var/obj/item/photo/P1 = active1.fields[DATACORE_PHOTO] user << browse_rsc(P1.picture.picture_image, "photo_front") - if(istype(active1.fields["photo_side"], /obj/item/photo)) - var/obj/item/photo/P2 = active1.fields["photo_side"] + if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) + var/obj/item/photo/P2 = active1.fields[DATACORE_PHOTO_SIDE] user << browse_rsc(P2.picture.picture_image, "photo_side") - dat += "" + dat += "" dat += "" dat += "" - dat += "" - dat += "" - dat += "" - dat += "" - dat += "" - dat += "" - dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" else dat += "" dat += "" if(active2 in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - dat += "" - dat += "" + dat += "" + dat += "" dat += "" dat += "" - dat += "" - dat += "" + dat += "" + dat += "" dat += "" dat += "" - dat += "" //(per disease info placed in log/comment section) - dat += "" - dat += "" + dat += "" //(per disease info placed in log/comment section) + dat += "" + dat += "" dat += "" var/counter = 1 @@ -270,30 +270,30 @@ switch(href_list["field"]) if("fingerprint") if(active1) - var/t1 = stripped_input("Please input fingerprint hash:", "Med. records", active1.fields["fingerprint"], null) + var/t1 = stripped_input("Please input fingerprint hash:", "Med. records", active1.fields[DATACORE_FINGERPRINT], null) if(!canUseMedicalRecordsConsole(usr, t1, a1)) return - active1.fields["fingerprint"] = t1 + active1.fields[DATACORE_FINGERPRINT] = t1 if("gender") if(active1) - if(active1.fields["gender"] == "Male") - active1.fields["gender"] = "Female" - else if(active1.fields["gender"] == "Female") - active1.fields["gender"] = "Other" + if(active1.fields[DATACORE_GENDER] == "Male") + active1.fields[DATACORE_GENDER] = "Female" + else if(active1.fields[DATACORE_GENDER] == "Female") + active1.fields[DATACORE_GENDER] = "Other" else - active1.fields["gender"] = "Male" + active1.fields[DATACORE_GENDER] = "Male" if("age") if(active1) - var/t1 = input("Please input age:", "Med. records", active1.fields["age"], null) as num + var/t1 = input("Please input age:", "Med. records", active1.fields[DATACORE_AGE], null) as num if(!canUseMedicalRecordsConsole(usr, t1, a1)) return - active1.fields["age"] = t1 + active1.fields[DATACORE_AGE] = t1 if("species") if(active1) - var/t1 = stripped_input("Please input species name", "Med. records", active1.fields["species"], null) + var/t1 = stripped_input("Please input species name", "Med. records", active1.fields[DATACORE_SPECIES], null) if(!canUseMedicalRecordsConsole(usr, t1, a1)) return - active1.fields["species"] = t1 + active1.fields[DATACORE_SPECIES] = t1 if("mi_dis") if(active2) var/t1 = stripped_input("Please input minor disabilities list:", "Med. records", active2.fields["mi_dis"], null) @@ -308,16 +308,16 @@ active2.fields["mi_dis_d"] = t1 if("ma_dis") if(active2) - var/t1 = stripped_input("Please input major disabilities list:", "Med. records", active2.fields["ma_dis"], null) + var/t1 = stripped_input("Please input major disabilities list:", "Med. records", active2.fields[DATACORE_DISABILITIES], null) if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) return - active2.fields["ma_dis"] = t1 + active2.fields[DATACORE_DISABILITIES] = t1 if("ma_dis_d") if(active2) - var/t1 = stripped_input("Please summarize major dis.:", "Med. records", active2.fields["ma_dis_d"], null) + var/t1 = stripped_input("Please summarize major dis.:", "Med. records", active2.fields[DATACORE_DISABILITIES_DETAILS], null) if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) return - active2.fields["ma_dis_d"] = t1 + active2.fields[DATACORE_DISABILITIES_DETAILS] = t1 if("alg") if(active2) var/t1 = stripped_input("Please state allergies:", "Med. records", active2.fields["alg"], null) @@ -332,22 +332,22 @@ active2.fields["alg_d"] = t1 if("cdi") if(active2) - var/t1 = stripped_input("Please state diseases:", "Med. records", active2.fields["cdi"], null) + var/t1 = stripped_input("Please state diseases:", "Med. records", active2.fields[DATACORE_DISEASES], null) if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) return - active2.fields["cdi"] = t1 + active2.fields[DATACORE_DISEASES] = t1 if("cdi_d") if(active2) - var/t1 = stripped_input("Please summarize diseases:", "Med. records", active2.fields["cdi_d"], null) + var/t1 = stripped_input("Please summarize diseases:", "Med. records", active2.fields[DATACORE_DISEASES_DETAILS], null) if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) return - active2.fields["cdi_d"] = t1 + active2.fields[DATACORE_DISEASES_DETAILS] = t1 if("notes") if(active2) - var/t1 = stripped_input("Please summarize notes:", "Med. records", active2.fields["notes"], null) + var/t1 = stripped_input("Please summarize notes:", "Med. records", active2.fields[DATACORE_NOTES], null) if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) return - active2.fields["notes"] = t1 + active2.fields[DATACORE_NOTES] = t1 if("p_stat") if(active1) temp = "Physical Condition:
\n\t*Deceased*
\n\t*Unconscious*
\n\tActive
\n\tPhysically Unfit
" @@ -359,21 +359,21 @@ temp = "Blood Type:
\n\tA-A+
\n\tB-B+
\n\tAB-AB+
\n\tO-O+
" if("b_dna") if(active2) - var/t1 = stripped_input("Please input DNA hash:", "Med. records", active2.fields["b_dna"], null) + var/t1 = stripped_input("Please input DNA hash:", "Med. records", active2.fields[DATACORE_BLOOD_DNA], null) if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) return - active2.fields["b_dna"] = t1 + active2.fields[DATACORE_BLOOD_DNA] = t1 if("show_photo_front") if(active1) - if(active1.fields["photo_front"]) - if(istype(active1.fields["photo_front"], /obj/item/photo)) - var/obj/item/photo/P = active1.fields["photo_front"] + if(active1.fields[DATACORE_PHOTO]) + if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) + var/obj/item/photo/P = active1.fields[DATACORE_PHOTO] P.show(usr) if("show_photo_side") if(active1) - if(active1.fields["photo_side"]) - if(istype(active1.fields["photo_side"], /obj/item/photo)) - var/obj/item/photo/P = active1.fields["photo_side"] + if(active1.fields[DATACORE_PHOTO_SIDE]) + if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) + var/obj/item/photo/P = active1.fields[DATACORE_PHOTO_SIDE] P.show(usr) else @@ -381,46 +381,46 @@ if(active1) switch(href_list["p_stat"]) if("deceased") - active1.fields["p_stat"] = "*Deceased*" + active1.fields[DATACORE_PHYSICAL_HEALTH] = "*Deceased*" if("unconscious") - active1.fields["p_stat"] = "*Unconscious*" + active1.fields[DATACORE_PHYSICAL_HEALTH] = "*Unconscious*" if("active") - active1.fields["p_stat"] = "Active" + active1.fields[DATACORE_PHYSICAL_HEALTH] = "Active" if("unfit") - active1.fields["p_stat"] = "Physically Unfit" + active1.fields[DATACORE_PHYSICAL_HEALTH] = "Physically Unfit" else if(href_list["m_stat"]) if(active1) switch(href_list["m_stat"]) if("insane") - active1.fields["m_stat"] = "*Insane*" + active1.fields[DATACORE_MENTAL_HEALTH] = "*Insane*" if("unstable") - active1.fields["m_stat"] = "*Unstable*" + active1.fields[DATACORE_MENTAL_HEALTH] = "*Unstable*" if("watch") - active1.fields["m_stat"] = "*Watch*" + active1.fields[DATACORE_MENTAL_HEALTH] = "*Watch*" if("stable") - active1.fields["m_stat"] = "Stable" + active1.fields[DATACORE_MENTAL_HEALTH] = "Stable" else if(href_list["blood_type"]) if(active2) switch(href_list["blood_type"]) if("an") - active2.fields["blood_type"] = "A-" + active2.fields[DATACORE_BLOOD_TYPE] = "A-" if("bn") - active2.fields["blood_type"] = "B-" + active2.fields[DATACORE_BLOOD_TYPE] = "B-" if("abn") - active2.fields["blood_type"] = "AB-" + active2.fields[DATACORE_BLOOD_TYPE] = "AB-" if("on") - active2.fields["blood_type"] = "O-" + active2.fields[DATACORE_BLOOD_TYPE] = "O-" if("ap") - active2.fields["blood_type"] = "A+" + active2.fields[DATACORE_BLOOD_TYPE] = "A+" if("bp") - active2.fields["blood_type"] = "B+" + active2.fields[DATACORE_BLOOD_TYPE] = "B+" if("abp") - active2.fields["blood_type"] = "AB+" + active2.fields[DATACORE_BLOOD_TYPE] = "AB+" if("op") - active2.fields["blood_type"] = "O+" + active2.fields[DATACORE_BLOOD_TYPE] = "O+" else if(href_list["del_r"]) @@ -428,7 +428,7 @@ temp = "Are you sure you wish to delete the record (Medical Portion Only)?
\n\tYes
\n\tNo
" else if(href_list["del_r2"]) - investigate_log("[key_name(usr)] has deleted the medical records for [active1.fields["name"]].", INVESTIGATE_RECORDS) + investigate_log("[key_name(usr)] has deleted the medical records for [active1.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) if(active2) qdel(active2) active2 = null @@ -444,20 +444,20 @@ else if(href_list["new"]) if((istype(active1, /datum/data/record) && !(istype(active2, /datum/data/record)))) var/datum/data/record/R = new /datum/data/record() - R.fields["name"] = active1.fields["name"] - R.fields["id"] = active1.fields["id"] - R.name = text("Medical Record #[]", R.fields["id"]) - R.fields["blood_type"] = "Unknown" - R.fields["b_dna"] = "Unknown" + R.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] + R.fields[DATACORE_ID] = active1.fields[DATACORE_ID] + R.name = text("Medical Record #[]", R.fields[DATACORE_ID]) + R.fields[DATACORE_BLOOD_TYPE] = "Unknown" + R.fields[DATACORE_BLOOD_DNA] = "Unknown" R.fields["mi_dis"] = "None" R.fields["mi_dis_d"] = "No minor disabilities have been diagnosed." - R.fields["ma_dis"] = "None" - R.fields["ma_dis_d"] = "No major disabilities have been diagnosed." + R.fields[DATACORE_DISABILITIES] = "None" + R.fields[DATACORE_DISABILITIES_DETAILS] = "No major disabilities have been diagnosed." R.fields["alg"] = "None" R.fields["alg_d"] = "No allergies have been detected in this patient." - R.fields["cdi"] = "None" - R.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - R.fields["notes"] = "No notes." + R.fields[DATACORE_DISEASES] = "None" + R.fields[DATACORE_DISEASES_DETAILS] = "No diseases have been diagnosed at the moment." + R.fields[DATACORE_NOTES] = "No notes." SSdatacore.inject_record(R, DATACORE_RECORDS_MEDICAL) active2 = R screen = 4 @@ -486,7 +486,7 @@ active2 = null t1 = lowertext(t1) for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - if((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"]))) + if((lowertext(R.fields[DATACORE_NAME]) == t1 || t1 == lowertext(R.fields[DATACORE_ID]) || t1 == lowertext(R.fields[DATACORE_BLOOD_DNA]))) active2 = R else //Foreach continue //goto(3229) @@ -494,7 +494,7 @@ temp = text("Could not locate record [].", sanitize(t1)) else for(var/datum/data/record/E in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - if((E.fields["name"] == active2.fields["name"] || E.fields["id"] == active2.fields["id"])) + if((E.fields[DATACORE_NAME] == active2.fields[DATACORE_NAME] || E.fields[DATACORE_ID] == active2.fields[DATACORE_ID])) active1 = E else //Foreach continue //goto(3334) @@ -509,18 +509,18 @@ var/obj/item/paper/printed_paper = new /obj/item/paper(loc) var/final_paper_text = "
Medical Record - (MR-[SSdatacore.medicalPrintCount])

" if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active1.fields["name"], active1.fields["id"], active1.fields["gender"], active1.fields["age"]) - final_paper_text += "\nSpecies: [active1.fields["species"]]
" - final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"]) + final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active1.fields[DATACORE_NAME], active1.fields[DATACORE_ID], active1.fields[DATACORE_GENDER], active1.fields[DATACORE_AGE]) + final_paper_text += "\nSpecies: [active1.fields[DATACORE_SPECIES]]
" + final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields[DATACORE_FINGERPRINT], active1.fields[DATACORE_PHYSICAL_HEALTH], active1.fields[DATACORE_MENTAL_HEALTH]) else final_paper_text += "General Record Lost!
" if(active2 in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - final_paper_text += text("
\n
Medical Data

\nBlood Type: []
\nDNA: []
\n
\nMinor Disabilities: []
\nDetails: []
\n
\nMajor Disabilities: []
\nDetails: []
\n
\nAllergies: []
\nDetails: []
\n
\nCurrent Diseases: [] (per disease info placed in log/comment section)
\nDetails: []
\n
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", active2.fields["blood_type"], active2.fields["b_dna"], active2.fields["mi_dis"], active2.fields["mi_dis_d"], active2.fields["ma_dis"], active2.fields["ma_dis_d"], active2.fields["alg"], active2.fields["alg_d"], active2.fields["cdi"], active2.fields["cdi_d"], active2.fields["notes"]) + final_paper_text += text("
\n
Medical Data

\nBlood Type: []
\nDNA: []
\n
\nMinor Disabilities: []
\nDetails: []
\n
\nMajor Disabilities: []
\nDetails: []
\n
\nAllergies: []
\nDetails: []
\n
\nCurrent Diseases: [] (per disease info placed in log/comment section)
\nDetails: []
\n
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", active2.fields[DATACORE_BLOOD_TYPE], active2.fields[DATACORE_BLOOD_DNA], active2.fields["mi_dis"], active2.fields["mi_dis_d"], active2.fields[DATACORE_DISABILITIES], active2.fields[DATACORE_DISABILITIES_DETAILS], active2.fields["alg"], active2.fields["alg_d"], active2.fields[DATACORE_DISEASES], active2.fields[DATACORE_DISEASES_DETAILS], active2.fields[DATACORE_NOTES]) var/counter = 1 while(active2.fields[text("com_[]", counter)]) final_paper_text += text("[]
", active2.fields[text("com_[]", counter)]) counter++ - printed_paper.name = text("MR-[] '[]'", SSdatacore.medicalPrintCount, active1.fields["name"]) + printed_paper.name = text("MR-[] '[]'", SSdatacore.medicalPrintCount, active1.fields[DATACORE_NAME]) else final_paper_text += "Medical Record Lost!
" printed_paper.name = text("MR-[] '[]'", SSdatacore.medicalPrintCount, "Record Lost") @@ -541,20 +541,20 @@ switch(rand(1,6)) if(1) if(prob(10)) - R.fields["name"] = random_unique_lizard_name(R.fields["gender"],1) + R.fields[DATACORE_NAME] = random_unique_lizard_name(R.fields[DATACORE_GENDER],1) else - R.fields["name"] = random_unique_name(R.fields["gender"],1) + R.fields[DATACORE_NAME] = random_unique_name(R.fields[DATACORE_GENDER],1) if(2) - R.fields["gender"] = pick("Male", "Female", "Other") + R.fields[DATACORE_GENDER] = pick("Male", "Female", "Other") if(3) - R.fields["age"] = rand(AGE_MIN, AGE_MAX) + R.fields[DATACORE_AGE] = rand(AGE_MIN, AGE_MAX) if(4) var/datum/blood_type/blood = random_blood_type() - R.fields["blood_type"] = blood.name + R.fields[DATACORE_BLOOD_TYPE] = blood.name if(5) - R.fields["p_stat"] = pick("*Unconscious*", "Active", "Physically Unfit") + R.fields[DATACORE_PHYSICAL_HEALTH] = pick("*Unconscious*", "Active", "Physically Unfit") if(6) - R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") + R.fields[DATACORE_MENTAL_HEALTH] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") continue else if(prob(1)) diff --git a/code/game/machinery/computer/prisoner/gulag_teleporter.dm b/code/game/machinery/computer/prisoner/gulag_teleporter.dm index 7cd423f3abda..483ee6d02b8e 100644 --- a/code/game/machinery/computer/prisoner/gulag_teleporter.dm +++ b/code/game/machinery/computer/prisoner/gulag_teleporter.dm @@ -39,9 +39,9 @@ if(!isnull(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) for(var/r in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) var/datum/data/record/R = r - if(R.fields["name"] == prisoner_list["name"]) + if(R.fields[DATACORE_NAME] == prisoner_list["name"]) temporary_record = R - prisoner_list["crimstat"] = temporary_record.fields["criminal"] + prisoner_list["crimstat"] = temporary_record.fields[DATACORE_CRIMINAL_STATUS] data["prisoner"] = prisoner_list diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index da363272376c..0043b0439223 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -123,8 +123,8 @@ for(var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST), sortBy, order)) var/crimstat = "" for(var/datum/data/record/E in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - if((E.fields["name"] == R.fields["name"]) && (E.fields["id"] == R.fields["id"])) - crimstat = E.fields["criminal"] + if((E.fields[DATACORE_NAME] == R.fields[DATACORE_NAME]) && (E.fields[DATACORE_ID] == R.fields[DATACORE_ID])) + crimstat = E.fields[DATACORE_CRIMINAL_STATUS] var/background switch(crimstat) if("*Arrest*") @@ -141,10 +141,10 @@ background = "''" //"'background-color:#FFFFFF;'" crimstat = "No Record." dat += "" - dat += text("", R.fields["name"], R.fields["id"], R.fields["rank"], R.fields["fingerprint"], R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) - dat += text("", R.fields["fingerprint"]) + dat += text("", R.fields[DATACORE_NAME], R.fields[DATACORE_ID], R.fields[DATACORE_RANK], R.fields[DATACORE_FINGERPRINT], R.fields[DATACORE_NAME]) + dat += text("", R.fields[DATACORE_ID]) + dat += text("", R.fields[DATACORE_RANK]) + dat += text("", R.fields[DATACORE_FINGERPRINT]) dat += text("", crimstat) dat += {"
Medical Record
Name:[active1.fields["name"]]
Name:[active1.fields[DATACORE_NAME]]
ID:[active1.fields["id"]]
Gender: [active1.fields["gender"]] 
Age: [active1.fields["age"]] 
Species: [active1.fields["species"]] 
Fingerprint: [active1.fields["fingerprint"]] 
Physical Status: [active1.fields["p_stat"]] 
Mental Status: [active1.fields["m_stat"]] 
ID:[active1.fields[DATACORE_ID]]
Gender: [active1.fields[DATACORE_GENDER]] 
Age: [active1.fields[DATACORE_AGE]] 
Species: [active1.fields[DATACORE_SPECIES]] 
Fingerprint: [active1.fields[DATACORE_FINGERPRINT]] 
Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]] 
Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]] 
General Record Lost!

Medical Data
Blood Type: [active2.fields["blood_type"]] 
DNA: [active2.fields["b_dna"]] 
Blood Type: [active2.fields[DATACORE_BLOOD_TYPE]] 
DNA: [active2.fields[DATACORE_BLOOD_DNA]] 

Minor Disabilities:

 [active2.fields["mi_dis"]] 
Details: [active2.fields["mi_dis_d"]] 

Major Disabilities:

 [active2.fields["ma_dis"]] 
Details: [active2.fields["ma_dis_d"]] 

Major Disabilities:

 [active2.fields[DATACORE_DISABILITIES]] 
Details: [active2.fields[DATACORE_DISABILITIES_DETAILS]] 

Allergies:

 [active2.fields["alg"]] 
Details: [active2.fields["alg_d"]] 

Current Diseases:

 [active2.fields["cdi"]] 
Details: [active2.fields["cdi_d"]] 

Important Notes:

 [active2.fields["notes"]] 

Current Diseases:

 [active2.fields[DATACORE_DISEASES]] 
Details: [active2.fields[DATACORE_DISEASES_DETAILS]] 

Important Notes:

 [active2.fields[DATACORE_NOTES]] 

Comments/Log
[][][][][][][][][]
@@ -161,22 +161,22 @@ if(3) dat += "Security Record
" if(istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)) - if(istype(active1.fields["photo_front"], /obj/item/photo)) - var/obj/item/photo/P1 = active1.fields["photo_front"] + if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) + var/obj/item/photo/P1 = active1.fields[DATACORE_PHOTO] user << browse_rsc(P1.picture.picture_image, "photo_front") - if(istype(active1.fields["photo_side"], /obj/item/photo)) - var/obj/item/photo/P2 = active1.fields["photo_side"] + if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) + var/obj/item/photo/P2 = active1.fields[DATACORE_PHOTO_SIDE] user << browse_rsc(P2.picture.picture_image, "photo_side") dat += {""} - for(var/datum/data/crime/c in current.fields["crim"]) + for(var/datum/data/crime/c in current.fields[DATACORE_CRIMES]) dat += {" @@ -75,7 +75,7 @@ authenticated = scan.registered_name if(authenticated) for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - if(R.fields["name"] == authenticated) + if(R.fields[DATACORE_NAME] == authenticated) current = R playsound(src, 'sound/machines/terminal_on.ogg', 50, FALSE) if("Logout") diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 1f11105a1526..d2e892defaf4 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -329,14 +329,14 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/cryopod/retro, 17) // Delete them from datacore. var/announce_rank = null for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - if((R.fields["name"] == mob_occupant.real_name)) + if((R.fields[DATACORE_NAME] == mob_occupant.real_name)) qdel(R) for(var/datum/data/record/T in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - if((T.fields["name"] == mob_occupant.real_name)) + if((T.fields[DATACORE_NAME] == mob_occupant.real_name)) qdel(T) for(var/datum/data/record/G in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - if((G.fields["name"] == mob_occupant.real_name)) - announce_rank = G.fields["rank"] + if((G.fields[DATACORE_NAME] == mob_occupant.real_name)) + announce_rank = G.fields[DATACORE_RANK] qdel(G) var/datum/overmap/ship/controlled/original_ship = mob_occupant.mind.original_ship.resolve() diff --git a/code/game/machinery/gulag_teleporter.dm b/code/game/machinery/gulag_teleporter.dm index e147e24717ca..cfce814d8da5 100644 --- a/code/game/machinery/gulag_teleporter.dm +++ b/code/game/machinery/gulag_teleporter.dm @@ -157,7 +157,7 @@ The console is located at computer/gulag_teleporter.dm if(id) prisoner.equip_to_appropriate_slot(id) if(R) - R.fields["criminal"] = "Incarcerated" + R.fields[DATACORE_CRIMINAL_STATUS] = "Incarcerated" /obj/item/circuitboard/machine/gulag_teleporter name = "labor camp teleporter (Machine Board)" diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index ccea34643e94..98e4e10d645e 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -560,7 +560,7 @@ DEFINE_BITFIELD(turret_flags, list( if(turret_flags & TURRET_FLAG_SHOOT_CRIMINALS) //if the turret can check the records, check if they are set to *Arrest* on records var/perpname = perp.get_face_name(perp.get_id_name()) var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(!R || (R.fields["criminal"] == "*Arrest*")) + if(!R || (R.fields[DATACORE_CRIMINAL_STATUS] == "*Arrest*")) threatcount += 4 if((turret_flags & TURRET_FLAG_SHOOT_UNSHIELDED) && (!HAS_TRAIT(perp, TRAIT_MINDSHIELD))) diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm index 92706b5f1146..eae72d73bd71 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -106,7 +106,7 @@ var/mob/living/carbon/human/H = M var/perpname = H.get_face_name(H.get_id_name()) var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(!R || (R.fields["criminal"] == "*Arrest*")) + if(!R || (R.fields[DATACORE_CRIMINAL_STATUS] == "*Arrest*")) beep = TRUE if(SCANGATE_MINDSHIELD) if(HAS_TRAIT(M, TRAIT_MINDSHIELD)) diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index c12f8bced9f1..30e5a9d11e2e 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -317,19 +317,19 @@ Code: menu = "

[PDAIMG(medical)] Medical Record List

" if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) for(var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - menu += "[PDAIMG(medical)] [R.fields["id"]]: [R.fields["name"]]
" + menu += "[PDAIMG(medical)] [R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
" menu += "
" if(441) menu = "

[PDAIMG(medical)] Medical Record

" if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
" - menu += "Gender: [active1.fields["gender"]]
" - menu += "Age: [active1.fields["age"]]
" - menu += "Rank: [active1.fields["rank"]]
" - menu += "Fingerprint: [active1.fields["fingerprint"]]
" - menu += "Physical Status: [active1.fields["p_stat"]]
" - menu += "Mental Status: [active1.fields["m_stat"]]
" + menu += "Name: [active1.fields[DATACORE_NAME]] ID: [active1.fields[DATACORE_ID]]
" + menu += "Gender: [active1.fields[DATACORE_GENDER]]
" + menu += "Age: [active1.fields[DATACORE_AGE]]
" + menu += "Rank: [active1.fields[DATACORE_RANK]]
" + menu += "Fingerprint: [active1.fields[DATACORE_FINGERPRINT]]
" + menu += "Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]]
" + menu += "Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]]
" else menu += "Record Lost!
" @@ -337,21 +337,21 @@ Code: menu += "

[PDAIMG(medical)] Medical Data

" if(active2 in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - menu += "Blood Type: [active2.fields["blood_type"]]

" + menu += "Blood Type: [active2.fields[DATACORE_BLOOD_TYPE]]

" menu += "Minor Disabilities: [active2.fields["mi_dis"]]
" menu += "Details: [active2.fields["mi_dis_d"]]

" - menu += "Major Disabilities: [active2.fields["ma_dis"]]
" - menu += "Details: [active2.fields["ma_dis_d"]]

" + menu += "Major Disabilities: [active2.fields[DATACORE_DISABILITIES]]
" + menu += "Details: [active2.fields[DATACORE_DISABILITIES_DETAILS]]

" menu += "Allergies: [active2.fields["alg"]]
" menu += "Details: [active2.fields["alg_d"]]

" - menu += "Current Diseases: [active2.fields["cdi"]]
" - menu += "Details: [active2.fields["cdi_d"]]

" + menu += "Current Diseases: [active2.fields[DATACORE_DISEASES]]
" + menu += "Details: [active2.fields[DATACORE_DISEASES_DETAILS]]

" - menu += "Important Notes: [active2.fields["notes"]]
" + menu += "Important Notes: [active2.fields[DATACORE_NOTES]]
" else menu += "Record Lost!
" @@ -360,20 +360,20 @@ Code: menu = "

[PDAIMG(cuffs)] Security Record List

" if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) for (var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - menu += "[PDAIMG(cuffs)] [R.fields["id"]]: [R.fields["name"]]
" + menu += "[PDAIMG(cuffs)] [R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
" menu += "
" if(451) menu = "

[PDAIMG(cuffs)] Security Record

" if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
" - menu += "Gender: [active1.fields["gender"]]
" - menu += "Age: [active1.fields["age"]]
" - menu += "Rank: [active1.fields["rank"]]
" - menu += "Fingerprint: [active1.fields["fingerprint"]]
" - menu += "Physical Status: [active1.fields["p_stat"]]
" - menu += "Mental Status: [active1.fields["m_stat"]]
" + menu += "Name: [active1.fields[DATACORE_NAME]] ID: [active1.fields[DATACORE_ID]]
" + menu += "Gender: [active1.fields[DATACORE_GENDER]]
" + menu += "Age: [active1.fields[DATACORE_AGE]]
" + menu += "Rank: [active1.fields[DATACORE_RANK]]
" + menu += "Fingerprint: [active1.fields[DATACORE_FINGERPRINT]]
" + menu += "Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]]
" + menu += "Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]]
" else menu += "Record Lost!
" @@ -381,7 +381,7 @@ Code: menu += "

[PDAIMG(cuffs)] Security Data

" if(active3 in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - menu += "Criminal Status: [active3.fields["criminal"]]
" + menu += "Criminal Status: [active3.fields[DATACORE_CRIMINAL_STATUS]]
" menu += text("
\nCrimes:") @@ -392,7 +392,7 @@ Code: "} - for(var/datum/data/crime/c in active3.fields["crim"]) + for(var/datum/data/crime/c in active3.fields[DATACORE_CRIMES]) menu += "" menu += "" menu += "" @@ -400,7 +400,7 @@ Code: menu += "" menu += "
- - - - "} - dat += "" - dat += {" - - - + + + + "} + dat += "" + dat += {" + + +
Name: [active1.fields["name"]] 
ID: [active1.fields["id"]] 
Gender: [active1.fields["gender"]] 
Age: [active1.fields["age"]] 
Species: [active1.fields["species"]] 
Rank: [active1.fields["rank"]] 
Fingerprint: [active1.fields["fingerprint"]] 
Physical Status: [active1.fields["p_stat"]] 
Mental Status: [active1.fields["m_stat"]] 
Name: [active1.fields[DATACORE_NAME]] 
ID: [active1.fields[DATACORE_ID]] 
Gender: [active1.fields[DATACORE_GENDER]] 
Age: [active1.fields[DATACORE_AGE]] 
Species: [active1.fields[DATACORE_SPECIES]] 
Rank: [active1.fields[DATACORE_RANK]] 
Fingerprint: [active1.fields[DATACORE_FINGERPRINT]] 
Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]] 
Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]] 
"} - for(var/datum/data/crime/c in active2.fields["crim"]) + for(var/datum/data/crime/c in active2.fields[DATACORE_CRIMES]) dat += "" if(!c.crimeDetails) dat += "" @@ -213,7 +213,7 @@ dat += "" dat += "

Print photo
@@ -189,7 +189,7 @@ dat += "
General Record Lost!
" if((istype(active2, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active2))) dat += "Security Data" - dat += "
Criminal Status: [active2.fields["criminal"]]" + dat += "
Criminal Status: [active2.fields[DATACORE_CRIMINAL_STATUS]]" dat += "

Crimes: Add New" @@ -201,7 +201,7 @@
Time Added Del
[c.crimeName]\[+\]
" - dat += "
\nImportant Notes:
\n\t [active2.fields["notes"]] " + dat += "
\nImportant Notes:
\n\t [active2.fields[DATACORE_NOTES]] " dat += "

Comments/Log
" var/counter = 1 while(active2.fields[text("com_[]", counter)]) @@ -317,7 +317,7 @@ What a mess.*/ else active1 = active2 = R for(var/datum/data/record/E in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) + if((E.fields[DATACORE_NAME] == R.fields[DATACORE_NAME] || E.fields[DATACORE_ID] == R.fields[DATACORE_ID])) active2 = E screen = 3 @@ -330,13 +330,13 @@ What a mess.*/ var/obj/item/paper/printed_paper = new /obj/item/paper(loc) var/final_paper_text = "
Security Record - (SR-[SSdatacore.securityPrintCount])

" if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1))) - final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active1.fields["name"], active1.fields["id"], active1.fields["gender"], active1.fields["age"]) - final_paper_text += "\nSpecies: [active1.fields["species"]]
" - final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"]) + final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active1.fields[DATACORE_NAME], active1.fields[DATACORE_ID], active1.fields[DATACORE_GENDER], active1.fields[DATACORE_AGE]) + final_paper_text += "\nSpecies: [active1.fields[DATACORE_SPECIES]]
" + final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields[DATACORE_FINGERPRINT], active1.fields[DATACORE_PHYSICAL_HEALTH], active1.fields[DATACORE_MENTAL_HEALTH]) else final_paper_text += "General Record Lost!
" if((istype(active2, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active2))) - final_paper_text += text("
\n
Security Data

\nCriminal Status: []", active2.fields["criminal"]) + final_paper_text += text("
\n
Security Data

\nCriminal Status: []", active2.fields[DATACORE_CRIMINAL_STATUS]) final_paper_text += "
\n
\nCrimes:
\n" final_paper_text +={" @@ -346,7 +346,7 @@ What a mess.*/ "} - for(var/datum/data/crime/c in active2.fields["crim"]) + for(var/datum/data/crime/c in active2.fields[DATACORE_CRIMES]) final_paper_text += "" final_paper_text += "" final_paper_text += "" @@ -354,12 +354,12 @@ What a mess.*/ final_paper_text += "" final_paper_text += "
Author Time Added
[c.crimeName][c.crimeDetails][c.author]
" - final_paper_text += text("
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", active2.fields["notes"]) + final_paper_text += text("
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", active2.fields[DATACORE_NOTES]) var/counter = 1 while(active2.fields[text("com_[]", counter)]) final_paper_text += text("[]
", active2.fields[text("com_[]", counter)]) counter++ - printed_paper.name = text("SR-[] '[]'", SSdatacore.securityPrintCount, active1.fields["name"]) + printed_paper.name = text("SR-[] '[]'", SSdatacore.securityPrintCount, active1.fields[DATACORE_NAME]) else final_paper_text += "Security Record Lost!
" printed_paper.name = text("SR-[] '[]'", SSdatacore.securityPrintCount, "Record Lost") @@ -369,13 +369,13 @@ What a mess.*/ printing = null if("Print Poster") if(!(printing)) - var/wanted_name = stripped_input(usr, "Please enter an alias for the criminal:", "Print Wanted Poster", active1.fields["name"]) + var/wanted_name = stripped_input(usr, "Please enter an alias for the criminal:", "Print Wanted Poster", active1.fields[DATACORE_NAME]) if(wanted_name) var/default_description = "A poster declaring [wanted_name] to be a dangerous individual, wanted by Nanotrasen. Report any sightings to security immediately." - var/list/crimes = active2.fields["crim"] + var/list/crimes = active2.fields[DATACORE_CRIMES] if(crimes.len) default_description += "\n[wanted_name] is wanted for the following crimes:\n" - for(var/datum/data/crime/c in active2.fields["crim"]) + for(var/datum/data/crime/c in active2.fields[DATACORE_CRIMES]) default_description += "\n[c.crimeName]\n" default_description += "[c.crimeDetails]\n" @@ -387,12 +387,12 @@ What a mess.*/ printing = 1 sleep(30) if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)))//make sure the record still exists. - var/obj/item/photo/photo = active1.fields["photo_front"] + var/obj/item/photo/photo = active1.fields[DATACORE_PHOTO] new /obj/item/poster/wanted(loc, photo.picture.picture_image, wanted_name, info, headerText) printing = 0 if("Print Missing") if(!(printing)) - var/missing_name = stripped_input(usr, "Please enter an alias for the missing person:", "Print Missing Persons Poster", active1.fields["name"]) + var/missing_name = stripped_input(usr, "Please enter an alias for the missing person:", "Print Missing Persons Poster", active1.fields[DATACORE_NAME]) if(missing_name) var/default_description = "A poster declaring [missing_name] to be a missing individual, missed by Nanotrasen. Report any sightings to security immediately." @@ -404,7 +404,7 @@ What a mess.*/ printing = 1 sleep(30) if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)))//make sure the record still exists. - var/obj/item/photo/photo = active1.fields["photo_front"] + var/obj/item/photo/photo = active1.fields[DATACORE_PHOTO] new /obj/item/poster/wanted/missing(loc, photo.picture.picture_image, missing_name, info, headerText) printing = 0 @@ -453,12 +453,12 @@ What a mess.*/ if("New Record (Security)") if((istype(active1, /datum/data/record) && !(istype(active2, /datum/data/record)))) var/datum/data/record/R = new /datum/data/record() - R.fields["name"] = active1.fields["name"] - R.fields["id"] = active1.fields["id"] - R.name = text("Security Record #[]", R.fields["id"]) - R.fields["criminal"] = "None" - R.fields["crim"] = list() - R.fields["notes"] = "No notes." + R.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] + R.fields[DATACORE_ID] = active1.fields[DATACORE_ID] + R.name = text("Security Record #[]", R.fields[DATACORE_ID]) + R.fields[DATACORE_CRIMINAL_STATUS] = "None" + R.fields[DATACORE_CRIMES] = list() + R.fields[DATACORE_NOTES] = "No notes." SSdatacore.inject_record(R, DATACORE_RECORDS_SECURITY) active2 = R screen = 3 @@ -466,46 +466,46 @@ What a mess.*/ if("New Record (General)") //General Record var/datum/data/record/G = new /datum/data/record() - G.fields["name"] = "New Record" - G.fields["id"] = "[num2hex(rand(1, 1.6777215E7), 6)]" - G.fields["rank"] = "Unassigned" - G.fields["gender"] = "Male" - G.fields["age"] = "Unknown" - G.fields["species"] = "Human" - G.fields["photo_front"] = new /icon() - G.fields["photo_side"] = new /icon() - G.fields["fingerprint"] = "?????" - G.fields["p_stat"] = "Active" - G.fields["m_stat"] = "Stable" + G.fields[DATACORE_NAME] = "New Record" + G.fields[DATACORE_ID] = "[num2hex(rand(1, 1.6777215E7), 6)]" + G.fields[DATACORE_RANK] = "Unassigned" + G.fields[DATACORE_GENDER] = "Male" + G.fields[DATACORE_AGE] = "Unknown" + G.fields[DATACORE_SPECIES] = "Human" + G.fields[DATACORE_PHOTO] = new /icon() + G.fields[DATACORE_PHOTO_SIDE] = new /icon() + G.fields[DATACORE_FINGERPRINT] = "?????" + G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" + G.fields[DATACORE_MENTAL_HEALTH] = "Stable" SSdatacore.inject_record(G, DATACORE_RECORDS_OUTPOST) active1 = G //Security Record var/datum/data/record/R = new /datum/data/record() - R.fields["name"] = active1.fields["name"] - R.fields["id"] = active1.fields["id"] - R.name = text("Security Record #[]", R.fields["id"]) - R.fields["criminal"] = "None" - R.fields["crim"] = list() - R.fields["notes"] = "No notes." + R.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] + R.fields[DATACORE_ID] = active1.fields[DATACORE_ID] + R.name = text("Security Record #[]", R.fields[DATACORE_ID]) + R.fields[DATACORE_CRIMINAL_STATUS] = "None" + R.fields[DATACORE_CRIMES] = list() + R.fields[DATACORE_NOTES] = "No notes." SSdatacore.inject_record(R, DATACORE_RECORDS_SECURITY) active2 = R //Medical Record var/datum/data/record/M = new /datum/data/record() - M.fields["id"] = active1.fields["id"] - M.fields["name"] = active1.fields["name"] - M.fields["blood_type"] = "?" - M.fields["b_dna"] = "?????" + M.fields[DATACORE_ID] = active1.fields[DATACORE_ID] + M.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] + M.fields[DATACORE_BLOOD_TYPE] = "?" + M.fields[DATACORE_BLOOD_DNA] = "?????" M.fields["mi_dis"] = "None" M.fields["mi_dis_d"] = "No minor disabilities have been declared." - M.fields["ma_dis"] = "None" - M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." + M.fields[DATACORE_DISABILITIES] = "None" + M.fields[DATACORE_DISABILITIES_DETAILS] = "No major disabilities have been diagnosed." M.fields["alg"] = "None" M.fields["alg_d"] = "No allergies have been detected in this patient." - M.fields["cdi"] = "None" - M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - M.fields["notes"] = "No notes." + M.fields[DATACORE_DISEASES] = "None" + M.fields[DATACORE_DISEASES_DETAILS] = "No diseases have been diagnosed at the moment." + M.fields[DATACORE_NOTES] = "No notes." SSdatacore.inject_record(M, DATACORE_RECORDS_MEDICAL) @@ -518,61 +518,61 @@ What a mess.*/ switch(href_list["field"]) if("name") if(istype(active1, /datum/data/record) || istype(active2, /datum/data/record)) - var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active1.fields["name"], MAX_MESSAGE_LEN) + var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active1.fields[DATACORE_NAME], MAX_MESSAGE_LEN) if(!canUseSecurityRecordsConsole(usr, t1, a1)) return if(istype(active1, /datum/data/record)) - active1.fields["name"] = t1 + active1.fields[DATACORE_NAME] = t1 if(istype(active2, /datum/data/record)) - active2.fields["name"] = t1 + active2.fields[DATACORE_NAME] = t1 if("id") if(istype(active2, /datum/data/record) || istype(active1, /datum/data/record)) - var/t1 = stripped_input(usr, "Please input id:", "Secure. records", active1.fields["id"], null) + var/t1 = stripped_input(usr, "Please input id:", "Secure. records", active1.fields[DATACORE_ID], null) if(!canUseSecurityRecordsConsole(usr, t1, a1)) return if(istype(active1, /datum/data/record)) - active1.fields["id"] = t1 + active1.fields[DATACORE_ID] = t1 if(istype(active2, /datum/data/record)) - active2.fields["id"] = t1 + active2.fields[DATACORE_ID] = t1 if("fingerprint") if(istype(active1, /datum/data/record)) - var/t1 = stripped_input(usr, "Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) + var/t1 = stripped_input(usr, "Please input fingerprint hash:", "Secure. records", active1.fields[DATACORE_FINGERPRINT], null) if(!canUseSecurityRecordsConsole(usr, t1, a1)) return - active1.fields["fingerprint"] = t1 + active1.fields[DATACORE_FINGERPRINT] = t1 if("gender") if(istype(active1, /datum/data/record)) - if(active1.fields["gender"] == "Male") - active1.fields["gender"] = "Female" - else if(active1.fields["gender"] == "Female") - active1.fields["gender"] = "Other" + if(active1.fields[DATACORE_GENDER] == "Male") + active1.fields[DATACORE_GENDER] = "Female" + else if(active1.fields[DATACORE_GENDER] == "Female") + active1.fields[DATACORE_GENDER] = "Other" else - active1.fields["gender"] = "Male" + active1.fields[DATACORE_GENDER] = "Male" if("age") if(istype(active1, /datum/data/record)) - var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num|null + var/t1 = input("Please input age:", "Secure. records", active1.fields[DATACORE_AGE], null) as num|null if (!t1) return if(!canUseSecurityRecordsConsole(usr, "age", a1)) return - active1.fields["age"] = t1 + active1.fields[DATACORE_AGE] = t1 if("species") if(istype(active1, /datum/data/record)) var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_races if(!canUseSecurityRecordsConsole(usr, t1, a1)) return - active1.fields["species"] = t1 + active1.fields[DATACORE_SPECIES] = t1 if("show_photo_front") - if(active1.fields["photo_front"]) - if(istype(active1.fields["photo_front"], /obj/item/photo)) - var/obj/item/photo/P = active1.fields["photo_front"] + if(active1.fields[DATACORE_PHOTO]) + if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) + var/obj/item/photo/P = active1.fields[DATACORE_PHOTO] P.show(usr) if("upd_photo_front") var/obj/item/photo/photo = get_photo(usr) if(photo) - qdel(active1.fields["photo_front"]) + qdel(active1.fields[DATACORE_PHOTO]) //Lets center it to a 32x32. var/icon/I = photo.picture.picture_image var/w = I.Width() @@ -580,21 +580,21 @@ What a mess.*/ var/dw = w - 32 var/dh = w - 32 I.Crop(dw/2, dh/2, w - dw/2, h - dh/2) - active1.fields["photo_front"] = photo + active1.fields[DATACORE_PHOTO] = photo if("print_photo_front") - if(active1.fields["photo_front"]) - if(istype(active1.fields["photo_front"], /obj/item/photo)) - var/obj/item/photo/P = active1.fields["photo_front"] - print_photo(P.picture.picture_image, active1.fields["name"]) + if(active1.fields[DATACORE_PHOTO]) + if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) + var/obj/item/photo/P = active1.fields[DATACORE_PHOTO] + print_photo(P.picture.picture_image, active1.fields[DATACORE_NAME]) if("show_photo_side") - if(active1.fields["photo_side"]) - if(istype(active1.fields["photo_side"], /obj/item/photo)) - var/obj/item/photo/P = active1.fields["photo_side"] + if(active1.fields[DATACORE_PHOTO_SIDE]) + if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) + var/obj/item/photo/P = active1.fields[DATACORE_PHOTO_SIDE] P.show(usr) if("upd_photo_side") var/obj/item/photo/photo = get_photo(usr) if(photo) - qdel(active1.fields["photo_side"]) + qdel(active1.fields[DATACORE_PHOTO_SIDE]) //Lets center it to a 32x32. var/icon/I = photo.picture.picture_image var/w = I.Width() @@ -602,12 +602,12 @@ What a mess.*/ var/dw = w - 32 var/dh = w - 32 I.Crop(dw/2, dh/2, w - dw/2, h - dh/2) - active1.fields["photo_side"] = photo + active1.fields[DATACORE_PHOTO_SIDE] = photo if("print_photo_side") - if(active1.fields["photo_side"]) - if(istype(active1.fields["photo_side"], /obj/item/photo)) - var/obj/item/photo/P = active1.fields["photo_side"] - print_photo(P.picture.picture_image, active1.fields["name"]) + if(active1.fields[DATACORE_PHOTO_SIDE]) + if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) + var/obj/item/photo/P = active1.fields[DATACORE_PHOTO_SIDE] + print_photo(P.picture.picture_image, active1.fields[DATACORE_NAME]) if("crim_add") if(!istype(active1, /datum/data/record/security)) return @@ -619,7 +619,7 @@ What a mess.*/ var/datum/data/record/security/security_record = active1 var/crime = SSdatacore.new_crime_entry(t1, t2, authenticated, station_time_timestamp()) security_record.add_crime(crime) - investigate_log("New Crime: [t1]: [t2] | Added to [active1.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS) + investigate_log("New Crime: [t1]: [t2] | Added to [active1.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) if("crim_delete") if(!istype(active1, /datum/data/record/security) || !href_list["cdataid"]) return @@ -656,10 +656,10 @@ What a mess.*/ if("notes") if(istype(active2, /datum/data/record)) - var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active2.fields["notes"], null) + var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active2.fields[DATACORE_NOTES], null) if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) return - active2.fields["notes"] = t1 + active2.fields[DATACORE_NOTES] = t1 if("criminal") if(!istype(active1, /datum/data/record/security)) return @@ -689,39 +689,39 @@ What a mess.*/ switch(href_list["choice"]) if("Change Rank") if(active1) - active1.fields["rank"] = strip_html(href_list["rank"]) + active1.fields[DATACORE_RANK] = strip_html(href_list["rank"]) if(href_list["rank"] in get_all_jobs()) active1.fields["real_rank"] = href_list["real_rank"] if("Change Criminal Status") if(active2) - var/old_field = active2.fields["criminal"] + var/old_field = active2.fields[DATACORE_CRIMINAL_STATUS] switch(href_list["criminal2"]) if("none") - active2.fields["criminal"] = "None" + active2.fields[DATACORE_CRIMINAL_STATUS] = "None" if("arrest") - active2.fields["criminal"] = "*Arrest*" + active2.fields[DATACORE_CRIMINAL_STATUS] = "*Arrest*" if("incarcerated") - active2.fields["criminal"] = "Incarcerated" + active2.fields[DATACORE_CRIMINAL_STATUS] = "Incarcerated" if("paroled") - active2.fields["criminal"] = "Paroled" + active2.fields[DATACORE_CRIMINAL_STATUS] = "Paroled" if("released") - active2.fields["criminal"] = "Discharged" - investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [key_name(usr)].", INVESTIGATE_RECORDS) + active2.fields[DATACORE_CRIMINAL_STATUS] = "Discharged" + investigate_log("[active1.fields[DATACORE_NAME]] has been set from [old_field] to [active2.fields[DATACORE_CRIMINAL_STATUS]] by [key_name(usr)].", INVESTIGATE_RECORDS) for(var/i in GLOB.human_list) var/mob/living/carbon/human/H = i H.sec_hud_set_security_status() if("Delete Record (Security) Execute") - investigate_log("[key_name(usr)] has deleted the security records for [active1.fields["name"]].", INVESTIGATE_RECORDS) + investigate_log("[key_name(usr)] has deleted the security records for [active1.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) if(active2) qdel(active2) active2 = null if("Delete Record (ALL) Execute") if(active1) - investigate_log("[key_name(usr)] has deleted all records for [active1.fields["name"]].", INVESTIGATE_RECORDS) + investigate_log("[key_name(usr)] has deleted all records for [active1.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"])) + if((R.fields[DATACORE_NAME] == active1.fields[DATACORE_NAME] || R.fields[DATACORE_ID] == active1.fields[DATACORE_ID])) qdel(R) break qdel(active1) @@ -771,25 +771,25 @@ What a mess.*/ switch(rand(1,8)) if(1) if(prob(10)) - R.fields["name"] = "[pick(lizard_name(MALE),lizard_name(FEMALE))]" + R.fields[DATACORE_NAME] = "[pick(lizard_name(MALE),lizard_name(FEMALE))]" else - R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" + R.fields[DATACORE_NAME] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" if(2) - R.fields["gender"] = pick("Male", "Female", "Other") + R.fields[DATACORE_GENDER] = pick("Male", "Female", "Other") if(3) - R.fields["age"] = rand(5, 85) + R.fields[DATACORE_AGE] = rand(5, 85) if(4) - R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged") + R.fields[DATACORE_CRIMINAL_STATUS] = pick("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged") if(5) - R.fields["p_stat"] = pick("*Unconscious*", "Active", "Physically Unfit") + R.fields[DATACORE_PHYSICAL_HEALTH] = pick("*Unconscious*", "Active", "Physically Unfit") if(6) - R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") + R.fields[DATACORE_MENTAL_HEALTH] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") if(7) - R.fields["species"] = pick(GLOB.roundstart_races) + R.fields[DATACORE_SPECIES] = pick(GLOB.roundstart_races) if(8) var/datum/data/record/G = pick(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - R.fields["photo_front"] = G.fields["photo_front"] - R.fields["photo_side"] = G.fields["photo_side"] + R.fields[DATACORE_PHOTO] = G.fields[DATACORE_PHOTO] + R.fields[DATACORE_PHOTO_SIDE] = G.fields[DATACORE_PHOTO_SIDE] continue else if(prob(1)) diff --git a/code/game/machinery/computer/warrant.dm b/code/game/machinery/computer/warrant.dm index 50fe4ac62e56..85c97ed67bc3 100644 --- a/code/game/machinery/computer/warrant.dm +++ b/code/game/machinery/computer/warrant.dm @@ -17,7 +17,7 @@ if(current) var/background var/notice = "" - switch(current.fields["criminal"]) + switch(current.fields[DATACORE_CRIMINAL_STATUS]) if("*Arrest*") background = "background-color:#990000;" notice = "
**REPORT TO THE BRIG**" @@ -33,12 +33,12 @@ background = "''" //"'background-color:#FFFFFF;'" dat += "Warrant Data" dat += {" - - + +
Name: [current.fields["name"]] 
ID: [current.fields["id"]] 
Name: [current.fields[DATACORE_NAME]] 
ID: [current.fields[DATACORE_ID]] 
"} dat += {"Criminal Status:
- [current.fields["criminal"]][notice] + [current.fields[DATACORE_CRIMINAL_STATUS]][notice]
"} dat += "
Crimes:" @@ -49,7 +49,7 @@
Author Time Added
[c.crimeName] [c.crimeDetails] [c.author]Author Time Added
[c.crimeName][c.crimeDetails][c.author]
" menu += "
\nImportant Notes:
" - menu += "[active3.fields["notes"]]" + menu += "[active3.fields[DATACORE_NOTES]]" else menu += "Record Lost!
" diff --git a/code/modules/antagonists/traitor/syndicate_contract.dm b/code/modules/antagonists/traitor/syndicate_contract.dm index 53b8ebaafff2..944b653e464c 100644 --- a/code/modules/antagonists/traitor/syndicate_contract.dm +++ b/code/modules/antagonists/traitor/syndicate_contract.dm @@ -23,7 +23,7 @@ record = SSdatacore.get_record_by_name(contract.target.name, DATACORE_RECORDS_OUTPOST) if (record) - target_rank = record.fields["rank"] + target_rank = record.fields[DATACORE_RANK] else target_rank = "Unknown" diff --git a/code/modules/datacore/library.dm b/code/modules/datacore/library.dm index f375b99d9844..b2f5d0280249 100644 --- a/code/modules/datacore/library.dm +++ b/code/modules/datacore/library.dm @@ -13,9 +13,9 @@ if(!istype(new_record)) CRASH("You fucked it this time!!!") - if(!new_record.fields["name"]) + if(!new_record.fields[DATACORE_NAME]) CRASH("Cannot inject a record with no name!") records += new_record - records_by_name[new_record.fields["name"]] = new_record + records_by_name[new_record.fields[DATACORE_NAME]] = new_record new_record.library = src diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 0fed01bdfcdd..543f7b9f87d2 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -349,7 +349,7 @@ if(perpname && (HAS_TRAIT(user, TRAIT_SECURITY_HUD) || HAS_TRAIT(user, TRAIT_MEDICAL_HUD))) var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_OUTPOST) if(R) - . += "Rank: [R.fields["rank"]]\n\[Front photo\]\[Side photo\]" + . += "Rank: [R.fields[DATACORE_RANK]]\n\[Front photo\]\[Side photo\]" if(HAS_TRAIT(user, TRAIT_MEDICAL_HUD)) var/cyberimp_detect for(var/obj/item/organ/cyberimp/CI in internal_organs) @@ -359,9 +359,9 @@ . += "Detected cybernetic modifications:" . += "[cyberimp_detect]" if(R) - var/health_r = R.fields["p_stat"] + var/health_r = R.fields[DATACORE_PHYSICAL_HEALTH] . += "\[[health_r]\]" - health_r = R.fields["m_stat"] + health_r = R.fields[DATACORE_MENTAL_HEALTH] . += "\[[health_r]\]" R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_MEDICAL) if(R) @@ -377,7 +377,7 @@ R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) if(R) - criminal = R.fields["criminal"] + criminal = R.fields[DATACORE_CRIMINAL_STATUS] . += "Criminal status: \[[criminal]\]" . += jointext(list("Security record: \[View\]", diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c90ed649d8f0..7a18cb1b5740 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -293,9 +293,9 @@ return var/obj/item/photo/P = null if(href_list["photo_front"]) - P = R.fields["photo_front"] + P = R.fields[DATACORE_PHOTO] else if(href_list["photo_side"]) - P = R.fields["photo_side"] + P = R.fields[DATACORE_PHOTO_SIDE] if(P) P.show(H) return @@ -351,7 +351,7 @@ to_chat(H, "ERROR: Invalid access") return if(href_list["p_stat"]) - var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") + var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields[DATACORE_PHYSICAL_HEALTH]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") if(!R) return if(!H.canUseHUD()) @@ -359,10 +359,10 @@ if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return if(health_status && health_status != "Cancel") - R.fields["p_stat"] = health_status + R.fields[DATACORE_PHYSICAL_HEALTH] = health_status return if(href_list["m_stat"]) - var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields["m_stat"]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") + var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields[DATACORE_MENTAL_HEALTH]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") if(!R) return if(!H.canUseHUD()) @@ -370,7 +370,7 @@ if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return if(health_status && health_status != "Cancel") - R.fields["m_stat"] = health_status + R.fields[DATACORE_MENTAL_HEALTH] = health_status return return //Medical HUD ends here. @@ -404,7 +404,7 @@ to_chat(usr, "ERROR: Unable to locate data core entry for target.") return if(href_list["status"]) - var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", security_record.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel") + var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", security_record.fields[DATACORE_CRIMINAL_STATUS]) in list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel") if(setcriminal != "Cancel") if(!R) return @@ -412,8 +412,8 @@ return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return - investigate_log("[key_name(src)] has been set from [security_record.fields["criminal"]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) - security_record.fields["criminal"] = setcriminal + investigate_log("[key_name(src)] has been set from [security_record.fields[DATACORE_CRIMINAL_STATUS]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) + security_record.fields[DATACORE_CRIMINAL_STATUS] = setcriminal sec_hud_set_security_status() return @@ -422,8 +422,8 @@ return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return - to_chat(usr, "Name: [security_record.fields["name"]] Criminal Status: [security_record.fields["criminal"]]") - for(var/datum/data/crime/c in security_record.fields["crim"]) + to_chat(usr, "Name: [security_record.fields[DATACORE_NAME]] Criminal Status: [security_record.fields[DATACORE_CRIMINAL_STATUS]]") + for(var/datum/data/crime/c in security_record.fields[DATACORE_CRIMES]) to_chat(usr, "Crime: [c.crimeName]") if (c.crimeDetails) to_chat(usr, "Details: [c.crimeDetails]") @@ -431,7 +431,7 @@ to_chat(usr, "Details: \[Add details]") to_chat(usr, "Added by [c.author] at [c.time]") to_chat(usr, "----------") - to_chat(usr, "Notes: [security_record.fields["notes"]]") + to_chat(usr, "Notes: [security_record.fields[DATACORE_NOTES]]") return if(href_list["add_crime"]) @@ -565,8 +565,8 @@ if(judgement_criteria & JUDGE_RECORDCHECK) var/perpname = get_face_name(get_id_name()) var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(R && R.fields["criminal"]) - switch(R.fields["criminal"]) + if(R && R.fields[DATACORE_CRIMINAL_STATUS]) + switch(R.fields[DATACORE_CRIMINAL_STATUS]) if("*Arrest*") threatcount += 5 if("Incarcerated") diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index cc27935925b2..5d4448af40aa 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -630,7 +630,7 @@ var/list/personnel_list = list() for(var/datum/data/record/t in SSdatacore.get_records(DATACORE_RECORDS_LOCKED))//Look in data core locked. - personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image. + personnel_list["[t.fields[DATACORE_NAME]]: [t.fields[DATACORE_RANK]]"] = t.fields[DATACORE_IMAGE]//Pull names, rank, and image. if(personnel_list.len) input = input("Select a crew member:") as null|anything in sortList(personnel_list) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 00e1b1564284..de9f36f00613 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -532,7 +532,7 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( . += "

Crew Manifest



" if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) for(var/datum/data/record/t in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - . += "[t.fields["name"]] - [t.fields["rank"]]
" + . += "[t.fields[DATACORE_NAME]] - [t.fields[DATACORE_RANK]]
" . += "" return . @@ -543,15 +543,15 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( . += "

Medical Records


" if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) for(var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - . += "[R.fields["id"]]: [R.fields["name"]]
" + . += "
[R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
" if(1) . += "
Medical Record

" if(medicalActive1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - . += "Name: [medicalActive1.fields["name"]] ID: [medicalActive1.fields["id"]]
\nGender: [medicalActive1.fields["gender"]]
\nAge: [medicalActive1.fields["age"]]
\nFingerprint: [medicalActive1.fields["fingerprint"]]
\nPhysical Status: [medicalActive1.fields["p_stat"]]
\nMental Status: [medicalActive1.fields["m_stat"]]
" + . += "Name: [medicalActive1.fields[DATACORE_NAME]] ID: [medicalActive1.fields[DATACORE_ID]]
\nGender: [medicalActive1.fields[DATACORE_GENDER]]
\nAge: [medicalActive1.fields[DATACORE_AGE]]
\nFingerprint: [medicalActive1.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [medicalActive1.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [medicalActive1.fields[DATACORE_MENTAL_HEALTH]]
" else . += "
Requested medical record not found.

" if(medicalActive2 in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - . += "
\n
Medical Data

\nBlood Type:
[medicalActive2.fields["blood_type"]]
\nDNA (UE): [medicalActive2.fields["b_dna"]]
\n
\nMinor Disabilities: [medicalActive2.fields["mi_dis"]]
\nDetails: [medicalActive2.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [medicalActive2.fields["ma_dis"]]
\nDetails: [medicalActive2.fields["ma_dis_d"]]
\n
\nAllergies: [medicalActive2.fields["alg"]]
\nDetails: [medicalActive2.fields["alg_d"]]
\n
\nCurrent Diseases: [medicalActive2.fields["cdi"]] (per disease info placed in log/comment section)
\nDetails: [medicalActive2.fields["cdi_d"]]
\n
\nImportant Notes:
\n\t[medicalActive2.fields["notes"]]
\n
\n
Comments/Log

" + . += "
\n
Medical Data

\nBlood Type: [medicalActive2.fields[DATACORE_BLOOD_TYPE]]
\nDNA (UE): [medicalActive2.fields[DATACORE_BLOOD_DNA]]
\n
\nMinor Disabilities: [medicalActive2.fields["mi_dis"]]
\nDetails: [medicalActive2.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [medicalActive2.fields[DATACORE_DISABILITIES]]
\nDetails: [medicalActive2.fields[DATACORE_DISABILITIES_DETAILS]]
\n
\nAllergies: [medicalActive2.fields["alg"]]
\nDetails: [medicalActive2.fields["alg_d"]]
\n
\nCurrent Diseases: [medicalActive2.fields[DATACORE_DISEASES]] (per disease info placed in log/comment section)
\nDetails: [medicalActive2.fields[DATACORE_DISEASES_DETAILS]]
\n
\nImportant Notes:
\n\t[medicalActive2.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" else . += "
Requested medical record not found.

" . += "
\nBack
" @@ -565,15 +565,15 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( . += "

Security Records


" if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) for(var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - . += "[R.fields["id"]]: [R.fields["name"]]
" + . += "
[R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
" if(1) . += "

Security Record

" if(securityActive1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - . += "Name:
[securityActive1.fields["name"]] ID: [securityActive1.fields["id"]]
\nGender: [securityActive1.fields["gender"]]
\nAge: [securityActive1.fields["age"]]
\nRank: [securityActive1.fields["rank"]]
\nFingerprint: [securityActive1.fields["fingerprint"]]
\nPhysical Status: [securityActive1.fields["p_stat"]]
\nMental Status: [securityActive1.fields["m_stat"]]
" + . += "Name: [securityActive1.fields[DATACORE_NAME]] ID: [securityActive1.fields[DATACORE_ID]]
\nGender: [securityActive1.fields[DATACORE_GENDER]]
\nAge: [securityActive1.fields[DATACORE_AGE]]
\nRank: [securityActive1.fields[DATACORE_RANK]]
\nFingerprint: [securityActive1.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [securityActive1.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [securityActive1.fields[DATACORE_MENTAL_HEALTH]]
" else . += "
Requested security record not found,

" if(securityActive2 in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - . += "
\nSecurity Data
\nCriminal Status: [securityActive2.fields["criminal"]]
\n
\nCrimes: [securityActive2.fields["crim"]]
\nDetails: [securityActive2.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[securityActive2.fields["notes"]]
\n
\n
Comments/Log

" + . += "
\nSecurity Data
\nCriminal Status: [securityActive2.fields[DATACORE_CRIMINAL_STATUS]]
\n
\nCrimes: [securityActive2.fields[DATACORE_CRIMES]]
\nDetails: [securityActive2.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[securityActive2.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" else . += "
Requested security record not found,

" . += "
\nBack
" diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 1f5823095cc8..1aa86696b54c 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -131,20 +131,20 @@ /obj/structure/filingcabinet/security/proc/populate() if(virgin) for(var/datum/data/record/G in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - var/datum/data/record/S = SSdatacore.get_record_by_name(G.fields["name"], DATACORE_RECORDS_SECURITY) + var/datum/data/record/S = SSdatacore.get_record_by_name(G.fields[DATACORE_NAME], DATACORE_RECORDS_SECURITY) if(!S) continue var/obj/item/paper/sec_record_paper = new /obj/item/paper(src) var/sec_record_text = "
Security Record

" - sec_record_text += "Name: [G.fields["name"]] ID: [G.fields["id"]]
\nGender: [G.fields["gender"]]
\nAge: [G.fields["age"]]
\nFingerprint: [G.fields["fingerprint"]]
\nPhysical Status: [G.fields["p_stat"]]
\nMental Status: [G.fields["m_stat"]]
" - sec_record_text += "
\n
Security Data

\nCriminal Status: [S.fields["criminal"]]
\n
\nCrimes: [S.fields["crim"]]
\nDetails: [S.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[S.fields["notes"]]
\n
\n
Comments/Log

" + sec_record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" + sec_record_text += "
\n
Security Data

\nCriminal Status: [S.fields[DATACORE_CRIMINAL_STATUS]]
\n
\nCrimes: [S.fields[DATACORE_CRIMES]]
\nDetails: [S.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[S.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" var/counter = 1 while(S.fields["com_[counter]"]) sec_record_text += "[S.fields["com_[counter]"]]
" counter++ sec_record_text += "" sec_record_paper.add_raw_text(sec_record_text) - sec_record_paper.name = "paper - '[G.fields["name"]]'" + sec_record_paper.name = "paper - '[G.fields[DATACORE_NAME]]'" sec_record_paper.update_appearance() virgin = 0 //tabbing here is correct- it's possible for people to try and use it //before the records have been generated, so we do this inside the loop. @@ -166,20 +166,20 @@ /obj/structure/filingcabinet/medical/proc/populate() if(virgin) for(var/datum/data/record/G in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - var/datum/data/record/M = SSdatacore.get_record_by_name(G.fields["name"], DATACORE_RECORDS_MEDICAL) + var/datum/data/record/M = SSdatacore.get_record_by_name(G.fields[DATACORE_NAME], DATACORE_RECORDS_MEDICAL) if(!M) continue var/obj/item/paper/med_record_paper = new /obj/item/paper(src) var/med_record_text = "
Medical Record

" - med_record_text += "Name: [G.fields["name"]] ID: [G.fields["id"]]
\nGender: [G.fields["gender"]]
\nAge: [G.fields["age"]]
\nFingerprint: [G.fields["fingerprint"]]
\nPhysical Status: [G.fields["p_stat"]]
\nMental Status: [G.fields["m_stat"]]
" - med_record_text += "
\n
Medical Data

\nBlood Type: [M.fields["blood_type"]]
\nDNA: [M.fields["b_dna"]]
\n
\nMinor Disabilities: [M.fields["mi_dis"]]
\nDetails: [M.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [M.fields["ma_dis"]]
\nDetails: [M.fields["ma_dis_d"]]
\n
\nAllergies: [M.fields["alg"]]
\nDetails: [M.fields["alg_d"]]
\n
\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)
\nDetails: [M.fields["cdi_d"]]
\n
\nImportant Notes:
\n\t[M.fields["notes"]]
\n
\n
Comments/Log

" + med_record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" + med_record_text += "
\n
Medical Data

\nBlood Type: [M.fields[DATACORE_BLOOD_TYPE]]
\nDNA: [M.fields[DATACORE_BLOOD_DNA]]
\n
\nMinor Disabilities: [M.fields["mi_dis"]]
\nDetails: [M.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [M.fields[DATACORE_DISABILITIES]]
\nDetails: [M.fields[DATACORE_DISABILITIES_DETAILS]]
\n
\nAllergies: [M.fields["alg"]]
\nDetails: [M.fields["alg_d"]]
\n
\nCurrent Diseases: [M.fields[DATACORE_DISEASES]] (per disease info placed in log/comment section)
\nDetails: [M.fields[DATACORE_DISEASES_DETAILS]]
\n
\nImportant Notes:
\n\t[M.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" var/counter = 1 while(M.fields["com_[counter]"]) med_record_text += "[M.fields["com_[counter]"]]
" counter++ med_record_text += "" med_record_paper.add_raw_text(med_record_text) - med_record_paper.name = "paper - '[G.fields["name"]]'" + med_record_paper.name = "paper - '[G.fields[DATACORE_NAME]]'" med_record_paper.update_appearance() virgin = 0 //tabbing here is correct- it's possible for people to try and use it //before the records have been generated, so we do this inside the loop. @@ -218,7 +218,7 @@ GLOBAL_LIST_EMPTY(employmentCabinets) var/datum/data/record/G = record if(!G) continue - var/datum/mind/M = G.fields["mindref"] + var/datum/mind/M = G.fields[DATACORE_MINDREF] if(M && ishuman(M.current)) addFile(M.current) From 28cf978accb03e13fdac75a149a7148deb0812e5 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 06:16:11 -0500 Subject: [PATCH 07/47] copy pasted for testing, will make better in a bit --- code/__DEFINES/misc.dm | 1 - code/controllers/subsystem/datacore.dm | 61 +++++++++++++++++++ code/game/machinery/cryopod.dm | 13 +--- .../modules/mob/dead/new_player/new_player.dm | 2 +- .../overmap/ships/controlled_ship_datum.dm | 6 ++ 5 files changed, 70 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index d47980b59c6b..ad5481fe9ea4 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -332,7 +332,6 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE //Dummy mob reserve slots #define DUMMY_HUMAN_SLOT_PREFERENCES "dummy_preference_preview" #define DUMMY_HUMAN_SLOT_ADMIN "admintools" -#define DUMMY_HUMAN_SLOT_MANIFEST "dummy_manifest_generation" #define PR_ANNOUNCEMENTS_PER_ROUND 5 //The number of unique PR announcements allowed per round //This makes sure that a single person can only spam 3 reopens and 3 closes before being ignored diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index 4126efbbf05b..afbefd0ad454 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -35,6 +35,11 @@ SUBSYSTEM_DEF(datacore) medicalPrintCount = SSdatacore.medicalPrintCount finished_setup = SSdatacore.finished_setup +/datum/controller/subsystem/datacore/proc/create_library(library_key) + var/datum/data_library/new_library = new /datum/data_library + library[library_key] = new_library + return new_library + /// Returns a data record or null. /datum/controller/subsystem/datacore/proc/get_record_by_name(name, record_type = DATACORE_RECORDS_OUTPOST) RETURN_TYPE(/datum/data/record) @@ -288,6 +293,62 @@ SUBSYSTEM_DEF(datacore) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MANIFEST_INJECT, G, M, S, L) return +//For ship records +/datum/controller/subsystem/datacore/proc/inject_library(mob/living/carbon/human/H, client/C, datum/data_library/custom_library) + var/static/list/show_directions = list(SOUTH, WEST) + if(!(H.mind && (H.mind.assigned_role != H.mind.special_role))) + return + + var/assignment + if(H.mind.assigned_role) + assignment = H.mind.assigned_role + else if(H.job) + assignment = H.job + else + assignment = "Unassigned" + + var/static/record_id_num = 1001 + var/id = num2hex(record_id_num++,6) + if(!C) + C = H.client + + var/image = get_id_photo(H, C, show_directions) + var/datum/picture/pf = new + var/datum/picture/ps = new + pf.picture_name = "[H]" + ps.picture_name = "[H]" + pf.picture_desc = "This is [H]." + ps.picture_desc = "This is [H]." + pf.picture_image = icon(image, dir = SOUTH) + ps.picture_image = icon(image, dir = WEST) + var/obj/item/photo/photo_front = new(null, pf) + var/obj/item/photo/photo_side = new(null, ps) + + //General Record + var/datum/data/record/general/G = new() + G.fields[DATACORE_ID] = id + + G.fields[DATACORE_NAME] = H.real_name + G.fields[DATACORE_RANK] = assignment + G.fields[DATACORE_INITIAL_RANK] = assignment + G.fields[DATACORE_AGE] = H.age + G.fields[DATACORE_SPECIES] = H.dna.species.name + G.fields[DATACORE_FINGERPRINT] = md5(H.dna.uni_identity) + G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" + G.fields[DATACORE_MENTAL_HEALTH] = "Stable" + G.fields[DATACORE_GENDER] = H.gender + if(H.gender == "male") + G.fields[DATACORE_GENDER] = "Male" + else if(H.gender == "female") + G.fields[DATACORE_GENDER] = "Female" + else + G.fields[DATACORE_GENDER] = "Other" + //G.fields[DATACORE_APPEARANCE] = character_appearance + G.fields[DATACORE_PHOTO] = photo_front + G.fields[DATACORE_PHOTO_SIDE] = photo_side + + custom_library.inject_record(G) + /** * Supporing proc for getting general records * and using them as pAI ui data. This gets diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index d2e892defaf4..830352fe657e 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -327,17 +327,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/cryopod/retro, 17) mob_occupant.mind.special_role = null // Delete them from datacore. - var/announce_rank = null - for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - if((R.fields[DATACORE_NAME] == mob_occupant.real_name)) - qdel(R) - for(var/datum/data/record/T in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - if((T.fields[DATACORE_NAME] == mob_occupant.real_name)) - qdel(T) - for(var/datum/data/record/G in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - if((G.fields[DATACORE_NAME] == mob_occupant.real_name)) - announce_rank = G.fields[DATACORE_RANK] - qdel(G) + var/announce_rank = SSdatacore.get_record_by_name(mob_occupant.real_name, DATACORE_RECORDS_OUTPOST)?[DATACORE_RANK] + SSdatacore.demanifest(mob_occupant.real_name) var/datum/overmap/ship/controlled/original_ship = mob_occupant.mind.original_ship.resolve() original_ship.manifest -= mob_occupant.real_name diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index b1ad089f8307..ba7f5446c9e8 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -328,7 +328,7 @@ if(ishuman(character)) //These procs all expect humans var/mob/living/carbon/human/humanc = character ship.manifest_inject(humanc, client, job) - SSdatacore.manifest_inject(humanc) + //SSdatacore.manifest_inject(humanc) ship.add_mob_to_crew_guestbook(humanc) AnnounceArrival(humanc, job.name, ship) AddEmploymentContract(humanc) diff --git a/code/modules/overmap/ships/controlled_ship_datum.dm b/code/modules/overmap/ships/controlled_ship_datum.dm index b87d3efda187..cc23d3463321 100644 --- a/code/modules/overmap/ships/controlled_ship_datum.dm +++ b/code/modules/overmap/ships/controlled_ship_datum.dm @@ -70,6 +70,8 @@ ///Stations the ship has been blacklisted from landing at, associative station = reason var/list/blacklisted = list() + var/datum/data_library/ship_record + /datum/overmap/ship/controlled/Rename(new_name, force = FALSE) var/oldname = name if(!..() || (!COOLDOWN_FINISHED(src, rename_cooldown) && !force)) @@ -109,6 +111,7 @@ Dock(position, TRUE) refresh_engines() + ship_record = SSdatacore.create_library(src) ship_account = new(name, source_template.starting_funds) #ifdef UNIT_TESTS @@ -307,6 +310,9 @@ job_holder_refs[human_job] = list() job_holder_refs[human_job] += WEAKREF(H) + if(ship_record) + SSdatacore.inject_library(H, C, ship_record) + /** * adds a mob's real name to a crew's guestbooks * From f019ff336ff355cc4820c8c472e53fde3d2aff49 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 07:02:13 -0500 Subject: [PATCH 08/47] photo stuff --- code/__DEFINES/datacore.dm | 4 +- code/controllers/subsystem/datacore.dm | 38 ++-------- code/game/machinery/computer/medical.dm | 30 ++++---- code/game/machinery/computer/security.dm | 69 ++++++++++--------- .../traitor/equipment/contractor.dm | 4 -- code/modules/datacore/records.dm | 6 +- code/modules/mob/living/carbon/human/human.dm | 3 +- 7 files changed, 65 insertions(+), 89 deletions(-) diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm index 9099bef5c0a5..604c5848a0f8 100644 --- a/code/__DEFINES/datacore.dm +++ b/code/__DEFINES/datacore.dm @@ -4,9 +4,7 @@ #define DATACORE_GENDER "gender" #define DATACORE_SPECIES "species" #define DATACORE_FINGERPRINT "fingerprint" -//#define DATACORE_APPEARANCE "character_appearance" -#define DATACORE_PHOTO "photo_front" -#define DATACORE_PHOTO_SIDE "photo_side" +#define DATACORE_APPEARANCE "character_appearance" #define DATACORE_MINDREF "mind" #define DATACORE_DNA_IDENTITY "identity" #define DATACORE_DNA_FEATURES "features" diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index afbefd0ad454..c6ea4ca1de68 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -200,16 +200,7 @@ SUBSYSTEM_DEF(datacore) C = H.client var/image = get_id_photo(H, C, show_directions) - var/datum/picture/pf = new - var/datum/picture/ps = new - pf.picture_name = "[H]" - ps.picture_name = "[H]" - pf.picture_desc = "This is [H]." - ps.picture_desc = "This is [H]." - pf.picture_image = icon(image, dir = SOUTH) - ps.picture_image = icon(image, dir = WEST) - var/obj/item/photo/photo_front = new(null, pf) - var/obj/item/photo/photo_side = new(null, ps) + var/mutable_appearance/character_appearance = new(H.appearance) //General Record var/datum/data/record/general/G = new() @@ -230,9 +221,7 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_GENDER] = "Female" else G.fields[DATACORE_GENDER] = "Other" - //G.fields[DATACORE_APPEARANCE] = character_appearance - G.fields[DATACORE_PHOTO] = photo_front - G.fields[DATACORE_PHOTO_SIDE] = photo_side + G.fields[DATACORE_APPEARANCE] = character_appearance library[DATACORE_RECORDS_OUTPOST].inject_record(G) @@ -312,22 +301,11 @@ SUBSYSTEM_DEF(datacore) if(!C) C = H.client - var/image = get_id_photo(H, C, show_directions) - var/datum/picture/pf = new - var/datum/picture/ps = new - pf.picture_name = "[H]" - ps.picture_name = "[H]" - pf.picture_desc = "This is [H]." - ps.picture_desc = "This is [H]." - pf.picture_image = icon(image, dir = SOUTH) - ps.picture_image = icon(image, dir = WEST) - var/obj/item/photo/photo_front = new(null, pf) - var/obj/item/photo/photo_side = new(null, ps) + var/mutable_appearance/character_appearance = new(H.appearance) //General Record var/datum/data/record/general/G = new() G.fields[DATACORE_ID] = id - G.fields[DATACORE_NAME] = H.real_name G.fields[DATACORE_RANK] = assignment G.fields[DATACORE_INITIAL_RANK] = assignment @@ -343,9 +321,7 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_GENDER] = "Female" else G.fields[DATACORE_GENDER] = "Other" - //G.fields[DATACORE_APPEARANCE] = character_appearance - G.fields[DATACORE_PHOTO] = photo_front - G.fields[DATACORE_PHOTO_SIDE] = photo_side + G.fields[DATACORE_APPEARANCE] = character_appearance custom_library.inject_record(G) @@ -367,9 +343,9 @@ SUBSYSTEM_DEF(datacore) /// The object containing the crew info var/list/crew_record = list() crew_record["ref"] = REF(gen_record) - crew_record["name"] = gen_record.fields[DATACORE_NAME] - crew_record["physical_health"] = gen_record.fields[DATACORE_PHYSICAL_HEALTH] - crew_record["mental_health"] = gen_record.fields[DATACORE_MENTAL_HEALTH] + crew_record[DATACORE_NAME] = gen_record.fields[DATACORE_NAME] + crew_record[DATACORE_PHYSICAL_HEALTH] = gen_record.fields[DATACORE_PHYSICAL_HEALTH] + crew_record[DATACORE_MENTAL_HEALTH] = gen_record.fields[DATACORE_MENTAL_HEALTH] general_records_out += list(crew_record) return general_records_out diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 624010c1b19f..127bf30b6870 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -95,12 +95,14 @@ dat += "" if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) - var/obj/item/photo/P1 = active1.fields[DATACORE_PHOTO] - user << browse_rsc(P1.picture.picture_image, "photo_front") - if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) - var/obj/item/photo/P2 = active1.fields[DATACORE_PHOTO_SIDE] - user << browse_rsc(P2.picture.picture_image, "photo_side") + var/front_photo = active1.get_front_photo() + if(istype(front_photo, /obj/item/photo)) + var/obj/item/photo/photo_front = front_photo + user << browse_rsc(photo_front.picture.picture_image, "photo_front") + var/side_photo = active1.get_side_photo() + if(istype(side_photo, /obj/item/photo)) + var/obj/item/photo/photo_side = side_photo + user << browse_rsc(photo_side.picture.picture_image, "photo_side") dat += "" dat += "" dat += "" @@ -365,16 +367,16 @@ active2.fields[DATACORE_BLOOD_DNA] = t1 if("show_photo_front") if(active1) - if(active1.fields[DATACORE_PHOTO]) - if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) - var/obj/item/photo/P = active1.fields[DATACORE_PHOTO] - P.show(usr) + var/front_photo = active1.get_front_photo() + if(istype(front_photo, /obj/item/photo)) + var/obj/item/photo/photo = front_photo + photo.show(usr) if("show_photo_side") if(active1) - if(active1.fields[DATACORE_PHOTO_SIDE]) - if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) - var/obj/item/photo/P = active1.fields[DATACORE_PHOTO_SIDE] - P.show(usr) + var/side_photo = active1.get_side_photo() + if(istype(side_photo, /obj/item/photo)) + var/obj/item/photo/photo = side_photo + photo.show(usr) else else if(href_list["p_stat"]) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 0043b0439223..d9d27e7e49a9 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -161,12 +161,14 @@ if(3) dat += "Security Record
" if(istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)) - if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) - var/obj/item/photo/P1 = active1.fields[DATACORE_PHOTO] - user << browse_rsc(P1.picture.picture_image, "photo_front") - if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) - var/obj/item/photo/P2 = active1.fields[DATACORE_PHOTO_SIDE] - user << browse_rsc(P2.picture.picture_image, "photo_side") + var/front_photo = active1.get_front_photo() + if(istype(front_photo, /obj/item/photo)) + var/obj/item/photo/photo_front = front_photo + user << browse_rsc(photo_front.picture.picture_image, "photo_front") + var/side_photo = active1.get_side_photo() + if(istype(side_photo, /obj/item/photo)) + var/obj/item/photo/photo_side = side_photo + user << browse_rsc(photo_side.picture.picture_image, "photo_side") dat += {"
Medical Record
Name:[active1.fields[DATACORE_NAME]]
"} - for(var/datum/data/crime/c in active2.fields[DATACORE_CRIMES]) + for(var/datum/data/crime/c in active_record.fields[DATACORE_CRIMES]) dat += "" if(!c.crimeDetails) dat += "" @@ -205,12 +205,12 @@ dat += "" dat += "
@@ -387,7 +389,7 @@ What a mess.*/ printing = 1 sleep(30) if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)))//make sure the record still exists. - var/obj/item/photo/photo = active1.fields[DATACORE_PHOTO] + var/obj/item/photo/photo = active1.get_front_photo() new /obj/item/poster/wanted(loc, photo.picture.picture_image, wanted_name, info, headerText) printing = 0 if("Print Missing") @@ -404,7 +406,7 @@ What a mess.*/ printing = 1 sleep(30) if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)))//make sure the record still exists. - var/obj/item/photo/photo = active1.fields[DATACORE_PHOTO] + var/obj/item/photo/photo = active1.get_front_photo() new /obj/item/poster/wanted/missing(loc, photo.picture.picture_image, missing_name, info, headerText) printing = 0 @@ -472,8 +474,6 @@ What a mess.*/ G.fields[DATACORE_GENDER] = "Male" G.fields[DATACORE_AGE] = "Unknown" G.fields[DATACORE_SPECIES] = "Human" - G.fields[DATACORE_PHOTO] = new /icon() - G.fields[DATACORE_PHOTO_SIDE] = new /icon() G.fields[DATACORE_FINGERPRINT] = "?????" G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" G.fields[DATACORE_MENTAL_HEALTH] = "Stable" @@ -565,14 +565,15 @@ What a mess.*/ return active1.fields[DATACORE_SPECIES] = t1 if("show_photo_front") - if(active1.fields[DATACORE_PHOTO]) - if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) - var/obj/item/photo/P = active1.fields[DATACORE_PHOTO] - P.show(usr) + if(active1) + var/front_photo = active1.get_front_photo() + if(istype(front_photo, /obj/item/photo)) + var/obj/item/photo/photo = front_photo + photo.show(usr) if("upd_photo_front") var/obj/item/photo/photo = get_photo(usr) if(photo) - qdel(active1.fields[DATACORE_PHOTO]) + qdel(active1.fields["photo_front"]) //Lets center it to a 32x32. var/icon/I = photo.picture.picture_image var/w = I.Width() @@ -580,21 +581,24 @@ What a mess.*/ var/dw = w - 32 var/dh = w - 32 I.Crop(dw/2, dh/2, w - dw/2, h - dh/2) - active1.fields[DATACORE_PHOTO] = photo + active1.fields["photo_front"] = photo + investigate_log("[key_name(usr)] updated [active1.fields[DATACORE_NAME]]'s front photo.", INVESTIGATE_RECORDS) if("print_photo_front") - if(active1.fields[DATACORE_PHOTO]) - if(istype(active1.fields[DATACORE_PHOTO], /obj/item/photo)) - var/obj/item/photo/P = active1.fields[DATACORE_PHOTO] - print_photo(P.picture.picture_image, active1.fields[DATACORE_NAME]) + if(active1) + var/front_photo = active1.get_front_photo() + if(istype(front_photo, /obj/item/photo)) + var/obj/item/photo/photo_front = front_photo + print_photo(photo_front.picture.picture_image, active1.fields[DATACORE_NAME]) if("show_photo_side") - if(active1.fields[DATACORE_PHOTO_SIDE]) - if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) - var/obj/item/photo/P = active1.fields[DATACORE_PHOTO_SIDE] - P.show(usr) + if(active1) + var/side_photo = active1.get_side_photo() + if(istype(side_photo, /obj/item/photo)) + var/obj/item/photo/photo = side_photo + photo.show(usr) if("upd_photo_side") var/obj/item/photo/photo = get_photo(usr) if(photo) - qdel(active1.fields[DATACORE_PHOTO_SIDE]) + qdel(active1.fields["photo_side"]) //Lets center it to a 32x32. var/icon/I = photo.picture.picture_image var/w = I.Width() @@ -602,12 +606,14 @@ What a mess.*/ var/dw = w - 32 var/dh = w - 32 I.Crop(dw/2, dh/2, w - dw/2, h - dh/2) - active1.fields[DATACORE_PHOTO_SIDE] = photo + active1.fields["photo_side"] = photo + investigate_log("[key_name(usr)] updated [active1.fields[DATACORE_NAME]]'s front photo.", INVESTIGATE_RECORDS) if("print_photo_side") - if(active1.fields[DATACORE_PHOTO_SIDE]) - if(istype(active1.fields[DATACORE_PHOTO_SIDE], /obj/item/photo)) - var/obj/item/photo/P = active1.fields[DATACORE_PHOTO_SIDE] - print_photo(P.picture.picture_image, active1.fields[DATACORE_NAME]) + if(active1) + var/side_photo = active1.get_side_photo() + if(istype(side_photo, /obj/item/photo)) + var/obj/item/photo/photo_side = side_photo + print_photo(photo_side.picture.picture_image, active1.fields[DATACORE_NAME]) if("crim_add") if(!istype(active1, /datum/data/record/security)) return @@ -788,8 +794,7 @@ What a mess.*/ R.fields[DATACORE_SPECIES] = pick(GLOB.roundstart_races) if(8) var/datum/data/record/G = pick(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - R.fields[DATACORE_PHOTO] = G.fields[DATACORE_PHOTO] - R.fields[DATACORE_PHOTO_SIDE] = G.fields[DATACORE_PHOTO_SIDE] + R.fields[DATACORE_APPEARANCE] = G.fields[DATACORE_APPEARANCE] continue else if(prob(1)) diff --git a/code/modules/antagonists/traitor/equipment/contractor.dm b/code/modules/antagonists/traitor/equipment/contractor.dm index 17a1ec231854..138dc8e36042 100644 --- a/code/modules/antagonists/traitor/equipment/contractor.dm +++ b/code/modules/antagonists/traitor/equipment/contractor.dm @@ -57,10 +57,6 @@ CONTRACT_PAYOUT_SMALL ) - //What the fuck - if(length(to_generate) > length(SSdatacore.get_records(DATACORE_RECORDS_LOCKED))) - to_generate.Cut(1, length(SSdatacore.get_records(DATACORE_RECORDS_LOCKED))) - // We don't want the sum of all the payouts to be under this amount var/lowest_TC_threshold = 30 diff --git a/code/modules/datacore/records.dm b/code/modules/datacore/records.dm index 146f0bda40ce..202ed9a12b5e 100644 --- a/code/modules/datacore/records.dm +++ b/code/modules/datacore/records.dm @@ -20,7 +20,7 @@ new_record.fields = fields.Copy() return new_record -/* + /// A helper proc to get the front photo of a character from the record. /// Handles calling `get_photo()`, read its documentation for more information. /datum/data/record/proc/get_front_photo() @@ -30,7 +30,7 @@ /// Handles calling `get_photo()`, read its documentation for more information. /datum/data/record/proc/get_side_photo() return get_photo("photo_side", WEST) -*/ + /** * You shouldn't be calling this directly, use `get_front_photo()` or `get_side_photo()` @@ -50,7 +50,6 @@ * Returns an empty `/icon` if there was no `character_appearance` entry in the `fields` list, * returns the generated/cached photo otherwise. */ -/* /datum/data/record/proc/get_photo(field_name, orientation) if(fields[field_name]) return fields[field_name] @@ -71,7 +70,6 @@ var/obj/item/photo/photo = new(null, picture) fields[field_name] = photo return photo -*/ /datum/data/record/general diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7a18cb1b5740..3f8128931126 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -284,6 +284,7 @@ if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD) && !HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_OUTPOST) + /* if(href_list["photo_front"] || href_list["photo_side"]) if(!R) return @@ -299,7 +300,7 @@ if(P) P.show(H) return - + */ if(href_list["hud"] == "m") if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) return From 1910693725bf4f071b081bcebeec8db5111bddd3 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 16:36:24 -0500 Subject: [PATCH 09/47] shrug --- code/controllers/subsystem/datacore.dm | 21 +++++++++++-------- code/modules/mob/living/silicon/ai/ai.dm | 2 +- .../overmap/ships/controlled_ship_datum.dm | 3 +++ code/modules/paperwork/filingcabinet.dm | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index c6ea4ca1de68..ab36e50fe4c0 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(datacore) DATACORE_RECORDS_OUTPOST, DATACORE_RECORDS_SECURITY, DATACORE_RECORDS_MEDICAL, - DATACORE_RECORDS_LOCKED + //DATACORE_RECORDS_LOCKED ) var/securityPrintCount = 0 @@ -67,7 +67,8 @@ SUBSYSTEM_DEF(datacore) /// Removes a person from history. Except locked. That's permanent history. /datum/controller/subsystem/datacore/proc/demanifest(name) - for(var/id in library - DATACORE_RECORDS_LOCKED) + //for(var/id in library - DATACORE_RECORDS_LOCKED) + for(var/id in library) var/datum/data/record/R = get_record_by_name(name, id) qdel(R) @@ -255,6 +256,7 @@ SUBSYSTEM_DEF(datacore) S.fields[DATACORE_NOTES] = "No notes." library[DATACORE_RECORDS_SECURITY].inject_record(S) + /* //Locked Record var/datum/data/record/locked/L = new() L.fields[DATACORE_ID] = id @@ -278,8 +280,9 @@ SUBSYSTEM_DEF(datacore) L.fields[DATACORE_IMAGE] = image L.fields[DATACORE_MINDREF] = H.mind library[DATACORE_RECORDS_LOCKED].inject_record(L) - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MANIFEST_INJECT, G, M, S, L) + */ + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MANIFEST_INJECT, G, M, S) return //For ship records @@ -333,13 +336,13 @@ SUBSYSTEM_DEF(datacore) * * @return - list(general_records_out) */ -/datum/controller/subsystem/datacore/proc/get_general_records() - if(!get_records(DATACORE_RECORDS_OUTPOST)) +/datum/controller/subsystem/datacore/proc/get_general_records(record_key = DATACORE_RECORDS_OUTPOST) + if(!get_records(record_key)) return list() /// The array of records var/list/general_records_out = list() - for(var/datum/data/record/gen_record as anything in get_records(DATACORE_RECORDS_OUTPOST)) + for(var/datum/data/record/gen_record as anything in get_records(record_key)) /// The object containing the crew info var/list/crew_record = list() crew_record["ref"] = REF(gen_record) @@ -356,13 +359,13 @@ SUBSYSTEM_DEF(datacore) * * @return - list(security_records_out) */ -/datum/controller/subsystem/datacore/proc/get_security_records() - if(!get_records(DATACORE_RECORDS_SECURITY)) +/datum/controller/subsystem/datacore/proc/get_security_records(record_key = DATACORE_RECORDS_SECURITY) + if(!get_records(record_key)) return list() /// The array of records var/list/security_records_out = list() - for(var/datum/data/record/sec_record as anything in get_records(DATACORE_RECORDS_SECURITY)) + for(var/datum/data/record/sec_record as anything in get_records(record_key)) /// The object containing the crew info var/list/crew_record = list() crew_record["ref"] = REF(sec_record) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 5d4448af40aa..7bddf83e8090 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -629,7 +629,7 @@ if("Crew Member") var/list/personnel_list = list() - for(var/datum/data/record/t in SSdatacore.get_records(DATACORE_RECORDS_LOCKED))//Look in data core locked. + for(var/datum/data/record/t in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))//Look in data core locked. personnel_list["[t.fields[DATACORE_NAME]]: [t.fields[DATACORE_RANK]]"] = t.fields[DATACORE_IMAGE]//Pull names, rank, and image. if(personnel_list.len) diff --git a/code/modules/overmap/ships/controlled_ship_datum.dm b/code/modules/overmap/ships/controlled_ship_datum.dm index cc23d3463321..1653a94170ab 100644 --- a/code/modules/overmap/ships/controlled_ship_datum.dm +++ b/code/modules/overmap/ships/controlled_ship_datum.dm @@ -442,6 +442,9 @@ SStgui.close_uis(helm) helm.say(helm_locked ? "Helm console is now locked." : "Helm console has been unlocked.") +/datum/overmap/ship/controlled/proc/get_records() + return ship_record + /obj/item/key/ship name = "ship key" desc = "A key for locking and unlocking the helm of a ship, comes with a ball chain so it can be worn around the neck. Comes with a cute little shuttle-shaped keychain." diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 1aa86696b54c..b90c23c76550 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -214,7 +214,7 @@ GLOBAL_LIST_EMPTY(employmentCabinets) /obj/structure/filingcabinet/employment/proc/fillCurrent() //This proc fills the cabinet with the current crew. - for(var/record in SSdatacore.get_records(DATACORE_RECORDS_LOCKED)) + for(var/record in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) var/datum/data/record/G = record if(!G) continue From fd286c2f2efd0f1ac7e4cd7505a181655974f738 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 19:57:42 -0500 Subject: [PATCH 10/47] records computer --- .../JungleRuins/jungle_interceptor.dmm | 2 +- .../LavaRuins/lavaland_surface_codelab.dmm | 2 +- .../RockRuins/rockplanet_budgetcuts.dmm | 8 +-- .../RockRuins/rockplanet_harmfactory.dmm | 4 +- .../RockRuins/rockplanet_nomadcrash.dmm | 2 +- .../SpaceRuins/dangerous_research.dmm | 4 +- _maps/RandomRuins/SpaceRuins/power_puzzle.dmm | 2 +- _maps/RandomRuins/SpaceRuins/spacemall.dmm | 4 +- .../wasteplanet_fortress_of_solitide.dmm | 2 +- _maps/map_files/generic/CentCom.dmm | 34 +++++----- _maps/outpost/hangar/nt_ice_40x40.dmm | 2 +- _maps/outpost/hangar/nt_ice_56x40.dmm | 2 +- _maps/outpost/nanotrasen_asteroid.dmm | 22 +++---- _maps/outpost/nanotrasen_ice.dmm | 4 +- .../independent/independent_beluga.dmm | 6 +- .../shuttles/independent/independent_box.dmm | 2 +- .../independent/independent_lagoon.dmm | 4 +- .../independent/independent_rigger.dmm | 4 +- .../independent/independent_schmiedeberg.dmm | 2 +- .../independent/independent_shetland.dmm | 4 +- .../independent/independent_tranquility.dmm | 6 +- _maps/shuttles/inteq/inteq_colossus.dmm | 4 +- _maps/shuttles/inteq/inteq_talos.dmm | 2 +- _maps/shuttles/inteq/inteq_valor.dmm | 6 +- .../shuttles/nanotrasen/nanotrasen_heron.dmm | 14 ++-- .../shuttles/nanotrasen/nanotrasen_osprey.dmm | 2 +- .../nanotrasen/nanotrasen_skipper.dmm | 2 +- _maps/shuttles/pgf/pgf_crying_sun.dmm | 2 +- _maps/shuttles/pirate/pirate_ember.dmm | 4 +- _maps/shuttles/solgov/solgov_chronicle.dmm | 2 +- _maps/shuttles/solgov/solgov_inkwell.dmm | 4 +- _maps/shuttles/solgov/solgov_paracelsus.dmm | 4 +- _maps/shuttles/subshuttles/inteq_anvil.dmm | 2 +- _maps/shuttles/syndicate/syndicate_aegis.dmm | 4 +- .../syndicate/syndicate_gorlex_komodo.dmm | 6 +- .../syndicate/syndicate_litieguai.dmm | 4 +- .../syndicate/syndicate_twinkleshine.dmm | 4 +- .../computer/{ => record}/medical.dm | 64 +++++++------------ code/game/machinery/computer/record/record.dm | 26 ++++++++ .../computer/{ => record}/security.dm | 48 ++++++-------- .../circuitboards/computer_circuitboards.dm | 4 +- shiptest.dme | 5 +- 42 files changed, 166 insertions(+), 169 deletions(-) rename code/game/machinery/computer/{ => record}/medical.dm (93%) create mode 100644 code/game/machinery/computer/record/record.dm rename code/game/machinery/computer/{ => record}/security.dm (96%) diff --git a/_maps/RandomRuins/JungleRuins/jungle_interceptor.dmm b/_maps/RandomRuins/JungleRuins/jungle_interceptor.dmm index 057b0cbdbe8f..b28987d86a8b 100644 --- a/_maps/RandomRuins/JungleRuins/jungle_interceptor.dmm +++ b/_maps/RandomRuins/JungleRuins/jungle_interceptor.dmm @@ -3395,7 +3395,7 @@ /turf/open/floor/plating/rust, /area/ruin/jungle/interceptor/starlauncherone) "CU" = ( -/obj/machinery/computer/secure_data, +/obj/machinery/computer/record/sec, /obj/structure/cable/orange{ icon_state = "2-8" }, diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_codelab.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_codelab.dmm index 1f2e77364219..cf1176fb0fe2 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_codelab.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_codelab.dmm @@ -3351,7 +3351,7 @@ "PK" = ( /obj/structure/table, /obj/structure/window/reinforced/spawner, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 1; pixel_y = 7 }, diff --git a/_maps/RandomRuins/RockRuins/rockplanet_budgetcuts.dmm b/_maps/RandomRuins/RockRuins/rockplanet_budgetcuts.dmm index 505ae3600d31..83c8083bdddd 100644 --- a/_maps/RandomRuins/RockRuins/rockplanet_budgetcuts.dmm +++ b/_maps/RandomRuins/RockRuins/rockplanet_budgetcuts.dmm @@ -64,7 +64,7 @@ /area/overmap_encounter/planetoid/rockplanet/explored) "bc" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 4; pixel_x = -7; pixel_y = 6 @@ -1329,7 +1329,7 @@ /obj/machinery/status_display/evac{ pixel_y = 32 }, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ pixel_x = 5; pixel_y = 4 }, @@ -2395,11 +2395,11 @@ /area/ruin/rockplanet/nanotrasen) "Po" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ pixel_x = -5; pixel_y = 3 }, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ pixel_x = 16; pixel_y = 3 }, diff --git a/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm b/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm index 8d9d02795d7d..a41b8de72b59 100644 --- a/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm +++ b/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm @@ -111,7 +111,7 @@ /area/ruin/powered) "cy" = ( /obj/structure/table/wood/reinforced, -/obj/machinery/computer/secure_data/laptop, +/obj/machinery/computer/record/sec/laptop, /turf/open/floor/plating/rust, /area/ruin/powered) "cQ" = ( @@ -121,7 +121,7 @@ /area/ruin/powered) "dr" = ( /obj/structure/table/wood/reinforced, -/obj/machinery/computer/med_data/laptop, +/obj/machinery/computer/record/med/laptop, /obj/effect/decal/cleanable/dirt/dust, /obj/item/newspaper{ pixel_x = 8; diff --git a/_maps/RandomRuins/RockRuins/rockplanet_nomadcrash.dmm b/_maps/RandomRuins/RockRuins/rockplanet_nomadcrash.dmm index ff58248ffc4e..41c18dcc71c7 100644 --- a/_maps/RandomRuins/RockRuins/rockplanet_nomadcrash.dmm +++ b/_maps/RandomRuins/RockRuins/rockplanet_nomadcrash.dmm @@ -1495,7 +1495,7 @@ dir = 4 }, /obj/structure/table, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 8; pixel_x = 2; pixel_y = 6 diff --git a/_maps/RandomRuins/SpaceRuins/dangerous_research.dmm b/_maps/RandomRuins/SpaceRuins/dangerous_research.dmm index a1bfbbcabd83..45f75eacdb10 100644 --- a/_maps/RandomRuins/SpaceRuins/dangerous_research.dmm +++ b/_maps/RandomRuins/SpaceRuins/dangerous_research.dmm @@ -250,7 +250,7 @@ /obj/structure/window/reinforced{ dir = 1 }, -/obj/machinery/computer/med_data/laptop, +/obj/machinery/computer/record/med/laptop, /obj/effect/turf_decal/corner/opaque/grey/diagonal, /turf/open/floor/plasteel/dark, /area/ruin/space/has_grav) @@ -1361,7 +1361,7 @@ /obj/structure/window/reinforced{ dir = 4 }, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 8; pixel_y = 1; req_one_access = null; diff --git a/_maps/RandomRuins/SpaceRuins/power_puzzle.dmm b/_maps/RandomRuins/SpaceRuins/power_puzzle.dmm index b76ae63a86e7..7aa73531824b 100644 --- a/_maps/RandomRuins/SpaceRuins/power_puzzle.dmm +++ b/_maps/RandomRuins/SpaceRuins/power_puzzle.dmm @@ -3178,7 +3178,7 @@ dir = 4 }, /obj/effect/decal/cleanable/dirt/dust, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 1; pixel_y = 5 }, diff --git a/_maps/RandomRuins/SpaceRuins/spacemall.dmm b/_maps/RandomRuins/SpaceRuins/spacemall.dmm index eb669d4116ea..2b96f5498742 100644 --- a/_maps/RandomRuins/SpaceRuins/spacemall.dmm +++ b/_maps/RandomRuins/SpaceRuins/spacemall.dmm @@ -1360,7 +1360,7 @@ /turf/open/floor/plasteel, /area/ruin/space/has_grav/spacemall) "fa" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 1 }, /obj/effect/turf_decal/corner/opaque/red/mono, @@ -8455,7 +8455,7 @@ /turf/open/floor/wood, /area/ruin/space/has_grav/spacemall/maint) "FC" = ( -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 1 }, /obj/structure/table/reinforced, diff --git a/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm b/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm index 73735c65542b..563c393ce1ef 100644 --- a/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm +++ b/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm @@ -4761,7 +4761,7 @@ /obj/structure/window/reinforced/spawner{ dir = 1 }, -/obj/machinery/computer/med_data, +/obj/machinery/computer/record/med, /turf/open/floor/plating, /area/ruin/powered) "Ta" = ( diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index 19b41ef8018f..cef0b26caa4d 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -3790,7 +3790,7 @@ /turf/open/floor/mineral/titanium/blue, /area/centcom/evac) "aLj" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 4 }, /turf/open/floor/mineral/plastitanium/red, @@ -6488,7 +6488,7 @@ /turf/open/floor/plasteel, /area/centcom/control) "bIA" = ( -/obj/machinery/computer/secure_data, +/obj/machinery/computer/record/sec, /obj/effect/turf_decal/industrial/warning, /turf/open/floor/plasteel, /area/centcom/control) @@ -7019,7 +7019,7 @@ /turf/open/floor/plasteel, /area/centcom/control) "cRF" = ( -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 4 }, /obj/effect/turf_decal/corner/transparent/neutral{ @@ -7049,7 +7049,7 @@ /obj/structure/sign/poster/contraband/syndicate_recruitment{ pixel_x = -32 }, -/obj/machinery/computer/secure_data/syndie{ +/obj/machinery/computer/record/sec/syndie{ dir = 4 }, /turf/open/floor/mineral/plastitanium, @@ -7350,7 +7350,7 @@ /turf/open/floor/plasteel, /area/centcom) "dGq" = ( -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/blue{ @@ -8910,7 +8910,7 @@ /turf/open/floor/plasteel, /area/centcom/supply) "gLL" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 8 }, /obj/machinery/button/door/indestructible{ @@ -9788,7 +9788,7 @@ /turf/open/floor/mineral/plastitanium, /area/centcom) "izl" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 1 }, /obj/machinery/light/directional/south, @@ -9981,7 +9981,7 @@ /obj/machinery/newscaster/directional/north{ pixel_y = -30 }, -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 1 }, /obj/effect/turf_decal/corner/transparent/neutral{ @@ -10074,7 +10074,7 @@ /turf/open/floor/plasteel, /area/centcom/supplypod/loading/ert) "jly" = ( -/obj/machinery/computer/med_data/syndie{ +/obj/machinery/computer/record/med/syndie{ dir = 1 }, /turf/open/floor/mineral/plastitanium/red, @@ -10181,7 +10181,7 @@ /turf/open/floor/plasteel/dark, /area/tdome/tdomeobserve) "jvG" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 1 }, /obj/effect/turf_decal/industrial/warning{ @@ -10967,7 +10967,7 @@ /turf/open/floor/plasteel, /area/centcom/control) "lhE" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 4 }, /obj/effect/turf_decal/corner/transparent/neutral{ @@ -11621,7 +11621,7 @@ /area/ctf) "moE" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4; pixel_y = 6; pixel_x = -4 @@ -12445,7 +12445,7 @@ /obj/effect/turf_decal/corner/opaque/brown{ dir = 8 }, -/obj/machinery/computer/secure_data, +/obj/machinery/computer/record/sec, /obj/machinery/light/directional/north, /turf/open/floor/plasteel, /area/centcom) @@ -12672,7 +12672,7 @@ /area/centcom/ferry) "owZ" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/med_data/laptop, +/obj/machinery/computer/record/med/laptop, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, @@ -16017,7 +16017,7 @@ /turf/open/floor/plasteel/dark, /area/ctf) "vyk" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 1 }, /obj/effect/turf_decal/corner/transparent/neutral{ @@ -16042,7 +16042,7 @@ /turf/open/floor/plasteel, /area/centcom/control) "vAM" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 8 }, /obj/effect/turf_decal/corner/transparent/neutral{ @@ -16811,7 +16811,7 @@ /area/centcom/supply) "xSR" = ( /obj/structure/table/wood, -/obj/machinery/computer/med_data/laptop, +/obj/machinery/computer/record/med/laptop, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, diff --git a/_maps/outpost/hangar/nt_ice_40x40.dmm b/_maps/outpost/hangar/nt_ice_40x40.dmm index f2f644dd7dda..c3248f5ba80c 100644 --- a/_maps/outpost/hangar/nt_ice_40x40.dmm +++ b/_maps/outpost/hangar/nt_ice_40x40.dmm @@ -1091,7 +1091,7 @@ }, /area/hangar) "Ps" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ icon_state = "computer-left"; dir = 4; pixel_x = -7 diff --git a/_maps/outpost/hangar/nt_ice_56x40.dmm b/_maps/outpost/hangar/nt_ice_56x40.dmm index 90841c2cf6a1..b0b4d0926ed6 100644 --- a/_maps/outpost/hangar/nt_ice_56x40.dmm +++ b/_maps/outpost/hangar/nt_ice_56x40.dmm @@ -1070,7 +1070,7 @@ }, /area/hangar) "Mt" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ icon_state = "computer-left"; dir = 4; pixel_x = -7 diff --git a/_maps/outpost/nanotrasen_asteroid.dmm b/_maps/outpost/nanotrasen_asteroid.dmm index a55df014f4f9..cfafd5d4f317 100644 --- a/_maps/outpost/nanotrasen_asteroid.dmm +++ b/_maps/outpost/nanotrasen_asteroid.dmm @@ -282,10 +282,10 @@ /area/outpost/hallway/central) "bn" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ pixel_x = -3 }, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ pixel_x = 14 }, /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4{ @@ -931,7 +931,7 @@ /area/outpost/crew/garden) "dD" = ( /obj/structure/table/glass, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ pixel_x = 4; pixel_y = 4 }, @@ -2890,7 +2890,7 @@ /turf/open/floor/plasteel/rockvault, /area/outpost/operations) "kN" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 8 }, /obj/structure/railing{ @@ -4326,7 +4326,7 @@ /obj/structure/cable{ icon_state = "4-8" }, -/obj/machinery/computer/med_data, +/obj/machinery/computer/record/med, /turf/open/floor/plasteel/dark, /area/outpost/crew/cryo) "qb" = ( @@ -7525,7 +7525,7 @@ /turf/open/floor/plating/rust, /area/outpost/maintenance/aft) "As" = ( -/obj/machinery/computer/med_data, +/obj/machinery/computer/record/med, /obj/effect/turf_decal/trimline/opaque/green/filled/line, /obj/effect/turf_decal/techfloor{ dir = 1 @@ -8132,7 +8132,7 @@ /area/outpost/operations) "CA" = ( /obj/structure/table/wood, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 8 }, /turf/open/floor/plasteel, @@ -8367,7 +8367,7 @@ /turf/open/floor/plating, /area/outpost/maintenance/aft) "Du" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 8 }, /obj/effect/turf_decal/techfloor{ @@ -8487,7 +8487,7 @@ /area/outpost/hallway/central) "DV" = ( /obj/structure/table/wood, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 4; pixel_x = -1; pixel_y = 3 @@ -9825,7 +9825,7 @@ /area/outpost/hallway/central) "Iy" = ( /obj/structure/window/reinforced/spawner/west, -/obj/machinery/computer/med_data, +/obj/machinery/computer/record/med, /turf/open/floor/plasteel/dark, /area/outpost/crew/cryo) "Iz" = ( @@ -14145,7 +14145,7 @@ /turf/open/floor/grass, /area/outpost/crew/garden) "XI" = ( -/obj/machinery/computer/secure_data, +/obj/machinery/computer/record/sec, /obj/effect/turf_decal/trimline/opaque/red/filled/line, /obj/effect/turf_decal/techfloor{ dir = 1 diff --git a/_maps/outpost/nanotrasen_ice.dmm b/_maps/outpost/nanotrasen_ice.dmm index 696342178b2d..08e4194c5cd2 100644 --- a/_maps/outpost/nanotrasen_ice.dmm +++ b/_maps/outpost/nanotrasen_ice.dmm @@ -2021,7 +2021,7 @@ /area/outpost/exterior) "nU" = ( /obj/effect/decal/cleanable/dirt/dust, -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ icon_state = "computer-left" }, /turf/open/floor/plasteel/telecomms_floor, @@ -5740,7 +5740,7 @@ /turf/closed/indestructible/reinforced, /area/outpost/exterior) "Nl" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ icon_state = "computer-left" }, /turf/open/floor/plasteel/telecomms_floor, diff --git a/_maps/shuttles/independent/independent_beluga.dmm b/_maps/shuttles/independent/independent_beluga.dmm index f1595e0ffaa1..4f9c415837e2 100644 --- a/_maps/shuttles/independent/independent_beluga.dmm +++ b/_maps/shuttles/independent/independent_beluga.dmm @@ -467,7 +467,7 @@ /obj/effect/turf_decal/borderfloorblack{ dir = 8 }, -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 4 }, /obj/structure/railing{ @@ -1132,7 +1132,7 @@ /obj/structure/table/reinforced{ color = "#c1b6a5" }, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 8; pixel_x = 5; pixel_y = 2 @@ -4596,7 +4596,7 @@ /area/ship/engineering) "SW" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4; pixel_x = -7; pixel_y = 5 diff --git a/_maps/shuttles/independent/independent_box.dmm b/_maps/shuttles/independent/independent_box.dmm index 0e1e4e9439b5..a0585ba1a0b5 100644 --- a/_maps/shuttles/independent/independent_box.dmm +++ b/_maps/shuttles/independent/independent_box.dmm @@ -2520,7 +2520,7 @@ /area/ship/engineering) "LG" = ( /obj/structure/table/glass, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ density = 0; pixel_x = 3 }, diff --git a/_maps/shuttles/independent/independent_lagoon.dmm b/_maps/shuttles/independent/independent_lagoon.dmm index 7e96d8f93b53..08e6b4a6d22f 100644 --- a/_maps/shuttles/independent/independent_lagoon.dmm +++ b/_maps/shuttles/independent/independent_lagoon.dmm @@ -724,7 +724,7 @@ /area/ship/crew/library) "eR" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 8; pixel_x = 3; pixel_y = 5 @@ -1680,7 +1680,7 @@ /area/ship/crew/chapel) "kX" = ( /obj/structure/table/glass, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 1 }, /obj/machinery/light/directional/south, diff --git a/_maps/shuttles/independent/independent_rigger.dmm b/_maps/shuttles/independent/independent_rigger.dmm index daf3cf9ecdb3..5dc6330d73ff 100644 --- a/_maps/shuttles/independent/independent_rigger.dmm +++ b/_maps/shuttles/independent/independent_rigger.dmm @@ -378,7 +378,7 @@ /obj/machinery/light/small/directional/south, /obj/effect/turf_decal/borderfloor, /obj/structure/table/glass, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 1 }, /obj/effect/turf_decal/corner/opaque/green{ @@ -2538,7 +2538,7 @@ "EB" = ( /obj/item/radio/intercom/directional/south, /obj/structure/table/wood, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 1 }, /obj/item/lighter/greyscale{ diff --git a/_maps/shuttles/independent/independent_schmiedeberg.dmm b/_maps/shuttles/independent/independent_schmiedeberg.dmm index 454e7503cb52..e8e6610c4e9e 100644 --- a/_maps/shuttles/independent/independent_schmiedeberg.dmm +++ b/_maps/shuttles/independent/independent_schmiedeberg.dmm @@ -1811,7 +1811,7 @@ /area/ship/security) "zW" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 8 }, /obj/machinery/door/window/brigdoor{ diff --git a/_maps/shuttles/independent/independent_shetland.dmm b/_maps/shuttles/independent/independent_shetland.dmm index 13599cc298cf..821b33219a9f 100644 --- a/_maps/shuttles/independent/independent_shetland.dmm +++ b/_maps/shuttles/independent/independent_shetland.dmm @@ -1653,7 +1653,7 @@ /area/ship/hallway/central) "oG" = ( /obj/structure/table, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ density = 0 }, /obj/effect/turf_decal/corner/opaque/black{ @@ -1791,7 +1791,7 @@ /area/ship/crew/cryo) "pR" = ( /obj/structure/table/glass, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/bottlegreen/full, diff --git a/_maps/shuttles/independent/independent_tranquility.dmm b/_maps/shuttles/independent/independent_tranquility.dmm index 1ac7b7fb0d33..1a9517812442 100644 --- a/_maps/shuttles/independent/independent_tranquility.dmm +++ b/_maps/shuttles/independent/independent_tranquility.dmm @@ -645,7 +645,7 @@ /area/ship/external) "fk" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/med_data/laptop, +/obj/machinery/computer/record/med/laptop, /obj/effect/turf_decal/techfloor{ dir = 5 }, @@ -2016,7 +2016,7 @@ /area/ship/external) "qe" = ( /obj/structure/table, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 8 }, /obj/effect/turf_decal/borderfloorblack/cee{ @@ -4266,7 +4266,7 @@ /area/ship/crew/crewfive) "Io" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4 }, /obj/effect/turf_decal/techfloor{ diff --git a/_maps/shuttles/inteq/inteq_colossus.dmm b/_maps/shuttles/inteq/inteq_colossus.dmm index d5ed70873819..a8b86dd3f0b2 100644 --- a/_maps/shuttles/inteq/inteq_colossus.dmm +++ b/_maps/shuttles/inteq/inteq_colossus.dmm @@ -706,7 +706,7 @@ /area/ship/hallway/fore) "hv" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4 }, /obj/effect/turf_decal/corner/opaque/yellow{ @@ -1758,7 +1758,7 @@ /area/ship/cargo) "tx" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4 }, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/inteq/inteq_talos.dmm b/_maps/shuttles/inteq/inteq_talos.dmm index 45ecbf33d0a7..8fef88a45b6d 100644 --- a/_maps/shuttles/inteq/inteq_talos.dmm +++ b/_maps/shuttles/inteq/inteq_talos.dmm @@ -4103,7 +4103,7 @@ /area/ship/engineering/communications) "yx" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop, +/obj/machinery/computer/record/sec/laptop, /turf/open/floor/plasteel/dark, /area/ship/security) "yz" = ( diff --git a/_maps/shuttles/inteq/inteq_valor.dmm b/_maps/shuttles/inteq/inteq_valor.dmm index b98d0f2f13cd..1ca91feb8cfe 100644 --- a/_maps/shuttles/inteq/inteq_valor.dmm +++ b/_maps/shuttles/inteq/inteq_valor.dmm @@ -1278,7 +1278,7 @@ /area/ship/crew/canteen) "lN" = ( /obj/structure/table, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 1; pixel_y = 8 }, @@ -1345,7 +1345,7 @@ pixel_x = 13; pixel_y = 5 }, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 1; pixel_y = 4 }, @@ -2701,7 +2701,7 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 1; pixel_y = 8 }, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm b/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm index 107044c9e80f..3fcdc23a196c 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm @@ -53,7 +53,7 @@ layer = 4.1 }, /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 1; pixel_y = 4; pixel_x = 2 @@ -1206,7 +1206,7 @@ /obj/effect/turf_decal/borderfloorblack{ dir = 1 }, -/obj/machinery/computer/secure_data, +/obj/machinery/computer/record/sec, /turf/open/floor/plasteel/tech/grid, /area/ship/bridge) "eX" = ( @@ -2011,7 +2011,7 @@ /obj/effect/turf_decal/techfloor{ dir = 4 }, -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 8 }, /turf/open/floor/plasteel/tech, @@ -6823,7 +6823,7 @@ /turf/open/floor/plating, /area/ship/engineering/electrical) "zf" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 4 }, /obj/structure/extinguisher_cabinet/directional/north, @@ -8739,7 +8739,7 @@ /obj/structure/table/reinforced{ color = "#c1b6a5" }, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ pixel_y = 8; pixel_x = -2 }, @@ -12760,7 +12760,7 @@ /area/ship/crew/office) "VK" = ( /obj/structure/table, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4; pixel_x = -8; pixel_y = 5 @@ -13118,7 +13118,7 @@ /obj/effect/turf_decal/techfloor{ dir = 4 }, -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 8 }, /obj/item/radio/intercom/directional/south, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm b/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm index e4f74b4577e2..9b37dae43096 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm @@ -5719,7 +5719,7 @@ /turf/open/floor/plasteel, /area/ship/hallway/central) "Lc" = ( -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 4 }, /turf/open/floor/plasteel/white, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm index bc4db627e44b..e355c4ac306e 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm @@ -3022,7 +3022,7 @@ /turf/open/floor/plating, /area/ship/crew/toilet) "xA" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 4 }, /obj/machinery/light/small/directional/west, diff --git a/_maps/shuttles/pgf/pgf_crying_sun.dmm b/_maps/shuttles/pgf/pgf_crying_sun.dmm index f06f4e5dbc66..d2eb17fa0f49 100644 --- a/_maps/shuttles/pgf/pgf_crying_sun.dmm +++ b/_maps/shuttles/pgf/pgf_crying_sun.dmm @@ -4353,7 +4353,7 @@ /area/ship/hallway/central) "Jd" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop, +/obj/machinery/computer/record/sec/laptop, /obj/effect/turf_decal/spline/fancy/opaque/lime{ dir = 5 }, diff --git a/_maps/shuttles/pirate/pirate_ember.dmm b/_maps/shuttles/pirate/pirate_ember.dmm index 6173f14db95b..a6eb8c5d313f 100644 --- a/_maps/shuttles/pirate/pirate_ember.dmm +++ b/_maps/shuttles/pirate/pirate_ember.dmm @@ -6166,7 +6166,7 @@ /turf/closed/wall/r_wall/syndicate/nodiagonal, /area/ship/cargo) "Ec" = ( -/obj/machinery/computer/med_data/syndie{ +/obj/machinery/computer/record/med/syndie{ dir = 1; pixel_y = -3 }, @@ -6711,7 +6711,7 @@ }, /area/ship/maintenance/port) "Gf" = ( -/obj/machinery/computer/secure_data/syndie{ +/obj/machinery/computer/record/sec/syndie{ layer = 3.0; pixel_y = 4 }, diff --git a/_maps/shuttles/solgov/solgov_chronicle.dmm b/_maps/shuttles/solgov/solgov_chronicle.dmm index d0359b5ca240..6dfc0754091f 100644 --- a/_maps/shuttles/solgov/solgov_chronicle.dmm +++ b/_maps/shuttles/solgov/solgov_chronicle.dmm @@ -1137,7 +1137,7 @@ /area/ship/crew/crewtwo) "kl" = ( /obj/structure/table/wood/fancy/purple, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 8; pixel_y = 5; pixel_x = 4 diff --git a/_maps/shuttles/solgov/solgov_inkwell.dmm b/_maps/shuttles/solgov/solgov_inkwell.dmm index 25c1da558e56..722dcd458b3e 100644 --- a/_maps/shuttles/solgov/solgov_inkwell.dmm +++ b/_maps/shuttles/solgov/solgov_inkwell.dmm @@ -4464,7 +4464,7 @@ /area/ship/crew/canteen/kitchen) "CN" = ( /obj/structure/table/wood/fancy/blue, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4 }, /turf/open/floor/wood/walnut, @@ -5565,7 +5565,7 @@ /turf/open/floor/plasteel/white, /area/ship/cargo/office) "Kg" = ( -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 4 }, /obj/structure/table/wood/fancy/purple, diff --git a/_maps/shuttles/solgov/solgov_paracelsus.dmm b/_maps/shuttles/solgov/solgov_paracelsus.dmm index 1eb02eac6a21..dddae53bd6c5 100644 --- a/_maps/shuttles/solgov/solgov_paracelsus.dmm +++ b/_maps/shuttles/solgov/solgov_paracelsus.dmm @@ -789,7 +789,7 @@ "if" = ( /obj/structure/table/wood, /obj/machinery/light/directional/west, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 4; pixel_x = -4; pixel_y = 7 @@ -5389,7 +5389,7 @@ pixel_x = 8; pixel_y = -8 }, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 8; pixel_x = 4; pixel_y = 7 diff --git a/_maps/shuttles/subshuttles/inteq_anvil.dmm b/_maps/shuttles/subshuttles/inteq_anvil.dmm index 5e591774e259..c8a114d008e2 100644 --- a/_maps/shuttles/subshuttles/inteq_anvil.dmm +++ b/_maps/shuttles/subshuttles/inteq_anvil.dmm @@ -1,6 +1,6 @@ //MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE "a" = ( -/obj/machinery/computer/secure_data{ +/obj/machinery/computer/record/sec{ dir = 8 }, /obj/effect/turf_decal/techfloor{ diff --git a/_maps/shuttles/syndicate/syndicate_aegis.dmm b/_maps/shuttles/syndicate/syndicate_aegis.dmm index e001e89d1383..f84733805fbf 100644 --- a/_maps/shuttles/syndicate/syndicate_aegis.dmm +++ b/_maps/shuttles/syndicate/syndicate_aegis.dmm @@ -1368,7 +1368,7 @@ /turf/open/floor/wood/walnut, /area/ship/crew/dorm) "kI" = ( -/obj/machinery/computer/med_data/syndie{ +/obj/machinery/computer/record/med/syndie{ dir = 4 }, /obj/effect/turf_decal/siding/wood{ @@ -1449,7 +1449,7 @@ }, /obj/structure/table, /obj/effect/turf_decal/trimline/opaque/blue/filled/line, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 1; pixel_y = 6 }, diff --git a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm index fc7e7a029b82..e099e1bfc8eb 100644 --- a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm +++ b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm @@ -615,7 +615,7 @@ /obj/structure/table/reinforced, /obj/effect/decal/cleanable/dirt, /obj/effect/decal/cleanable/dirt, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 4 }, /obj/effect/turf_decal/spline/fancy/opaque/black{ @@ -806,7 +806,7 @@ /turf/open/floor/plasteel/tech, /area/ship/maintenance/starboard) "ip" = ( -/obj/machinery/computer/med_data/syndie, +/obj/machinery/computer/record/med/syndie, /obj/effect/turf_decal/techfloor{ dir = 1 }, @@ -907,7 +907,7 @@ /turf/open/floor/plasteel/tech/techmaint, /area/ship/engineering) "jn" = ( -/obj/machinery/computer/secure_data/syndie{ +/obj/machinery/computer/record/sec/syndie{ dir = 1 }, /obj/effect/turf_decal/techfloor, diff --git a/_maps/shuttles/syndicate/syndicate_litieguai.dmm b/_maps/shuttles/syndicate/syndicate_litieguai.dmm index 1330108a6874..afd14b289e19 100644 --- a/_maps/shuttles/syndicate/syndicate_litieguai.dmm +++ b/_maps/shuttles/syndicate/syndicate_litieguai.dmm @@ -1198,7 +1198,7 @@ /turf/open/floor/engine, /area/ship/cargo) "yQ" = ( -/obj/machinery/computer/med_data{ +/obj/machinery/computer/record/med{ dir = 8 }, /turf/open/floor/plasteel/dark, @@ -2199,7 +2199,7 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 4 }, /obj/machinery/door/firedoor/border_only{ diff --git a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm index 5878f667db1e..a82fa8aa3bf0 100644 --- a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm +++ b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm @@ -602,7 +602,7 @@ /area/ship/cargo) "dq" = ( /obj/structure/table/reinforced, -/obj/machinery/computer/secure_data/laptop{ +/obj/machinery/computer/record/sec/laptop{ dir = 8; pixel_y = 6; pixel_x = 1 @@ -1038,7 +1038,7 @@ /area/ship/engineering/engine) "gq" = ( /obj/structure/table, -/obj/machinery/computer/med_data/laptop{ +/obj/machinery/computer/record/med/laptop{ dir = 8; pixel_y = 6 }, diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/record/medical.dm similarity index 93% rename from code/game/machinery/computer/medical.dm rename to code/game/machinery/computer/record/medical.dm index 127bf30b6870..915df75dfea9 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/record/medical.dm @@ -1,6 +1,6 @@ -/obj/machinery/computer/med_data//TODO:SANITY +/obj/machinery/computer/record/med//TODO:SANITY name = "medical records console" desc = "This can be used to check medical records." icon_screen = "medcomp" @@ -8,21 +8,11 @@ req_one_access = list(ACCESS_MEDICAL, ACCESS_FORENSICS_LOCKERS) circuit = /obj/item/circuitboard/computer/med_data light_color = LIGHT_COLOR_BLUE - var/rank = null - var/screen = null - var/datum/data/record/active1 - var/datum/data/record/active2 - var/temp = null - var/printing = null - //Sorting Variables - var/sortBy = "name" - var/order = 1 // -1 = Descending - 1 = Ascending - - -/obj/machinery/computer/med_data/syndie + +/obj/machinery/computer/record/med/syndie icon_keyboard = "syndie_key" -/obj/machinery/computer/med_data/ui_interact(mob/user) +/obj/machinery/computer/record/med/ui_interact(mob/user) . = ..() if(isliving(user)) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) @@ -177,7 +167,7 @@ popup.set_content(dat) popup.open() -/obj/machinery/computer/med_data/Topic(href, href_list) +/obj/machinery/computer/record/med/Topic(href, href_list) . = ..() if(.) return . @@ -273,7 +263,7 @@ if("fingerprint") if(active1) var/t1 = stripped_input("Please input fingerprint hash:", "Med. records", active1.fields[DATACORE_FINGERPRINT], null) - if(!canUseMedicalRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return active1.fields[DATACORE_FINGERPRINT] = t1 if("gender") @@ -287,67 +277,67 @@ if("age") if(active1) var/t1 = input("Please input age:", "Med. records", active1.fields[DATACORE_AGE], null) as num - if(!canUseMedicalRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return active1.fields[DATACORE_AGE] = t1 if("species") if(active1) var/t1 = stripped_input("Please input species name", "Med. records", active1.fields[DATACORE_SPECIES], null) - if(!canUseMedicalRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return active1.fields[DATACORE_SPECIES] = t1 if("mi_dis") if(active2) var/t1 = stripped_input("Please input minor disabilities list:", "Med. records", active2.fields["mi_dis"], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields["mi_dis"] = t1 if("mi_dis_d") if(active2) var/t1 = stripped_input("Please summarize minor dis.:", "Med. records", active2.fields["mi_dis_d"], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields["mi_dis_d"] = t1 if("ma_dis") if(active2) var/t1 = stripped_input("Please input major disabilities list:", "Med. records", active2.fields[DATACORE_DISABILITIES], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_DISABILITIES] = t1 if("ma_dis_d") if(active2) var/t1 = stripped_input("Please summarize major dis.:", "Med. records", active2.fields[DATACORE_DISABILITIES_DETAILS], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_DISABILITIES_DETAILS] = t1 if("alg") if(active2) var/t1 = stripped_input("Please state allergies:", "Med. records", active2.fields["alg"], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields["alg"] = t1 if("alg_d") if(active2) var/t1 = stripped_input("Please summarize allergies:", "Med. records", active2.fields["alg_d"], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields["alg_d"] = t1 if("cdi") if(active2) var/t1 = stripped_input("Please state diseases:", "Med. records", active2.fields[DATACORE_DISEASES], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_DISEASES] = t1 if("cdi_d") if(active2) var/t1 = stripped_input("Please summarize diseases:", "Med. records", active2.fields[DATACORE_DISEASES_DETAILS], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_DISEASES_DETAILS] = t1 if("notes") if(active2) var/t1 = stripped_input("Please summarize notes:", "Med. records", active2.fields[DATACORE_NOTES], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_NOTES] = t1 if("p_stat") @@ -362,7 +352,7 @@ if("b_dna") if(active2) var/t1 = stripped_input("Please input DNA hash:", "Med. records", active2.fields[DATACORE_BLOOD_DNA], null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_BLOOD_DNA] = t1 if("show_photo_front") @@ -469,7 +459,7 @@ return var/a2 = active2 var/t1 = stripped_multiline_input("Add Comment:", "Med. records", null, null) - if(!canUseMedicalRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return var/counter = 1 while(active2.fields[text("com_[]", counter)]) @@ -482,7 +472,7 @@ else if(href_list["search"]) var/t1 = stripped_input(usr, "Search String: (Name, DNA, or ID)", "Med. records") - if(!canUseMedicalRecordsConsole(usr, t1)) + if(!can_use_record_console(usr, t1)) return active1 = null active2 = null @@ -535,7 +525,7 @@ updateUsrDialog() return -/obj/machinery/computer/med_data/emp_act(severity) +/obj/machinery/computer/record/med/emp_act(severity) . = ..() if(!(machine_stat & (BROKEN|NOPOWER)) && !(. & EMP_PROTECT_SELF)) for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) @@ -563,17 +553,7 @@ qdel(R) continue -/obj/machinery/computer/med_data/proc/canUseMedicalRecordsConsole(mob/user, message = 1, record1, record2) - if(user) - if(message) - if(authenticated) - if(user.canUseTopic(src, !issilicon(user))) - if(!record1 || record1 == active1) - if(!record2 || record2 == active2) - return 1 - return 0 - -/obj/machinery/computer/med_data/laptop +/obj/machinery/computer/record/med/laptop name = "medical laptop" desc = "A cheap Nanotrasen medical laptop, it functions as a medical records computer. It's bolted to the table." icon_state = "laptop" diff --git a/code/game/machinery/computer/record/record.dm b/code/game/machinery/computer/record/record.dm new file mode 100644 index 000000000000..ac76ad5c0a49 --- /dev/null +++ b/code/game/machinery/computer/record/record.dm @@ -0,0 +1,26 @@ +/obj/machinery/computer/record//TODO:SANITY + name = "records console" + desc = "This can be used to check medical records." + icon_screen = "medcomp" + icon_keyboard = "med_key" + req_one_access = list() + circuit = /obj/item/circuitboard/computer + var/rank = null + var/screen = null + var/datum/data/record/active1 + var/datum/data/record/active2 + var/temp = null + var/printing = null + //Sorting Variables + var/sortBy = "name" + var/order = 1 // -1 = Descending - 1 = Ascending + +/obj/machinery/computer/record/proc/can_use_record_console(mob/user, message = 1, record1, record2) + if(user) + if(message) + if(authenticated) + if(user.canUseTopic(src, !issilicon(user))) + if(!record1 || record1 == active1) + if(!record2 || record2 == active2) + return TRUE + return FALSE diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/record/security.dm similarity index 96% rename from code/game/machinery/computer/security.dm rename to code/game/machinery/computer/record/security.dm index d9d27e7e49a9..5708610fdd6c 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/record/security.dm @@ -1,4 +1,4 @@ -/obj/machinery/computer/secure_data//TODO:SANITY +/obj/machinery/computer/record/sec//TODO:SANITY name = "security records console" desc = "Used to view and edit personnel's security records." icon_screen = "security" @@ -6,24 +6,14 @@ req_one_access = list(ACCESS_SECURITY, ACCESS_FORENSICS_LOCKERS) circuit = /obj/item/circuitboard/computer/secure_data light_color = COLOR_SOFT_RED - var/rank = null - var/screen = null - var/datum/data/record/active1 = null - var/datum/data/record/active2 = null - var/temp = null - var/printing = null var/can_change_id = 0 var/list/Perp var/tempname = null - //Sorting Variables - var/sortBy = "name" - var/order = 1 // -1 = Descending - 1 = Ascending - -/obj/machinery/computer/secure_data/syndie +/obj/machinery/computer/record/sec/syndie icon_keyboard = "syndie_key" -/obj/machinery/computer/secure_data/laptop +/obj/machinery/computer/record/sec/laptop name = "security laptop" desc = "A cheap Nanotrasen security laptop, it functions as a security records console. It's bolted to the table." icon_state = "laptop" @@ -33,7 +23,7 @@ unique_icon = TRUE //Someone needs to break down the dat += into chunks instead of long ass lines. -/obj/machinery/computer/secure_data/ui_interact(mob/user) +/obj/machinery/computer/record/sec/ui_interact(mob/user) . = ..() if(isliving(user)) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) @@ -241,7 +231,7 @@ /*Revised /N I can't be bothered to look more of the actual code outside of switch but that probably needs revising too. What a mess.*/ -/obj/machinery/computer/secure_data/Topic(href, href_list) +/obj/machinery/computer/record/sec/Topic(href, href_list) . = ..() if(.) return . @@ -429,7 +419,7 @@ What a mess.*/ return var/a2 = active2 var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null) - if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return var/counter = 1 while(active2.fields[text("com_[]", counter)]) @@ -519,7 +509,7 @@ What a mess.*/ if("name") if(istype(active1, /datum/data/record) || istype(active2, /datum/data/record)) var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active1.fields[DATACORE_NAME], MAX_MESSAGE_LEN) - if(!canUseSecurityRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return if(istype(active1, /datum/data/record)) active1.fields[DATACORE_NAME] = t1 @@ -528,7 +518,7 @@ What a mess.*/ if("id") if(istype(active2, /datum/data/record) || istype(active1, /datum/data/record)) var/t1 = stripped_input(usr, "Please input id:", "Secure. records", active1.fields[DATACORE_ID], null) - if(!canUseSecurityRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return if(istype(active1, /datum/data/record)) active1.fields[DATACORE_ID] = t1 @@ -537,7 +527,7 @@ What a mess.*/ if("fingerprint") if(istype(active1, /datum/data/record)) var/t1 = stripped_input(usr, "Please input fingerprint hash:", "Secure. records", active1.fields[DATACORE_FINGERPRINT], null) - if(!canUseSecurityRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return active1.fields[DATACORE_FINGERPRINT] = t1 if("gender") @@ -555,13 +545,13 @@ What a mess.*/ if (!t1) return - if(!canUseSecurityRecordsConsole(usr, "age", a1)) + if(!can_use_record_console(usr, "age", a1)) return active1.fields[DATACORE_AGE] = t1 if("species") if(istype(active1, /datum/data/record)) var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_races - if(!canUseSecurityRecordsConsole(usr, t1, a1)) + if(!can_use_record_console(usr, t1, a1)) return active1.fields[DATACORE_SPECIES] = t1 if("show_photo_front") @@ -619,7 +609,7 @@ What a mess.*/ return var/t1 = stripped_input(usr, "Please input crime names:", "Secure. records", "", null) var/t2 = stripped_input(usr, "Please input crime details:", "Secure. records", "", null) - if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return var/datum/data/record/security/security_record = active1 @@ -630,7 +620,7 @@ What a mess.*/ if(!istype(active1, /datum/data/record/security) || !href_list["cdataid"]) return - if(!canUseSecurityRecordsConsole(usr, "delete", null, a2)) + if(!can_use_record_console(usr, "delete", null, a2)) return var/crime_name @@ -652,7 +642,7 @@ What a mess.*/ var/t1 = stripped_input(usr, "Please input crime details:", "Secure. records", "", null) - if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return var/datum/data/record/security/security_record = active1 @@ -663,7 +653,7 @@ What a mess.*/ if("notes") if(istype(active2, /datum/data/record)) var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active2.fields[DATACORE_NOTES], null) - if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) + if(!can_use_record_console(usr, t1, null, a2)) return active2.fields[DATACORE_NOTES] = t1 if("criminal") @@ -743,7 +733,7 @@ What a mess.*/ updateUsrDialog() return -/obj/machinery/computer/secure_data/proc/get_photo(mob/user) +/obj/machinery/computer/record/sec/proc/get_photo(mob/user) var/obj/item/photo/P = null if(issilicon(user)) var/mob/living/silicon/tempAI = user @@ -754,7 +744,7 @@ What a mess.*/ P = user.get_active_held_item() return P -/obj/machinery/computer/secure_data/proc/print_photo(icon/temp, person_name) +/obj/machinery/computer/record/sec/proc/print_photo(icon/temp, person_name) if (printing) return printing = TRUE @@ -766,7 +756,7 @@ What a mess.*/ P.pixel_y = rand(-10, 10) printing = FALSE -/obj/machinery/computer/secure_data/emp_act(severity) +/obj/machinery/computer/record/sec/emp_act(severity) . = ..() if(machine_stat & (BROKEN|NOPOWER) || . & EMP_PROTECT_SELF) @@ -801,7 +791,7 @@ What a mess.*/ qdel(R) continue -/obj/machinery/computer/secure_data/proc/canUseSecurityRecordsConsole(mob/user, message1 = 0, record1, record2) +/obj/machinery/computer/record/sec/can_use_record_console(mob/user, message1 = 0, record1, record2) if(user) if(authenticated) if(user.canUseTopic(src, !issilicon(user))) diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 54dcfb36c131..2c7936d74126 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -232,7 +232,7 @@ /obj/item/circuitboard/computer/med_data name = "Medical Records Console (Computer Board)" icon_state = "medical" - build_path = /obj/machinery/computer/med_data + build_path = /obj/machinery/computer/record/med /obj/item/circuitboard/computer/operating name = "Operating Computer (Computer Board)" @@ -335,7 +335,7 @@ /obj/item/circuitboard/computer/secure_data name = "Security Records Console (Computer Board)" icon_state = "security" - build_path = /obj/machinery/computer/secure_data + build_path = /obj/machinery/computer/record/sec /obj/item/circuitboard/computer/warrant name = "Security Warrant Viewer (Computer Board)" diff --git a/shiptest.dme b/shiptest.dme index ee067028fd72..a638714f7e80 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -931,17 +931,18 @@ #include "code\game\machinery\computer\dna_console.dm" #include "code\game\machinery\computer\launchpad_control.dm" #include "code\game\machinery\computer\law.dm" -#include "code\game\machinery\computer\medical.dm" #include "code\game\machinery\computer\Operating.dm" #include "code\game\machinery\computer\pod.dm" #include "code\game\machinery\computer\robot.dm" -#include "code\game\machinery\computer\security.dm" #include "code\game\machinery\computer\station_alert.dm" #include "code\game\machinery\computer\teleporter.dm" #include "code\game\machinery\computer\warrant.dm" #include "code\game\machinery\computer\prisoner\_prisoner.dm" #include "code\game\machinery\computer\prisoner\gulag_teleporter.dm" #include "code\game\machinery\computer\prisoner\management.dm" +#include "code\game\machinery\computer\record\medical.dm" +#include "code\game\machinery\computer\record\record.dm" +#include "code\game\machinery\computer\record\security.dm" #include "code\game\machinery\doors\airlock.dm" #include "code\game\machinery\doors\airlock_electronics.dm" #include "code\game\machinery\doors\airlock_types.dm" From b13073047043bf7397a75f5d85a88e097b4492cf Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 20:22:13 -0500 Subject: [PATCH 11/47] idk rn --- code/controllers/subsystem/datacore.dm | 3 --- code/game/machinery/computer/record/record.dm | 9 +++++++++ code/game/objects/items/cards_ids.dm | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index ab36e50fe4c0..420ef81b8a27 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -16,7 +16,6 @@ SUBSYSTEM_DEF(datacore) ) var/securityPrintCount = 0 - var/securityCrimeCounter = 0 var/medicalPrintCount = 0 /// Set to TRUE when the initial roundstart manifest is complete @@ -31,7 +30,6 @@ SUBSYSTEM_DEF(datacore) /datum/controller/subsystem/datacore/Recover() library = SSdatacore.library - securityCrimeCounter = SSdatacore.securityCrimeCounter medicalPrintCount = SSdatacore.medicalPrintCount finished_setup = SSdatacore.finished_setup @@ -384,7 +382,6 @@ SUBSYSTEM_DEF(datacore) c.time = time c.fine = fine c.paid = 0 - c.dataId = ++securityCrimeCounter return c /datum/controller/subsystem/datacore/proc/get_id_photo(mob/living/carbon/human/H, client/C, show_directions = list(SOUTH), datum/job/J) diff --git a/code/game/machinery/computer/record/record.dm b/code/game/machinery/computer/record/record.dm index ac76ad5c0a49..f597608242bd 100644 --- a/code/game/machinery/computer/record/record.dm +++ b/code/game/machinery/computer/record/record.dm @@ -14,6 +14,15 @@ //Sorting Variables var/sortBy = "name" var/order = 1 // -1 = Descending - 1 = Ascending + var/datum/overmap/ship/controlled/linked_libary + +/obj/machinery/computer/record/initialize() + . = ..() + var/datum/overmap/ship/controlled/linked_ship = SSshuttle.get_ship(src) + if(linked_ship) + if(linked_ship.linked_libary) + linked_libary = linked_ship.linked_libary + return /obj/machinery/computer/record/proc/can_use_record_console(mob/user, message = 1, record1, record2) if(user) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 2e93b662799a..fc4a808e5751 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -388,6 +388,11 @@ return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]" //displays all overlays in chat return ..() +/obj/item/card/id/proc/get_libary() + for(var/datum/overmap/ship/controlled/ship in ship_access) + if(ship.get_records()) + return ship.get_records() + // Adds the referenced ship directly to the card /obj/item/card/id/proc/add_ship_access(datum/overmap/ship/controlled/ship) if (ship) From ff4890035a554aa93a0ef6588328c4d7f9c1f286 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 21:48:08 -0500 Subject: [PATCH 12/47] filing cabnit --- .../RockRuins/rockplanet_harmfactory.dmm | 2 +- .../whitesands_surface_onlyaspoonful.dmm | 2 +- .../wasteplanet_fortress_of_solitide.dmm | 8 +- _maps/map_files/generic/CentCom.dmm | 16 +- _maps/outpost/nanotrasen_asteroid.dmm | 4 +- .../shuttles/independent/independent_box.dmm | 2 +- .../independent/independent_rigger.dmm | 4 +- .../shuttles/nanotrasen/nanotrasen_mimir.dmm | 2 +- .../nanotrasen/nanotrasen_skipper.dmm | 2 +- .../syndicate/syndicate_litieguai.dmm | 2 +- code/controllers/subsystem/datacore.dm | 50 ++---- code/controllers/subsystem/overmap.dm | 27 --- .../computer/prisoner/gulag_teleporter.dm | 154 ------------------ code/game/machinery/computer/record/record.dm | 2 + code/game/objects/items/cards_ids.dm | 5 - .../circuitboards/computer_circuitboards.dm | 5 - code/game/objects/items/devices/PDA/PDA.dm | 6 - code/game/objects/items/devices/PDA/cart.dm | 4 - .../modules/mob/dead/new_player/new_player.dm | 8 - code/modules/mob/living/silicon/pai/pai.dm | 2 +- .../mob/living/silicon/pai/software.dm | 36 ++-- .../overmap/ships/controlled_ship_datum.dm | 3 - code/modules/paperwork/filingcabinet.dm | 142 +++++----------- shiptest.dme | 1 - 24 files changed, 92 insertions(+), 397 deletions(-) delete mode 100644 code/game/machinery/computer/prisoner/gulag_teleporter.dm diff --git a/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm b/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm index a41b8de72b59..5b08035b4494 100644 --- a/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm +++ b/_maps/RandomRuins/RockRuins/rockplanet_harmfactory.dmm @@ -285,7 +285,7 @@ /turf/open/floor/plating/rust, /area/ruin/powered) "gx" = ( -/obj/structure/filingcabinet/employment, +/obj/structure/filingcabinet/record/gen, /obj/structure/safe/floor, /obj/item/keycard/office, /turf/open/floor/plating/rust, diff --git a/_maps/RandomRuins/SandRuins/whitesands_surface_onlyaspoonful.dmm b/_maps/RandomRuins/SandRuins/whitesands_surface_onlyaspoonful.dmm index f74a8895976a..eae7cce43517 100644 --- a/_maps/RandomRuins/SandRuins/whitesands_surface_onlyaspoonful.dmm +++ b/_maps/RandomRuins/SandRuins/whitesands_surface_onlyaspoonful.dmm @@ -25,7 +25,7 @@ /turf/open/floor/plastic, /area/ruin/powered) "bh" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /turf/open/floor/plastic, /area/ruin/powered) "bo" = ( diff --git a/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm b/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm index 563c393ce1ef..245eff031151 100644 --- a/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm +++ b/_maps/RandomRuins/WasteRuins/wasteplanet_fortress_of_solitide.dmm @@ -3616,7 +3616,7 @@ /turf/open/floor/plating/rust, /area/ruin/powered) "HL" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /turf/open/floor/plating, /area/ruin/powered) "HR" = ( @@ -3756,7 +3756,7 @@ /turf/open/floor/plating, /area/ruin/powered) "IU" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /obj/effect/decal/cleanable/dirt/dust, /obj/effect/decal/cleanable/cobweb/cobweb2, /turf/open/floor/plating, @@ -4115,7 +4115,7 @@ /turf/closed/wall/r_wall/rust, /area/ruin/powered) "MC" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/effect/decal/cleanable/cobweb, /turf/open/floor/plating/rust, /area/ruin/powered) @@ -5578,7 +5578,7 @@ /turf/open/floor/plating, /area/ruin/powered) "ZJ" = ( -/obj/structure/filingcabinet/employment, +/obj/structure/filingcabinet/record/gen, /turf/open/floor/plating, /area/ruin/powered) "ZL" = ( diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index cef0b26caa4d..510008cdad3a 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -7226,7 +7226,7 @@ /turf/open/floor/plasteel, /area/tdome/tdomeobserve) "dsk" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, @@ -8179,7 +8179,7 @@ /turf/open/floor/plasteel/dark, /area/centcom/ferry) "fdr" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, @@ -13690,7 +13690,7 @@ /turf/open/floor/plasteel, /area/centcom/supply) "qxD" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/machinery/light/directional/north, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 @@ -14583,7 +14583,7 @@ /turf/open/floor/plasteel/dark, /area/tdome/tdomeobserve) "sho" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, @@ -15165,7 +15165,7 @@ /turf/open/floor/plasteel/dark, /area/ctf) "tyD" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /obj/effect/turf_decal/industrial/warning{ dir = 9 }, @@ -15204,7 +15204,7 @@ /turf/open/floor/plasteel/patterned/grid, /area/centcom) "tAB" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, @@ -16447,7 +16447,7 @@ /turf/open/floor/plasteel, /area/centcom/control) "wER" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 }, @@ -16733,7 +16733,7 @@ /turf/open/floor/plasteel, /area/centcom/evac) "xEN" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/effect/turf_decal/industrial/warning{ dir = 5 }, diff --git a/_maps/outpost/nanotrasen_asteroid.dmm b/_maps/outpost/nanotrasen_asteroid.dmm index cfafd5d4f317..28575e738378 100644 --- a/_maps/outpost/nanotrasen_asteroid.dmm +++ b/_maps/outpost/nanotrasen_asteroid.dmm @@ -4934,7 +4934,7 @@ /turf/open/floor/plasteel/dark, /area/outpost/cargo) "rO" = ( -/obj/structure/filingcabinet/security{ +/obj/structure/filingcabinet/record/security{ pixel_x = 11 }, /obj/machinery/newscaster/directional/east, @@ -10989,7 +10989,7 @@ /turf/open/floor/plasteel/patterned/grid, /area/outpost/hallway/fore) "MC" = ( -/obj/structure/filingcabinet/employment{ +/obj/structure/filingcabinet/record/gen{ pixel_x = -11 }, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/independent/independent_box.dmm b/_maps/shuttles/independent/independent_box.dmm index a0585ba1a0b5..b0ee83779b9c 100644 --- a/_maps/shuttles/independent/independent_box.dmm +++ b/_maps/shuttles/independent/independent_box.dmm @@ -2664,7 +2664,7 @@ /turf/open/floor/plating, /area/ship/crew) "RR" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/item/radio/intercom/directional/west, /turf/open/floor/plasteel/dark, /area/ship/crew) diff --git a/_maps/shuttles/independent/independent_rigger.dmm b/_maps/shuttles/independent/independent_rigger.dmm index 5dc6330d73ff..b01f45efd035 100644 --- a/_maps/shuttles/independent/independent_rigger.dmm +++ b/_maps/shuttles/independent/independent_rigger.dmm @@ -1390,7 +1390,7 @@ /turf/open/floor/plating, /area/ship/engineering/engine) "rH" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/machinery/airalarm/directional/south, /obj/effect/turf_decal/borderfloor{ dir = 6 @@ -4036,7 +4036,7 @@ /turf/open/floor/plating, /area/ship/engineering/atmospherics) "Vq" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /obj/machinery/newscaster/security_unit/directional/south, /turf/open/floor/plasteel/grimy, /area/ship/security) diff --git a/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm b/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm index f5ffea852281..8ce2a9928814 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm @@ -1139,7 +1139,7 @@ /turf/open/floor/plasteel, /area/ship/security/prison) "gF" = ( -/obj/structure/filingcabinet/security, +/obj/structure/filingcabinet/record/security, /obj/machinery/airalarm/directional/south, /obj/effect/turf_decal/siding/red, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm index e355c4ac306e..4f68a8f8f7c9 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm @@ -447,7 +447,7 @@ /turf/open/floor/plasteel/tech, /area/ship/engineering/atmospherics) "dW" = ( -/obj/structure/filingcabinet/employment, +/obj/structure/filingcabinet/record/gen, /turf/open/floor/carpet/nanoweave/blue, /area/ship/crew/office) "dX" = ( diff --git a/_maps/shuttles/syndicate/syndicate_litieguai.dmm b/_maps/shuttles/syndicate/syndicate_litieguai.dmm index afd14b289e19..17df98db94b2 100644 --- a/_maps/shuttles/syndicate/syndicate_litieguai.dmm +++ b/_maps/shuttles/syndicate/syndicate_litieguai.dmm @@ -2652,7 +2652,7 @@ /turf/open/floor/plasteel/tech, /area/ship/medical) "TZ" = ( -/obj/structure/filingcabinet/medical, +/obj/structure/filingcabinet/record/medical, /obj/machinery/airalarm/directional/east, /obj/machinery/light/directional/north, /turf/open/floor/carpet/cyan, diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index 420ef81b8a27..f6c1e492b622 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -152,34 +152,6 @@ SUBSYSTEM_DEF(datacore) return manifest_out -/datum/controller/subsystem/datacore/proc/get_manifest_html(record_key = DATACORE_RECORDS_OUTPOST, monochrome = FALSE) - var/list/manifest = get_manifest(record_key) - var/dat = {" - -
Name: [active1.fields[DATACORE_NAME]] 
ID: [active1.fields[DATACORE_ID]] 
- - "} - for(var/department in manifest) - var/list/entries = manifest[department] - dat += "" - //JUST - var/even = FALSE - for(var/entry in entries) - var/list/entry_list = entry - dat += "" - even = !even - - dat += "
NameRank
[department]
[entry_list["name"]][entry_list["rank"]]
" - dat = replacetext(dat, "\n", "") - dat = replacetext(dat, "\t", "") - return dat - /datum/controller/subsystem/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) var/static/list/show_directions = list(SOUTH, WEST) if(!(H.mind && (H.mind.assigned_role != H.mind.special_role))) @@ -198,7 +170,6 @@ SUBSYSTEM_DEF(datacore) if(!C) C = H.client - var/image = get_id_photo(H, C, show_directions) var/mutable_appearance/character_appearance = new(H.appearance) //General Record @@ -324,6 +295,19 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_GENDER] = "Other" G.fields[DATACORE_APPEARANCE] = character_appearance + G.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type.name + G.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes + G.fields[DATACORE_DISABILITIES] = "None" + G.fields[DATACORE_DISABILITIES_DETAILS] = "No minor disabilities have been declared." + G.fields[DATACORE_DISEASES] = "None" + G.fields[DATACORE_DISEASES_DETAILS] = "No diseases have been diagnosed at the moment." + + G.fields[DATACORE_ID] = id + G.fields[DATACORE_NAME] = H.real_name + G.fields[DATACORE_CRIMINAL_STATUS] = "None" + G.fields[DATACORE_CRIMES] = list() + G.fields[DATACORE_NOTES] = "No notes." + custom_library.inject_record(G) /** @@ -384,12 +368,4 @@ SUBSYSTEM_DEF(datacore) c.paid = 0 return c -/datum/controller/subsystem/datacore/proc/get_id_photo(mob/living/carbon/human/H, client/C, show_directions = list(SOUTH), datum/job/J) - var/datum/preferences/P - if(!C) - C = H.client - if(C) - P = C.prefs - return get_flat_human_icon(null, J, P, DUMMY_HUMAN_SLOT_MANIFEST, show_directions) - #undef DUMMY_HUMAN_SLOT_MANIFEST diff --git a/code/controllers/subsystem/overmap.dm b/code/controllers/subsystem/overmap.dm index 93852230b244..754eabde53d2 100644 --- a/code/controllers/subsystem/overmap.dm +++ b/code/controllers/subsystem/overmap.dm @@ -459,33 +459,6 @@ SUBSYSTEM_DEF(overmap) return manifest_out -/datum/controller/subsystem/overmap/proc/get_manifest_html(monochrome = FALSE) - var/list/manifest = get_manifest() - var/dat = {" - - - - "} - for(var/department in manifest) - var/list/entries = manifest[department] - dat += "" - var/even = FALSE - for(var/entry in entries) - var/list/entry_list = entry - dat += "" - even = !even - - dat += "
NameRank
[department]
[entry_list["name"]][entry_list["rank"]]
" - dat = replacetext(dat, "\n", "") - dat = replacetext(dat, "\t", "") - return dat - /datum/controller/subsystem/overmap/Recover() overmap_objects = SSovermap.overmap_objects controlled_ships = SSovermap.controlled_ships diff --git a/code/game/machinery/computer/prisoner/gulag_teleporter.dm b/code/game/machinery/computer/prisoner/gulag_teleporter.dm deleted file mode 100644 index 483ee6d02b8e..000000000000 --- a/code/game/machinery/computer/prisoner/gulag_teleporter.dm +++ /dev/null @@ -1,154 +0,0 @@ -//computer that handle the points and teleports the prisoner -/obj/machinery/computer/prisoner/gulag_teleporter_computer - name = "labor camp teleporter console" - desc = "Used to send criminals to the Labor Camp." - icon_screen = "explosive" - icon_keyboard = "security_key" - req_access = list(ACCESS_ARMORY) - circuit = /obj/item/circuitboard/computer/gulag_teleporter_console - light_color = COLOR_SOFT_RED - - var/default_goal = 200 - var/obj/machinery/gulag_teleporter/teleporter = null - var/obj/structure/gulag_beacon/beacon = null - var/mob/living/carbon/human/prisoner = null - var/datum/data/record/temporary_record = null - - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/Initialize() - . = ..() - scan_machinery() - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_interact(mob/user, datum/tgui/ui) - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "GulagTeleporterConsole", name) - ui.open() - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_data(mob/user) - var/list/data = list() - - var/list/prisoner_list = list() - var/can_teleport = FALSE - - if(teleporter && (teleporter.occupant && ishuman(teleporter.occupant))) - prisoner = teleporter.occupant - prisoner_list["name"] = prisoner.real_name - if(contained_id) - can_teleport = TRUE - if(!isnull(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - for(var/r in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - var/datum/data/record/R = r - if(R.fields[DATACORE_NAME] == prisoner_list["name"]) - temporary_record = R - prisoner_list["crimstat"] = temporary_record.fields[DATACORE_CRIMINAL_STATUS] - - data["prisoner"] = prisoner_list - - if(teleporter) - data["teleporter"] = teleporter - data["teleporter_location"] = "([teleporter.x], [teleporter.y], [teleporter.virtual_z()])" - data["teleporter_lock"] = teleporter.locked - data["teleporter_state_open"] = teleporter.state_open - else - data["teleporter"] = null - if(beacon) - data["beacon"] = beacon - data["beacon_location"] = "([beacon.x], [beacon.y], [beacon.virtual_z()])" - else - data["beacon"] = null - if(contained_id) - data["id"] = contained_id - data["id_name"] = contained_id.registered_name - data["goal"] = contained_id.goal - else - data["id"] = null - data["can_teleport"] = can_teleport - - return data - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_act(action, list/params) - . = ..() - if(.) - return - if(isliving(usr)) - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) - if(!allowed(usr)) - to_chat(usr, "Access denied.") - return - switch(action) - if("scan_teleporter") - teleporter = findteleporter() - return TRUE - if("scan_beacon") - beacon = findbeacon() - return TRUE - if("handle_id") - if(contained_id) - id_eject(usr) - else - id_insert(usr) - return TRUE - if("set_goal") - var/new_goal = text2num(params["value"]) - if(!isnum(new_goal)) - return - if(!new_goal) - new_goal = default_goal - contained_id.goal = clamp(new_goal, 0, 1000) //maximum 1000 points - return TRUE - if("toggle_open") - if(teleporter.locked) - to_chat(usr, "The teleporter must be unlocked first.") - return - teleporter.toggle_open() - return TRUE - if("teleporter_lock") - if(teleporter.state_open) - to_chat(usr, "The teleporter must be closed first.") - return - teleporter.locked = !teleporter.locked - return TRUE - if("teleport") - if(!teleporter || !beacon) - return - addtimer(CALLBACK(src, PROC_REF(teleport), usr), 5) - return TRUE - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/proc/scan_machinery() - teleporter = findteleporter() - beacon = findbeacon() - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/proc/findteleporter() - var/obj/machinery/gulag_teleporter/teleporterf = null - - for(var/direction in GLOB.cardinals) - teleporterf = locate(/obj/machinery/gulag_teleporter, get_step(src, direction)) - if(teleporterf?.is_operational) - return teleporterf - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/proc/findbeacon() - return locate(/obj/structure/gulag_beacon) - -/obj/machinery/computer/prisoner/gulag_teleporter_computer/proc/teleport(mob/user) - if(!contained_id) //incase the ID was removed after the transfer timer was set. - say("Warning: Unable to transfer prisoner without a valid Prisoner ID inserted!") - return - var/id_goal_not_set - if(!contained_id.goal) - id_goal_not_set = TRUE - contained_id.goal = default_goal - say("[contained_id]'s ID card goal defaulting to [contained_id.goal] points.") - log_game("[key_name(user)] teleported [key_name(prisoner)] to the Labor Camp [COORD(beacon)] for [id_goal_not_set ? "default goal of ":""][contained_id.goal] points.") - teleporter.handle_prisoner(contained_id, temporary_record) - playsound(src, 'sound/weapons/emitter.ogg', 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - prisoner.forceMove(get_turf(beacon)) - prisoner.Paralyze(40) // small travel dizziness - to_chat(prisoner, "The teleportation makes you a little dizzy.") - new /obj/effect/particle_effect/sparks(get_turf(prisoner)) - playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - if(teleporter.locked) - teleporter.locked = FALSE - teleporter.toggle_open() - contained_id = null - temporary_record = null diff --git a/code/game/machinery/computer/record/record.dm b/code/game/machinery/computer/record/record.dm index f597608242bd..79628b973b0d 100644 --- a/code/game/machinery/computer/record/record.dm +++ b/code/game/machinery/computer/record/record.dm @@ -14,6 +14,7 @@ //Sorting Variables var/sortBy = "name" var/order = 1 // -1 = Descending - 1 = Ascending +/* var/datum/overmap/ship/controlled/linked_libary /obj/machinery/computer/record/initialize() @@ -23,6 +24,7 @@ if(linked_ship.linked_libary) linked_libary = linked_ship.linked_libary return +*/ /obj/machinery/computer/record/proc/can_use_record_console(mob/user, message = 1, record1, record2) if(user) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index fc4a808e5751..2e93b662799a 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -388,11 +388,6 @@ return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]" //displays all overlays in chat return ..() -/obj/item/card/id/proc/get_libary() - for(var/datum/overmap/ship/controlled/ship in ship_access) - if(ship.get_records()) - return ship.get_records() - // Adds the referenced ship directly to the card /obj/item/card/id/proc/add_ship_access(datum/overmap/ship/controlled/ship) if (ship) diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 2c7936d74126..e5704edbd739 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -322,11 +322,6 @@ //Security -/obj/item/circuitboard/computer/gulag_teleporter_console - name = "Labor Camp teleporter console (Computer Board)" - icon_state = "security" - build_path = /obj/machinery/computer/prisoner/gulag_teleporter_computer - /obj/item/circuitboard/computer/prisoner name = "Prisoner Management Console (Computer Board)" icon_state = "security" diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index e259e56ccd0e..e58eb6486687 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -361,12 +361,6 @@ GLOBAL_LIST_EMPTY(PDAs) dat += tnote dat += "
" - if(41) //crew manifest - dat += "

Crew Manifest

" - dat += "
" - dat += SSovermap.get_manifest_html() - dat += "
" - if(3) dat += "

[PDAIMG(atmos)] Atmospheric Readings

" diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 30e5a9d11e2e..8e7b2df16af3 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -231,10 +231,6 @@ Code: + +

Send Signal
"} - if (41) //crew manifest - menu = "

[PDAIMG(notes)] Crew Manifest

" - menu += "
[SSovermap.get_manifest_html()]
" - if (42) //status displays menu = "

[PDAIMG(status)] Station Status Display Interlink

" diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index ba7f5446c9e8..15090a279bbb 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -331,7 +331,6 @@ //SSdatacore.manifest_inject(humanc) ship.add_mob_to_crew_guestbook(humanc) AnnounceArrival(humanc, job.name, ship) - AddEmploymentContract(humanc) SSblackbox.record_feedback("tally", "species_spawned", 1, humanc.dna.species.name) if(GLOB.summon_guns_triggered) @@ -351,13 +350,6 @@ minor_announce("[job.name] [character.real_name] on deck!", zlevel = ship.shuttle_port.virtual_z()) return TRUE -/mob/dead/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee) - //TODO: figure out a way to exclude wizards/nukeops/demons from this. - for(var/C in GLOB.employmentCabinets) - var/obj/structure/filingcabinet/employment/employmentCabinet = C - if(!employmentCabinet.virgin) - employmentCabinet.addFile(employee) - /mob/dead/new_player/proc/LateChoices() if(auth_check) return diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 1f574f08a450..4727b0c0cf09 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -45,7 +45,7 @@ var/secHUD = 0 // Toggles whether the Security HUD is active or not var/medHUD = 0 // Toggles whether the Medical HUD is active or not - var/datum/data/record/medicalActive1 // Datacore record declarations for record software + var/datum/data/record/active_record // Datacore record declarations for record software var/datum/data/record/medicalActive2 var/datum/data/record/securityActive1 // Could probably just combine all these into one diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index de9f36f00613..667c7c6d68d6 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -308,21 +308,15 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( if("medicalrecord") // Accessing medical records if(subscreen == 1) - medicalActive1 = SSdatacore.find_record(DATACORE_ID, href_list["med_rec"], DATACORE_RECORDS_OUTPOST) - if(medicalActive1) - medicalActive2 = SSdatacore.find_record(DATACORE_ID, href_list["med_rec"], DATACORE_RECORDS_MEDICAL) - if(!medicalActive2) - medicalActive1 = null - temp = "Unable to locate requested security record. Record may have been deleted, or never have existed." + active_record = SSdatacore.find_record(DATACORE_ID, href_list["med_rec"], DATACORE_RECORDS_OUTPOST) + if(!active_record) + temp = "Unable to locate requested record. Record may have been deleted, or never have existed." if("securityrecord") if(subscreen == 1) - securityActive1 = SSdatacore.find_record(DATACORE_ID, href_list["sec_rec"], DATACORE_RECORDS_OUTPOST) - if(securityActive1) - securityActive2 = SSdatacore.find_record(DATACORE_ID, href_list["sec_rec"], DATACORE_RECORDS_SECURITY) - if(!securityActive2) - securityActive1 = null - temp = "Unable to locate requested security record. Record may have been deleted, or never have existed." + active_record = SSdatacore.find_record(DATACORE_ID, href_list["sec_rec"], DATACORE_RECORDS_OUTPOST) + if(!active_record) + temp = "Unable to locate requested record. Record may have been deleted, or never have existed." if("securityhud") if(href_list["toggle"]) @@ -546,12 +540,9 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( . += "[R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
" if(1) . += "
Medical Record

" - if(medicalActive1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - . += "Name: [medicalActive1.fields[DATACORE_NAME]] ID: [medicalActive1.fields[DATACORE_ID]]
\nGender: [medicalActive1.fields[DATACORE_GENDER]]
\nAge: [medicalActive1.fields[DATACORE_AGE]]
\nFingerprint: [medicalActive1.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [medicalActive1.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [medicalActive1.fields[DATACORE_MENTAL_HEALTH]]
" - else - . += "
Requested medical record not found.

" - if(medicalActive2 in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - . += "
\n
Medical Data

\nBlood Type:
[medicalActive2.fields[DATACORE_BLOOD_TYPE]]
\nDNA (UE): [medicalActive2.fields[DATACORE_BLOOD_DNA]]
\n
\nMinor Disabilities: [medicalActive2.fields["mi_dis"]]
\nDetails: [medicalActive2.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [medicalActive2.fields[DATACORE_DISABILITIES]]
\nDetails: [medicalActive2.fields[DATACORE_DISABILITIES_DETAILS]]
\n
\nAllergies: [medicalActive2.fields["alg"]]
\nDetails: [medicalActive2.fields["alg_d"]]
\n
\nCurrent Diseases: [medicalActive2.fields[DATACORE_DISEASES]] (per disease info placed in log/comment section)
\nDetails: [medicalActive2.fields[DATACORE_DISEASES_DETAILS]]
\n
\nImportant Notes:
\n\t[medicalActive2.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" + if(active_record in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) + . += "Name: [active_record.fields[DATACORE_NAME]] ID: [active_record.fields[DATACORE_ID]]
\nGender: [active_record.fields[DATACORE_GENDER]]
\nAge: [active_record.fields[DATACORE_AGE]]
\nFingerprint: [active_record.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [active_record.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [active_record.fields[DATACORE_MENTAL_HEALTH]]
" + . += "
\n
Medical Data

\nBlood Type: [active_record.fields[DATACORE_BLOOD_TYPE]]
\nDNA (UE): [active_record.fields[DATACORE_BLOOD_DNA]]
\n
\nMinor Disabilities: [active_record.fields["mi_dis"]]
\nDetails: [active_record.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [active_record.fields[DATACORE_DISABILITIES]]
\nDetails: [active_record.fields[DATACORE_DISABILITIES_DETAILS]]
\n
\nAllergies: [active_record.fields["alg"]]
\nDetails: [active_record.fields["alg_d"]]
\n
\nCurrent Diseases: [active_record.fields[DATACORE_DISEASES]] (per disease info placed in log/comment section)
\nDetails: [active_record.fields[DATACORE_DISEASES_DETAILS]]
\n
\nImportant Notes:
\n\t[active_record.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" else . += "
Requested medical record not found.

" . += "
\nBack
" @@ -568,12 +559,9 @@ GLOBAL_LIST_INIT(pai_faces_icons, list( . += "[R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
" if(1) . += "

Security Record

" - if(securityActive1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - . += "Name:
[securityActive1.fields[DATACORE_NAME]] ID: [securityActive1.fields[DATACORE_ID]]
\nGender: [securityActive1.fields[DATACORE_GENDER]]
\nAge: [securityActive1.fields[DATACORE_AGE]]
\nRank: [securityActive1.fields[DATACORE_RANK]]
\nFingerprint: [securityActive1.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [securityActive1.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [securityActive1.fields[DATACORE_MENTAL_HEALTH]]
" - else - . += "
Requested security record not found,

" - if(securityActive2 in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - . += "
\nSecurity Data
\nCriminal Status: [securityActive2.fields[DATACORE_CRIMINAL_STATUS]]
\n
\nCrimes: [securityActive2.fields[DATACORE_CRIMES]]
\nDetails: [securityActive2.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[securityActive2.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" + if(active_record in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) + . += "Name: [active_record.fields[DATACORE_NAME]] ID: [active_record.fields[DATACORE_ID]]
\nGender: [active_record.fields[DATACORE_GENDER]]
\nAge: [active_record.fields[DATACORE_AGE]]
\nRank: [active_record.fields[DATACORE_RANK]]
\nFingerprint: [active_record.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [active_record.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [active_record.fields[DATACORE_MENTAL_HEALTH]]
" + . += "
\nSecurity Data
\nCriminal Status: [active_record.fields[DATACORE_CRIMINAL_STATUS]]
\n
\nCrimes: [active_record.fields[DATACORE_CRIMES]]
\nDetails: [active_record.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[active_record.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" else . += "
Requested security record not found,

" . += "
\nBack
" diff --git a/code/modules/overmap/ships/controlled_ship_datum.dm b/code/modules/overmap/ships/controlled_ship_datum.dm index 1653a94170ab..cc23d3463321 100644 --- a/code/modules/overmap/ships/controlled_ship_datum.dm +++ b/code/modules/overmap/ships/controlled_ship_datum.dm @@ -442,9 +442,6 @@ SStgui.close_uis(helm) helm.say(helm_locked ? "Helm console is now locked." : "Helm console has been unlocked.") -/datum/overmap/ship/controlled/proc/get_records() - return ship_record - /obj/item/key/ship name = "ship key" desc = "A key for locking and unlocking the helm of a ship, comes with a ball chain so it can be worn around the neck. Comes with a cute little shuttle-shaped keychain." diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index b90c23c76550..ce5fd9d65f32 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -125,115 +125,57 @@ /* * Security Record Cabinets */ -/obj/structure/filingcabinet/security + +/obj/structure/filingcabinet/record + var/datum/overmap/ship/controlled/linked_ship var/virgin = 1 -/obj/structure/filingcabinet/security/proc/populate() - if(virgin) - for(var/datum/data/record/G in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - var/datum/data/record/S = SSdatacore.get_record_by_name(G.fields[DATACORE_NAME], DATACORE_RECORDS_SECURITY) - if(!S) - continue - var/obj/item/paper/sec_record_paper = new /obj/item/paper(src) - var/sec_record_text = "
Security Record

" - sec_record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" - sec_record_text += "
\n
Security Data

\nCriminal Status: [S.fields[DATACORE_CRIMINAL_STATUS]]
\n
\nCrimes: [S.fields[DATACORE_CRIMES]]
\nDetails: [S.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[S.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" - var/counter = 1 - while(S.fields["com_[counter]"]) - sec_record_text += "[S.fields["com_[counter]"]]
" - counter++ - sec_record_text += "" - sec_record_paper.add_raw_text(sec_record_text) - sec_record_paper.name = "paper - '[G.fields[DATACORE_NAME]]'" - sec_record_paper.update_appearance() - virgin = 0 //tabbing here is correct- it's possible for people to try and use it - //before the records have been generated, so we do this inside the loop. +/obj/structure/filingcabinet/record/Initialize() + . = ..() + linked_ship = SSshuttle.get_ship(src) + +/obj/structure/filingcabinet/record/proc/populate() + return -/obj/structure/filingcabinet/security/attack_hand() +/obj/structure/filingcabinet/record/attack_hand() populate() . = ..() -/obj/structure/filingcabinet/security/attack_tk() +/obj/structure/filingcabinet/record/attack_tk() populate() ..() -/* - * Medical Record Cabinets - */ -/obj/structure/filingcabinet/medical - var/virgin = 1 - -/obj/structure/filingcabinet/medical/proc/populate() +/obj/structure/filingcabinet/record/populate() if(virgin) - for(var/datum/data/record/G in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - var/datum/data/record/M = SSdatacore.get_record_by_name(G.fields[DATACORE_NAME], DATACORE_RECORDS_MEDICAL) - if(!M) - continue - var/obj/item/paper/med_record_paper = new /obj/item/paper(src) - var/med_record_text = "
Medical Record

" - med_record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" - med_record_text += "
\n
Medical Data

\nBlood Type: [M.fields[DATACORE_BLOOD_TYPE]]
\nDNA: [M.fields[DATACORE_BLOOD_DNA]]
\n
\nMinor Disabilities: [M.fields["mi_dis"]]
\nDetails: [M.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [M.fields[DATACORE_DISABILITIES]]
\nDetails: [M.fields[DATACORE_DISABILITIES_DETAILS]]
\n
\nAllergies: [M.fields["alg"]]
\nDetails: [M.fields["alg_d"]]
\n
\nCurrent Diseases: [M.fields[DATACORE_DISEASES]] (per disease info placed in log/comment section)
\nDetails: [M.fields[DATACORE_DISEASES_DETAILS]]
\n
\nImportant Notes:
\n\t[M.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" - var/counter = 1 - while(M.fields["com_[counter]"]) - med_record_text += "[M.fields["com_[counter]"]]
" - counter++ - med_record_text += "" - med_record_paper.add_raw_text(med_record_text) - med_record_paper.name = "paper - '[G.fields[DATACORE_NAME]]'" - med_record_paper.update_appearance() + for(var/datum/data/record/G in SSdatacore.get_records(linked_ship)) + var/obj/item/paper/record_paper = new /obj/item/paper(src) + var/record_text = get_record_text(G) + record_paper.add_raw_text(record_text) + record_paper.name = "paper - '[G.fields[DATACORE_NAME]]'" + record_paper.update_appearance() virgin = 0 //tabbing here is correct- it's possible for people to try and use it //before the records have been generated, so we do this inside the loop. - -//ATTACK HAND IGNORING PARENT RETURN VALUE -/obj/structure/filingcabinet/medical/attack_hand() - populate() - . = ..() - -/obj/structure/filingcabinet/medical/attack_tk() - populate() - ..() - -/* - * Employment contract Cabinets - */ - -GLOBAL_LIST_EMPTY(employmentCabinets) - -/obj/structure/filingcabinet/employment - var/cooldown = 0 - icon_state = "employmentcabinet" - var/virgin = 1 - -/obj/structure/filingcabinet/employment/Initialize() - . = ..() - GLOB.employmentCabinets += src - -/obj/structure/filingcabinet/employment/Destroy() - GLOB.employmentCabinets -= src - return ..() - -/obj/structure/filingcabinet/employment/proc/fillCurrent() - //This proc fills the cabinet with the current crew. - for(var/record in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - var/datum/data/record/G = record - if(!G) - continue - var/datum/mind/M = G.fields[DATACORE_MINDREF] - if(M && ishuman(M.current)) - addFile(M.current) - - -/obj/structure/filingcabinet/employment/proc/addFile(mob/living/carbon/human/employee) - new /obj/item/paper/contract/employment(src, employee) - -/obj/structure/filingcabinet/employment/interact(mob/user) - if(!cooldown) - if(virgin) - fillCurrent() - virgin = 0 - cooldown = TRUE - // prevents the devil from just instantly emptying the cabinet, ensuring an easy win. - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 10 SECONDS) - else - to_chat(user, "[src] is jammed, give it a few seconds.") - ..() + linked_ship = null + +/obj/structure/filingcabinet/record/proc/get_record_text(datum/data/record/G) + return + +/obj/structure/filingcabinet/record/security/get_record_text(datum/data/record/G) + var/record_text = "
Security Record

" + record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" + record_text += "
\n
Security Data

\nCriminal Status: [G.fields[DATACORE_CRIMINAL_STATUS]]
\n
\nCrimes: [G.fields[DATACORE_CRIMES]]
\nDetails: [G.fields["crim_d"]]
\n
\nImportant Notes:
\n\t[G.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" + record_text += "" + return record_text + +/obj/structure/filingcabinet/record/medical/get_record_text(datum/data/record/G) + var/record_text = "
Medical Record

" + record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" + record_text += "
\n
Medical Data

\nBlood Type: [G.fields[DATACORE_BLOOD_TYPE]]
\nDNA: [G.fields[DATACORE_BLOOD_DNA]]
\n
\nMinor Disabilities: [G.fields["mi_dis"]]
\nDetails: [G.fields["mi_dis_d"]]
\n
\nMajor Disabilities: [G.fields[DATACORE_DISABILITIES]]
\nDetails: [G.fields[DATACORE_DISABILITIES_DETAILS]]
\n
\nAllergies: [G.fields["alg"]]
\nDetails: [G.fields["alg_d"]]
\n
\nCurrent Diseases: [G.fields[DATACORE_DISEASES]] (per disease info placed in log/comment section)
\nDetails: [G.fields[DATACORE_DISEASES_DETAILS]]
\n
\nImportant Notes:
\n\t[G.fields[DATACORE_NOTES]]
\n
\n
Comments/Log

" + record_text += "" + return record_text + +/obj/structure/filingcabinet/record/gen/get_record_text(datum/data/record/G) + var/record_text = "
General Record

" + record_text += "Name: [G.fields[DATACORE_NAME]] ID: [G.fields[DATACORE_ID]]
\nGender: [G.fields[DATACORE_GENDER]]
\nAge: [G.fields[DATACORE_AGE]]
\nFingerprint: [G.fields[DATACORE_FINGERPRINT]]
\nPhysical Status: [G.fields[DATACORE_PHYSICAL_HEALTH]]
\nMental Status: [G.fields[DATACORE_MENTAL_HEALTH]]
" + record_text += "" + return record_text diff --git a/shiptest.dme b/shiptest.dme index a638714f7e80..ad4cedf2502c 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -938,7 +938,6 @@ #include "code\game\machinery\computer\teleporter.dm" #include "code\game\machinery\computer\warrant.dm" #include "code\game\machinery\computer\prisoner\_prisoner.dm" -#include "code\game\machinery\computer\prisoner\gulag_teleporter.dm" #include "code\game\machinery\computer\prisoner\management.dm" #include "code\game\machinery\computer\record\medical.dm" #include "code\game\machinery\computer\record\record.dm" From c27d7c14eeb205de1da2e932d234c3512a1712da Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 22:05:26 -0500 Subject: [PATCH 13/47] no more 3 records --- code/controllers/subsystem/datacore.dm | 104 +----------------- .../modules/mob/dead/new_player/new_player.dm | 2 +- code/modules/paperwork/filingcabinet.dm | 2 +- 3 files changed, 3 insertions(+), 105 deletions(-) diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index f6c1e492b622..b9c11f623ec6 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -83,7 +83,7 @@ SUBSYSTEM_DEF(datacore) log_manifest(N.ckey, N.new_character.mind, N.new_character) if(ishuman(N.new_character)) - manifest_inject(N.new_character, N.client) + library_inject(N.new_character, N.client, DATACORE_RECORDS_OUTPOST) CHECK_TICK @@ -152,108 +152,6 @@ SUBSYSTEM_DEF(datacore) return manifest_out -/datum/controller/subsystem/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) - var/static/list/show_directions = list(SOUTH, WEST) - if(!(H.mind && (H.mind.assigned_role != H.mind.special_role))) - return - - var/assignment - if(H.mind.assigned_role) - assignment = H.mind.assigned_role - else if(H.job) - assignment = H.job - else - assignment = "Unassigned" - - var/static/record_id_num = 1001 - var/id = num2hex(record_id_num++,6) - if(!C) - C = H.client - - var/mutable_appearance/character_appearance = new(H.appearance) - - //General Record - var/datum/data/record/general/G = new() - G.fields[DATACORE_ID] = id - - G.fields[DATACORE_NAME] = H.real_name - G.fields[DATACORE_RANK] = assignment - G.fields[DATACORE_INITIAL_RANK] = assignment - G.fields[DATACORE_AGE] = H.age - G.fields[DATACORE_SPECIES] = H.dna.species.name - G.fields[DATACORE_FINGERPRINT] = md5(H.dna.uni_identity) - G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" - G.fields[DATACORE_MENTAL_HEALTH] = "Stable" - G.fields[DATACORE_GENDER] = H.gender - if(H.gender == "male") - G.fields[DATACORE_GENDER] = "Male" - else if(H.gender == "female") - G.fields[DATACORE_GENDER] = "Female" - else - G.fields[DATACORE_GENDER] = "Other" - G.fields[DATACORE_APPEARANCE] = character_appearance - - library[DATACORE_RECORDS_OUTPOST].inject_record(G) - -/* - // Add to company-specific manifests - var/datum/job_department/department = SSjob.departments_by_type[job.departments_list?[1]] - if(department?.manifest_key) - library[department.manifest_key].inject_record(G) -*/ - - //Medical Record - var/datum/data/record/medical/M = new() - M.fields[DATACORE_ID] = id - M.fields[DATACORE_NAME] = H.real_name - M.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type.name - M.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes - M.fields[DATACORE_DISABILITIES] = "None" - M.fields[DATACORE_DISABILITIES_DETAILS] = "No minor disabilities have been declared." - M.fields[DATACORE_DISEASES] = "None" - M.fields[DATACORE_DISEASES_DETAILS] = "No diseases have been diagnosed at the moment." - M.fields[DATACORE_NOTES] = H.get_trait_string() - library[DATACORE_RECORDS_MEDICAL].inject_record(M) - - //Security Record - var/datum/data/record/security/S = new() - S.fields[DATACORE_ID] = id - S.fields[DATACORE_NAME] = H.real_name - S.fields[DATACORE_CRIMINAL_STATUS] = "None" - //S.fields[DATACORE_CITATIONS] = list() - S.fields[DATACORE_CRIMES] = list() - S.fields[DATACORE_NOTES] = "No notes." - library[DATACORE_RECORDS_SECURITY].inject_record(S) - - /* - //Locked Record - var/datum/data/record/locked/L = new() - L.fields[DATACORE_ID] = id - L.fields[DATACORE_NAME] = H.real_name - L.fields[DATACORE_RANK] = assignment - G.fields[DATACORE_INITIAL_RANK] = assignment - L.fields[DATACORE_AGE] = H.age - L.fields[DATACORE_GENDER] = H.gender - if(H.gender == "male") - G.fields[DATACORE_GENDER] = "Male" - else if(H.gender == "female") - G.fields[DATACORE_GENDER] = "Female" - else - G.fields[DATACORE_GENDER] = "Other" - L.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type - L.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes - L.fields[DATACORE_DNA_IDENTITY] = H.dna.uni_identity - L.fields[DATACORE_SPECIES] = H.dna.species.type - L.fields[DATACORE_DNA_FEATURES] = H.dna.features - //L.fields[DATACORE_APPEARANCE] = character_appearance - L.fields[DATACORE_IMAGE] = image - L.fields[DATACORE_MINDREF] = H.mind - library[DATACORE_RECORDS_LOCKED].inject_record(L) - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MANIFEST_INJECT, G, M, S, L) - */ - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MANIFEST_INJECT, G, M, S) - return - //For ship records /datum/controller/subsystem/datacore/proc/inject_library(mob/living/carbon/human/H, client/C, datum/data_library/custom_library) var/static/list/show_directions = list(SOUTH, WEST) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 15090a279bbb..a29a88f9d31b 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -328,7 +328,7 @@ if(ishuman(character)) //These procs all expect humans var/mob/living/carbon/human/humanc = character ship.manifest_inject(humanc, client, job) - //SSdatacore.manifest_inject(humanc) + SSdatacore.library_inject(humanc, client, DATACORE_RECORDS_OUTPOST) ship.add_mob_to_crew_guestbook(humanc) AnnounceArrival(humanc, job.name, ship) SSblackbox.record_feedback("tally", "species_spawned", 1, humanc.dna.species.name) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index ce5fd9d65f32..8e272326e4de 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -151,7 +151,7 @@ var/obj/item/paper/record_paper = new /obj/item/paper(src) var/record_text = get_record_text(G) record_paper.add_raw_text(record_text) - record_paper.name = "paper - '[G.fields[DATACORE_NAME]]'" + record_paper.name = "paper - '[linked_ship.name] - [G.fields[DATACORE_NAME]]'" record_paper.update_appearance() virgin = 0 //tabbing here is correct- it's possible for people to try and use it //before the records have been generated, so we do this inside the loop. From 7b9886e19b7606fdeabceed97d0d4f5d8b956466 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 22:10:26 -0500 Subject: [PATCH 14/47] agh --- code/controllers/subsystem/datacore.dm | 2 +- code/modules/mob/dead/new_player/new_player.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index b9c11f623ec6..4d5e295e4dd5 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -83,7 +83,7 @@ SUBSYSTEM_DEF(datacore) log_manifest(N.ckey, N.new_character.mind, N.new_character) if(ishuman(N.new_character)) - library_inject(N.new_character, N.client, DATACORE_RECORDS_OUTPOST) + inject_library(N.new_character, N.client, DATACORE_RECORDS_OUTPOST) CHECK_TICK diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index a29a88f9d31b..cbd122e76b36 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -328,7 +328,7 @@ if(ishuman(character)) //These procs all expect humans var/mob/living/carbon/human/humanc = character ship.manifest_inject(humanc, client, job) - SSdatacore.library_inject(humanc, client, DATACORE_RECORDS_OUTPOST) + SSdatacore.inject_library(humanc, client, DATACORE_RECORDS_OUTPOST) ship.add_mob_to_crew_guestbook(humanc) AnnounceArrival(humanc, job.name, ship) SSblackbox.record_feedback("tally", "species_spawned", 1, humanc.dna.species.name) From a61cef5846df43474da9bf2a2b42d34fc10fc292 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 22:20:20 -0500 Subject: [PATCH 15/47] ahh --- code/controllers/subsystem/datacore.dm | 2 +- .../machinery/computer/record/security.dm | 302 +++++++++--------- code/modules/datacore/records.dm | 16 +- code/modules/mob/living/carbon/human/human.dm | 2 +- 4 files changed, 151 insertions(+), 171 deletions(-) diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index 4d5e295e4dd5..ea14bff5c01c 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -174,7 +174,7 @@ SUBSYSTEM_DEF(datacore) var/mutable_appearance/character_appearance = new(H.appearance) //General Record - var/datum/data/record/general/G = new() + var/datum/data/record/G = new() G.fields[DATACORE_ID] = id G.fields[DATACORE_NAME] = H.real_name G.fields[DATACORE_RANK] = assignment diff --git a/code/game/machinery/computer/record/security.dm b/code/game/machinery/computer/record/security.dm index 5708610fdd6c..9ef2ff4d7fdf 100644 --- a/code/game/machinery/computer/record/security.dm +++ b/code/game/machinery/computer/record/security.dm @@ -150,25 +150,25 @@ dat += "
Delete All Records

Back" if(3) dat += "Security Record
" - if(istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)) - var/front_photo = active1.get_front_photo() + if(istype(active_record, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active_record)) + var/front_photo = active_record.get_front_photo() if(istype(front_photo, /obj/item/photo)) var/obj/item/photo/photo_front = front_photo user << browse_rsc(photo_front.picture.picture_image, "photo_front") - var/side_photo = active1.get_side_photo() + var/side_photo = active_record.get_side_photo() if(istype(side_photo, /obj/item/photo)) var/obj/item/photo/photo_side = side_photo user << browse_rsc(photo_side.picture.picture_image, "photo_side") dat += {"
- - - - "} - dat += "" - dat += {" - - - + + + + "} + dat += "" + dat += {" + + +
Name: [active1.fields[DATACORE_NAME]] 
ID: [active1.fields[DATACORE_ID]] 
Gender: [active1.fields[DATACORE_GENDER]] 
Age: [active1.fields[DATACORE_AGE]] 
Species: [active1.fields[DATACORE_SPECIES]] 
Rank: [active1.fields[DATACORE_RANK]] 
Fingerprint: [active1.fields[DATACORE_FINGERPRINT]] 
Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]] 
Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]] 
Name: [active_record.fields[DATACORE_NAME]] 
ID: [active_record.fields[DATACORE_ID]] 
Gender: [active_record.fields[DATACORE_GENDER]] 
Age: [active_record.fields[DATACORE_AGE]] 
Species: [active_record.fields[DATACORE_SPECIES]] 
Rank: [active_record.fields[DATACORE_RANK]] 
Fingerprint: [active_record.fields[DATACORE_FINGERPRINT]] 
Physical Status: [active_record.fields[DATACORE_PHYSICAL_HEALTH]] 
Mental Status: [active_record.fields[DATACORE_MENTAL_HEALTH]] 

Print photo
@@ -179,9 +179,9 @@
"} else dat += "
General Record Lost!
" - if((istype(active2, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active2))) + if((istype(active_record, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active_record))) dat += "Security Data" - dat += "
Criminal Status: [active2.fields[DATACORE_CRIMINAL_STATUS]]" + dat += "
Criminal Status: [active_record.fields[DATACORE_CRIMINAL_STATUS]]" dat += "

Crimes: Add New" @@ -193,7 +193,7 @@
Time Added Del
[c.crimeName]\[+\]
" - dat += "
\nImportant Notes:
\n\t [active2.fields[DATACORE_NOTES]] " + dat += "
\nImportant Notes:
\n\t [active_record.fields[DATACORE_NOTES]] " dat += "

Comments/Log
" var/counter = 1 - while(active2.fields[text("com_[]", counter)]) - dat += (active2.fields[text("com_[]", counter)] + "
") - if(active2.fields[text("com_[]", counter)] != "Deleted") + while(active_record.fields[text("com_[]", counter)]) + dat += (active_record.fields[text("com_[]", counter)] + "
") + if(active_record.fields[text("com_[]", counter)] != "Deleted") dat += text("Delete Entry

", counter) counter++ dat += "Add Entry

" @@ -235,10 +235,8 @@ What a mess.*/ . = ..() if(.) return . - if(!(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1))) - active1 = null - if(!(SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active2))) - active2 = null + if(!(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active_record))) + active_record = null if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr) || isAdminGhostAI(usr)) usr.set_machine(src) switch(href_list["choice"]) @@ -260,14 +258,12 @@ What a mess.*/ if("Return") screen = 1 - active1 = null - active2 = null + active_record = null if("Log Out") authenticated = null screen = null - active1 = null - active2 = null + active_record = null playsound(src, 'sound/machines/terminal_off.ogg', 50, FALSE) if("Log In") @@ -275,20 +271,17 @@ What a mess.*/ var/obj/item/card/id/I = M.get_idcard(TRUE) if(issilicon(M)) var/mob/living/silicon/borg = M - active1 = null - active2 = null + active_record = null authenticated = borg.name rank = "AI" screen = 1 else if(isAdminGhostAI(M)) - active1 = null - active2 = null + active_record = null authenticated = M.client.holder.admin_signature rank = "Central Command" screen = 1 else if(I && check_access(I)) - active1 = null - active2 = null + active_record = null authenticated = I.registered_name rank = I.assignment screen = 1 @@ -299,18 +292,17 @@ What a mess.*/ //RECORD FUNCTIONS if("Record Maintenance") screen = 2 - active1 = null - active2 = null + active_record = null if("Browse Record") var/datum/data/record/R = locate(href_list["d_rec"]) in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST) if(!R) temp = "Record Not Found!" else - active1 = active2 = R + active_record = active_record = R for(var/datum/data/record/E in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) if((E.fields[DATACORE_NAME] == R.fields[DATACORE_NAME] || E.fields[DATACORE_ID] == R.fields[DATACORE_ID])) - active2 = E + active_record = E screen = 3 if("Print Record") @@ -321,14 +313,14 @@ What a mess.*/ sleep(30) var/obj/item/paper/printed_paper = new /obj/item/paper(loc) var/final_paper_text = "
Security Record - (SR-[SSdatacore.securityPrintCount])

" - if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1))) - final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active1.fields[DATACORE_NAME], active1.fields[DATACORE_ID], active1.fields[DATACORE_GENDER], active1.fields[DATACORE_AGE]) - final_paper_text += "\nSpecies: [active1.fields[DATACORE_SPECIES]]
" - final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields[DATACORE_FINGERPRINT], active1.fields[DATACORE_PHYSICAL_HEALTH], active1.fields[DATACORE_MENTAL_HEALTH]) + if((istype(active_record, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active_record))) + final_paper_text += text("Name: [] ID: []
\nGender: []
\nAge: []
", active_record.fields[DATACORE_NAME], active_record.fields[DATACORE_ID], active_record.fields[DATACORE_GENDER], active_record.fields[DATACORE_AGE]) + final_paper_text += "\nSpecies: [active_record.fields[DATACORE_SPECIES]]
" + final_paper_text += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active_record.fields[DATACORE_FINGERPRINT], active_record.fields[DATACORE_PHYSICAL_HEALTH], active_record.fields[DATACORE_MENTAL_HEALTH]) else final_paper_text += "General Record Lost!
" - if((istype(active2, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active2))) - final_paper_text += text("
\n
Security Data

\nCriminal Status: []", active2.fields[DATACORE_CRIMINAL_STATUS]) + if((istype(active_record, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_SECURITY).Find(active_record))) + final_paper_text += text("
\n
Security Data

\nCriminal Status: []", active_record.fields[DATACORE_CRIMINAL_STATUS]) final_paper_text += "
\n
\nCrimes:
\n" final_paper_text +={" @@ -338,7 +330,7 @@ What a mess.*/ "} - for(var/datum/data/crime/c in active2.fields[DATACORE_CRIMES]) + for(var/datum/data/crime/c in active_record.fields[DATACORE_CRIMES]) final_paper_text += "" final_paper_text += "" final_paper_text += "" @@ -346,12 +338,12 @@ What a mess.*/ final_paper_text += "" final_paper_text += "
Author Time Added
[c.crimeName][c.crimeDetails][c.author]
" - final_paper_text += text("
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", active2.fields[DATACORE_NOTES]) + final_paper_text += text("
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", active_record.fields[DATACORE_NOTES]) var/counter = 1 - while(active2.fields[text("com_[]", counter)]) - final_paper_text += text("[]
", active2.fields[text("com_[]", counter)]) + while(active_record.fields[text("com_[]", counter)]) + final_paper_text += text("[]
", active_record.fields[text("com_[]", counter)]) counter++ - printed_paper.name = text("SR-[] '[]'", SSdatacore.securityPrintCount, active1.fields[DATACORE_NAME]) + printed_paper.name = text("SR-[] '[]'", SSdatacore.securityPrintCount, active_record.fields[DATACORE_NAME]) else final_paper_text += "Security Record Lost!
" printed_paper.name = text("SR-[] '[]'", SSdatacore.securityPrintCount, "Record Lost") @@ -361,13 +353,13 @@ What a mess.*/ printing = null if("Print Poster") if(!(printing)) - var/wanted_name = stripped_input(usr, "Please enter an alias for the criminal:", "Print Wanted Poster", active1.fields[DATACORE_NAME]) + var/wanted_name = stripped_input(usr, "Please enter an alias for the criminal:", "Print Wanted Poster", active_record.fields[DATACORE_NAME]) if(wanted_name) var/default_description = "A poster declaring [wanted_name] to be a dangerous individual, wanted by Nanotrasen. Report any sightings to security immediately." - var/list/crimes = active2.fields[DATACORE_CRIMES] + var/list/crimes = active_record.fields[DATACORE_CRIMES] if(crimes.len) default_description += "\n[wanted_name] is wanted for the following crimes:\n" - for(var/datum/data/crime/c in active2.fields[DATACORE_CRIMES]) + for(var/datum/data/crime/c in active_record.fields[DATACORE_CRIMES]) default_description += "\n[c.crimeName]\n" default_description += "[c.crimeDetails]\n" @@ -378,13 +370,13 @@ What a mess.*/ playsound(loc, 'sound/items/poster_being_created.ogg', 100, TRUE) printing = 1 sleep(30) - if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)))//make sure the record still exists. - var/obj/item/photo/photo = active1.get_front_photo() + if((istype(active_record, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active_record)))//make sure the record still exists. + var/obj/item/photo/photo = active_record.get_front_photo() new /obj/item/poster/wanted(loc, photo.picture.picture_image, wanted_name, info, headerText) printing = 0 if("Print Missing") if(!(printing)) - var/missing_name = stripped_input(usr, "Please enter an alias for the missing person:", "Print Missing Persons Poster", active1.fields[DATACORE_NAME]) + var/missing_name = stripped_input(usr, "Please enter an alias for the missing person:", "Print Missing Persons Poster", active_record.fields[DATACORE_NAME]) if(missing_name) var/default_description = "A poster declaring [missing_name] to be a missing individual, missed by Nanotrasen. Report any sightings to security immediately." @@ -395,8 +387,8 @@ What a mess.*/ playsound(loc, 'sound/items/poster_being_created.ogg', 100, TRUE) printing = 1 sleep(30) - if((istype(active1, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active1)))//make sure the record still exists. - var/obj/item/photo/photo = active1.get_front_photo() + if((istype(active_record, /datum/data/record) && SSdatacore.get_records(DATACORE_RECORDS_OUTPOST).Find(active_record)))//make sure the record still exists. + var/obj/item/photo/photo = active_record.get_front_photo() new /obj/item/poster/wanted/missing(loc, photo.picture.picture_image, missing_name, info, headerText) printing = 0 @@ -415,44 +407,44 @@ What a mess.*/ temp = "All Security records deleted." if("Add Entry") - if(!(istype(active2, /datum/data/record))) + if(!(istype(active_record, /datum/data/record))) return - var/a2 = active2 + var/a2 = active_record var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null) if(!can_use_record_console(usr, t1, null, a2)) return var/counter = 1 - while(active2.fields[text("com_[]", counter)]) + while(active_record.fields[text("com_[]", counter)]) counter++ - active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], []
[]", src.authenticated, src.rank, station_time_timestamp(), sector_datestamp(shortened = TRUE), t1) + active_record.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], []
[]", src.authenticated, src.rank, station_time_timestamp(), sector_datestamp(shortened = TRUE), t1) if("Delete Record (ALL)") - if(active1) + if(active_record) temp = "
Are you sure you wish to delete the record (ALL)?
" temp += "Yes
" temp += "No" if("Delete Record (Security)") - if(active2) + if(active_record) temp = "
Are you sure you wish to delete the record (Security Portion Only)?
" temp += "Yes
" temp += "No" if("Delete Entry") - if((istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])])) - active2.fields[text("com_[]", href_list["del_c"])] = "Deleted" + if((istype(active_record, /datum/data/record) && active_record.fields[text("com_[]", href_list["del_c"])])) + active_record.fields[text("com_[]", href_list["del_c"])] = "Deleted" //RECORD CREATE if("New Record (Security)") - if((istype(active1, /datum/data/record) && !(istype(active2, /datum/data/record)))) + if((istype(active_record, /datum/data/record) && !(istype(active_record, /datum/data/record)))) var/datum/data/record/R = new /datum/data/record() - R.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] - R.fields[DATACORE_ID] = active1.fields[DATACORE_ID] + R.fields[DATACORE_NAME] = active_record.fields[DATACORE_NAME] + R.fields[DATACORE_ID] = active_record.fields[DATACORE_ID] R.name = text("Security Record #[]", R.fields[DATACORE_ID]) R.fields[DATACORE_CRIMINAL_STATUS] = "None" R.fields[DATACORE_CRIMES] = list() R.fields[DATACORE_NOTES] = "No notes." SSdatacore.inject_record(R, DATACORE_RECORDS_SECURITY) - active2 = R + active_record = R screen = 3 if("New Record (General)") @@ -468,23 +460,23 @@ What a mess.*/ G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" G.fields[DATACORE_MENTAL_HEALTH] = "Stable" SSdatacore.inject_record(G, DATACORE_RECORDS_OUTPOST) - active1 = G + active_record = G //Security Record var/datum/data/record/R = new /datum/data/record() - R.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] - R.fields[DATACORE_ID] = active1.fields[DATACORE_ID] + R.fields[DATACORE_NAME] = active_record.fields[DATACORE_NAME] + R.fields[DATACORE_ID] = active_record.fields[DATACORE_ID] R.name = text("Security Record #[]", R.fields[DATACORE_ID]) R.fields[DATACORE_CRIMINAL_STATUS] = "None" R.fields[DATACORE_CRIMES] = list() R.fields[DATACORE_NOTES] = "No notes." SSdatacore.inject_record(R, DATACORE_RECORDS_SECURITY) - active2 = R + active_record = R //Medical Record var/datum/data/record/M = new /datum/data/record() - M.fields[DATACORE_ID] = active1.fields[DATACORE_ID] - M.fields[DATACORE_NAME] = active1.fields[DATACORE_NAME] + M.fields[DATACORE_ID] = active_record.fields[DATACORE_ID] + M.fields[DATACORE_NAME] = active_record.fields[DATACORE_NAME] M.fields[DATACORE_BLOOD_TYPE] = "?" M.fields[DATACORE_BLOOD_DNA] = "?????" M.fields["mi_dis"] = "None" @@ -502,68 +494,64 @@ What a mess.*/ //FIELD FUNCTIONS if("Edit Field") - var/a1 = active1 - var/a2 = active2 + var/a1 = active_record + var/a2 = active_record switch(href_list["field"]) if("name") - if(istype(active1, /datum/data/record) || istype(active2, /datum/data/record)) - var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active1.fields[DATACORE_NAME], MAX_MESSAGE_LEN) + if(istype(active_record, /datum/data/record) || istype(active_record, /datum/data/record)) + var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active_record.fields[DATACORE_NAME], MAX_MESSAGE_LEN) if(!can_use_record_console(usr, t1, a1)) return - if(istype(active1, /datum/data/record)) - active1.fields[DATACORE_NAME] = t1 - if(istype(active2, /datum/data/record)) - active2.fields[DATACORE_NAME] = t1 + if(istype(active_record, /datum/data/record)) + active_record.fields[DATACORE_NAME] = t1 if("id") - if(istype(active2, /datum/data/record) || istype(active1, /datum/data/record)) - var/t1 = stripped_input(usr, "Please input id:", "Secure. records", active1.fields[DATACORE_ID], null) + if(istype(active_record, /datum/data/record) || istype(active_record, /datum/data/record)) + var/t1 = stripped_input(usr, "Please input id:", "Secure. records", active_record.fields[DATACORE_ID], null) if(!can_use_record_console(usr, t1, a1)) return - if(istype(active1, /datum/data/record)) - active1.fields[DATACORE_ID] = t1 - if(istype(active2, /datum/data/record)) - active2.fields[DATACORE_ID] = t1 + if(istype(active_record, /datum/data/record)) + active_record.fields[DATACORE_ID] = t1 if("fingerprint") - if(istype(active1, /datum/data/record)) - var/t1 = stripped_input(usr, "Please input fingerprint hash:", "Secure. records", active1.fields[DATACORE_FINGERPRINT], null) + if(istype(active_record, /datum/data/record)) + var/t1 = stripped_input(usr, "Please input fingerprint hash:", "Secure. records", active_record.fields[DATACORE_FINGERPRINT], null) if(!can_use_record_console(usr, t1, a1)) return - active1.fields[DATACORE_FINGERPRINT] = t1 + active_record.fields[DATACORE_FINGERPRINT] = t1 if("gender") - if(istype(active1, /datum/data/record)) - if(active1.fields[DATACORE_GENDER] == "Male") - active1.fields[DATACORE_GENDER] = "Female" - else if(active1.fields[DATACORE_GENDER] == "Female") - active1.fields[DATACORE_GENDER] = "Other" + if(istype(active_record, /datum/data/record)) + if(active_record.fields[DATACORE_GENDER] == "Male") + active_record.fields[DATACORE_GENDER] = "Female" + else if(active_record.fields[DATACORE_GENDER] == "Female") + active_record.fields[DATACORE_GENDER] = "Other" else - active1.fields[DATACORE_GENDER] = "Male" + active_record.fields[DATACORE_GENDER] = "Male" if("age") - if(istype(active1, /datum/data/record)) - var/t1 = input("Please input age:", "Secure. records", active1.fields[DATACORE_AGE], null) as num|null + if(istype(active_record, /datum/data/record)) + var/t1 = input("Please input age:", "Secure. records", active_record.fields[DATACORE_AGE], null) as num|null if (!t1) return if(!can_use_record_console(usr, "age", a1)) return - active1.fields[DATACORE_AGE] = t1 + active_record.fields[DATACORE_AGE] = t1 if("species") - if(istype(active1, /datum/data/record)) + if(istype(active_record, /datum/data/record)) var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_races if(!can_use_record_console(usr, t1, a1)) return - active1.fields[DATACORE_SPECIES] = t1 + active_record.fields[DATACORE_SPECIES] = t1 if("show_photo_front") - if(active1) - var/front_photo = active1.get_front_photo() + if(active_record) + var/front_photo = active_record.get_front_photo() if(istype(front_photo, /obj/item/photo)) var/obj/item/photo/photo = front_photo photo.show(usr) if("upd_photo_front") var/obj/item/photo/photo = get_photo(usr) if(photo) - qdel(active1.fields["photo_front"]) + qdel(active_record.fields["photo_front"]) //Lets center it to a 32x32. var/icon/I = photo.picture.picture_image var/w = I.Width() @@ -571,24 +559,24 @@ What a mess.*/ var/dw = w - 32 var/dh = w - 32 I.Crop(dw/2, dh/2, w - dw/2, h - dh/2) - active1.fields["photo_front"] = photo - investigate_log("[key_name(usr)] updated [active1.fields[DATACORE_NAME]]'s front photo.", INVESTIGATE_RECORDS) + active_record.fields["photo_front"] = photo + investigate_log("[key_name(usr)] updated [active_record.fields[DATACORE_NAME]]'s front photo.", INVESTIGATE_RECORDS) if("print_photo_front") - if(active1) - var/front_photo = active1.get_front_photo() + if(active_record) + var/front_photo = active_record.get_front_photo() if(istype(front_photo, /obj/item/photo)) var/obj/item/photo/photo_front = front_photo - print_photo(photo_front.picture.picture_image, active1.fields[DATACORE_NAME]) + print_photo(photo_front.picture.picture_image, active_record.fields[DATACORE_NAME]) if("show_photo_side") - if(active1) - var/side_photo = active1.get_side_photo() + if(active_record) + var/side_photo = active_record.get_side_photo() if(istype(side_photo, /obj/item/photo)) var/obj/item/photo/photo = side_photo photo.show(usr) if("upd_photo_side") var/obj/item/photo/photo = get_photo(usr) if(photo) - qdel(active1.fields["photo_side"]) + qdel(active_record.fields["photo_side"]) //Lets center it to a 32x32. var/icon/I = photo.picture.picture_image var/w = I.Width() @@ -596,28 +584,28 @@ What a mess.*/ var/dw = w - 32 var/dh = w - 32 I.Crop(dw/2, dh/2, w - dw/2, h - dh/2) - active1.fields["photo_side"] = photo - investigate_log("[key_name(usr)] updated [active1.fields[DATACORE_NAME]]'s front photo.", INVESTIGATE_RECORDS) + active_record.fields["photo_side"] = photo + investigate_log("[key_name(usr)] updated [active_record.fields[DATACORE_NAME]]'s front photo.", INVESTIGATE_RECORDS) if("print_photo_side") - if(active1) - var/side_photo = active1.get_side_photo() + if(active_record) + var/side_photo = active_record.get_side_photo() if(istype(side_photo, /obj/item/photo)) var/obj/item/photo/photo_side = side_photo - print_photo(photo_side.picture.picture_image, active1.fields[DATACORE_NAME]) + print_photo(photo_side.picture.picture_image, active_record.fields[DATACORE_NAME]) if("crim_add") - if(!istype(active1, /datum/data/record/security)) + if(!istype(active_record, /datum/data/record)) return var/t1 = stripped_input(usr, "Please input crime names:", "Secure. records", "", null) var/t2 = stripped_input(usr, "Please input crime details:", "Secure. records", "", null) if(!can_use_record_console(usr, t1, null, a2)) return - var/datum/data/record/security/security_record = active1 + var/datum/data/record_record = active_record var/crime = SSdatacore.new_crime_entry(t1, t2, authenticated, station_time_timestamp()) security_record.add_crime(crime) - investigate_log("New Crime: [t1]: [t2] | Added to [active1.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) + investigate_log("New Crime: [t1]: [t2] | Added to [active_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) if("crim_delete") - if(!istype(active1, /datum/data/record/security) || !href_list["cdataid"]) + if(!istype(active_record, /datum/data/record) || !href_list["cdataid"]) return if(!can_use_record_console(usr, "delete", null, a2)) @@ -625,7 +613,7 @@ What a mess.*/ var/crime_name var/crime_details - var/datum/data/record/security/security_record = active1 + var/datum/data/record/security_record = active_record var/list/crimes = security_record.fields[DATACORE_CRIMES] for(var/datum/data/crime/crime in crimes) if(crime.dataId == text2num(href_list["cdataid"])) @@ -633,11 +621,11 @@ What a mess.*/ crime_details = crime.crimeDetails break - investigate_log("[key_name(usr)] deleted a crime from [active1.fields[DATACORE_NAME]]: ([crime_name]) | Details: [crime_details]", INVESTIGATE_RECORDS) + investigate_log("[key_name(usr)] deleted a crime from [active_record.fields[DATACORE_NAME]]: ([crime_name]) | Details: [crime_details]", INVESTIGATE_RECORDS) security_record.remove_crime(href_list["cdataid"]) if("add_details") - if(!istype(active1, /datum/data/record/security) || !href_list["cdataid"]) + if(!istype(active_record, /datum/data/record) || !href_list["cdataid"]) return @@ -645,19 +633,19 @@ What a mess.*/ if(!can_use_record_console(usr, t1, null, a2)) return - var/datum/data/record/security/security_record = active1 + var/datum/data/record/security_record = active_record security_record.add_crime_details(href_list["cdataid"], t1) - investigate_log("New Crime details: [t1] | Added to [active1.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) + investigate_log("New Crime details: [t1] | Added to [active_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) if("notes") - if(istype(active2, /datum/data/record)) - var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active2.fields[DATACORE_NOTES], null) + if(istype(active_record, /datum/data/record)) + var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active_record.fields[DATACORE_NOTES], null) if(!can_use_record_console(usr, t1, null, a2)) return - active2.fields[DATACORE_NOTES] = t1 + active_record.fields[DATACORE_NOTES] = t1 if("criminal") - if(!istype(active1, /datum/data/record/security)) + if(!istype(active_record, /datum/data/record)) return temp = "
Criminal Status:
" @@ -671,7 +659,7 @@ What a mess.*/ if("rank") var/list/L = list( "Head of Personnel", "Captain", "AI", "Central Command" ) //This was so silly before the change. Now it actually works without beating your head against the keyboard. /N - if((istype(active1, /datum/data/record) && L.Find(rank))) + if((istype(active_record, /datum/data/record) && L.Find(rank))) temp = "
Rank:
" temp += "
    " for(var/rank in get_all_jobs()) @@ -684,48 +672,48 @@ What a mess.*/ temp=null switch(href_list["choice"]) if("Change Rank") - if(active1) - active1.fields[DATACORE_RANK] = strip_html(href_list["rank"]) + if(active_record) + active_record.fields[DATACORE_RANK] = strip_html(href_list["rank"]) if(href_list["rank"] in get_all_jobs()) - active1.fields["real_rank"] = href_list["real_rank"] + active_record.fields["real_rank"] = href_list["real_rank"] if("Change Criminal Status") - if(active2) - var/old_field = active2.fields[DATACORE_CRIMINAL_STATUS] + if(active_record) + var/old_field = active_record.fields[DATACORE_CRIMINAL_STATUS] switch(href_list["criminal2"]) if("none") - active2.fields[DATACORE_CRIMINAL_STATUS] = "None" + active_record.fields[DATACORE_CRIMINAL_STATUS] = "None" if("arrest") - active2.fields[DATACORE_CRIMINAL_STATUS] = "*Arrest*" + active_record.fields[DATACORE_CRIMINAL_STATUS] = "*Arrest*" if("incarcerated") - active2.fields[DATACORE_CRIMINAL_STATUS] = "Incarcerated" + active_record.fields[DATACORE_CRIMINAL_STATUS] = "Incarcerated" if("paroled") - active2.fields[DATACORE_CRIMINAL_STATUS] = "Paroled" + active_record.fields[DATACORE_CRIMINAL_STATUS] = "Paroled" if("released") - active2.fields[DATACORE_CRIMINAL_STATUS] = "Discharged" - investigate_log("[active1.fields[DATACORE_NAME]] has been set from [old_field] to [active2.fields[DATACORE_CRIMINAL_STATUS]] by [key_name(usr)].", INVESTIGATE_RECORDS) + active_record.fields[DATACORE_CRIMINAL_STATUS] = "Discharged" + investigate_log("[active_record.fields[DATACORE_NAME]] has been set from [old_field] to [active_record.fields[DATACORE_CRIMINAL_STATUS]] by [key_name(usr)].", INVESTIGATE_RECORDS) for(var/i in GLOB.human_list) var/mob/living/carbon/human/H = i H.sec_hud_set_security_status() if("Delete Record (Security) Execute") - investigate_log("[key_name(usr)] has deleted the security records for [active1.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) - if(active2) - qdel(active2) - active2 = null + investigate_log("[key_name(usr)] has deleted the security records for [active_record.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) + if(active_record) + qdel(active_record) + active_record = null if("Delete Record (ALL) Execute") - if(active1) - investigate_log("[key_name(usr)] has deleted all records for [active1.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) + if(active_record) + investigate_log("[key_name(usr)] has deleted all records for [active_record.fields[DATACORE_NAME]].", INVESTIGATE_RECORDS) for(var/datum/data/record/R in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - if((R.fields[DATACORE_NAME] == active1.fields[DATACORE_NAME] || R.fields[DATACORE_ID] == active1.fields[DATACORE_ID])) + if((R.fields[DATACORE_NAME] == active_record.fields[DATACORE_NAME] || R.fields[DATACORE_ID] == active_record.fields[DATACORE_ID])) qdel(R) break - qdel(active1) - active1 = null + qdel(active_record) + active_record = null - if(active2) - qdel(active2) - active2 = null + if(active_record) + qdel(active_record) + active_record = null else temp = "This function does not appear to be working at the moment. Our apologies." @@ -797,7 +785,7 @@ What a mess.*/ if(user.canUseTopic(src, !issilicon(user))) if(!trim(message1)) return 0 - if(!record1 || record1 == active1) - if(!record2 || record2 == active2) + if(!record1 || record1 == active_record) + if(!record2 || record2 == active_record) return 1 return 0 diff --git a/code/modules/datacore/records.dm b/code/modules/datacore/records.dm index 202ed9a12b5e..6a5356c5469b 100644 --- a/code/modules/datacore/records.dm +++ b/code/modules/datacore/records.dm @@ -71,16 +71,8 @@ fields[field_name] = photo return photo -/datum/data/record/general - -/datum/data/record/medical - -/datum/data/record/locked - -/datum/data/record/security - /// Set the criminal status of a crew member in the security records. -/datum/data/record/security/proc/set_criminal_status(new_status) +/datum/data/record/proc/set_criminal_status(new_status) var/old_status = DATACORE_CRIMINAL_STATUS if(old_status == new_status) return FALSE @@ -88,10 +80,10 @@ fields[DATACORE_CRIMINAL_STATUS] = new_status return TRUE -/datum/data/record/security/proc/add_crime(datum/data/crime/crime) +/datum/data/record/proc/add_crime(datum/data/crime/crime) fields[DATACORE_CRIMES] |= crime -/datum/data/record/security/proc/remove_crime(cDataId) +/datum/data/record/proc/remove_crime(cDataId) if(istext(cDataId)) cDataId = text2num(cDataId) @@ -100,7 +92,7 @@ fields[DATACORE_CRIMES] -= crime return -/datum/data/record/security/proc/add_crime_details(cDataId, details) +/datum/data/record/proc/add_crime_details(cDataId, details) if(istext(cDataId)) cDataId = text2num(cDataId) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3f8128931126..ce975392d9ab 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -399,7 +399,7 @@ to_chat(H, "ERROR: Can not identify target.") return - var/datum/data/record/security/security_record = SSdatacore.get_records(DATACORE_RECORDS_SECURITY)[perpname] + var/datum/data/record/security_record = SSdatacore.get_records(DATACORE_RECORDS_SECURITY)[perpname] if(!R) to_chat(usr, "ERROR: Unable to locate data core entry for target.") From b74ffb194db808e519093e8722ae19c92ebac10b Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 14 May 2024 22:27:33 -0500 Subject: [PATCH 16/47] ahh --- code/game/machinery/computer/record/security.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/computer/record/security.dm b/code/game/machinery/computer/record/security.dm index 9ef2ff4d7fdf..aad31292b7e6 100644 --- a/code/game/machinery/computer/record/security.dm +++ b/code/game/machinery/computer/record/security.dm @@ -10,6 +10,8 @@ var/list/Perp var/tempname = null + var/datum/data/record/active_record + /obj/machinery/computer/record/sec/syndie icon_keyboard = "syndie_key" @@ -600,7 +602,7 @@ What a mess.*/ if(!can_use_record_console(usr, t1, null, a2)) return - var/datum/data/record_record = active_record + var/datum/data/record/security_record = active_record var/crime = SSdatacore.new_crime_entry(t1, t2, authenticated, station_time_timestamp()) security_record.add_crime(crime) investigate_log("New Crime: [t1]: [t2] | Added to [active_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) From bb13c767907a324a19ab9ec725de0e39f1158b06 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Wed, 15 May 2024 02:03:04 -0500 Subject: [PATCH 17/47] tired --- code/controllers/subsystem/datacore.dm | 5 +- .../game/machinery/computer/record/records.dm | 90 +++++++++++++ shiptest.dme | 1 + .../tgui/interfaces/Records/RecordTabs.tsx | 86 +++++++++++++ .../tgui/interfaces/Records/RecordView.tsx | 119 ++++++++++++++++++ .../tgui/interfaces/Records/constants.ts | 42 +++++++ .../tgui/interfaces/Records/helpers.ts | 17 +++ .../tgui/interfaces/Records/index.tsx | 84 +++++++++++++ .../packages/tgui/interfaces/Records/types.ts | 27 ++++ .../tgui/interfaces/common/EditableText.tsx | 73 +++++++++++ 10 files changed, 543 insertions(+), 1 deletion(-) create mode 100644 code/game/machinery/computer/record/records.dm create mode 100644 tgui/packages/tgui/interfaces/Records/RecordTabs.tsx create mode 100644 tgui/packages/tgui/interfaces/Records/RecordView.tsx create mode 100644 tgui/packages/tgui/interfaces/Records/constants.ts create mode 100644 tgui/packages/tgui/interfaces/Records/helpers.ts create mode 100644 tgui/packages/tgui/interfaces/Records/index.tsx create mode 100644 tgui/packages/tgui/interfaces/Records/types.ts create mode 100644 tgui/packages/tgui/interfaces/common/EditableText.tsx diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index ea14bff5c01c..85aac94afacc 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -206,7 +206,10 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_CRIMES] = list() G.fields[DATACORE_NOTES] = "No notes." - custom_library.inject_record(G) + if(istype(custom_library, /datum/data_library)) + custom_library.inject_record(G) + else + library[custom_library].inject_record(G) /** * Supporing proc for getting general records diff --git a/code/game/machinery/computer/record/records.dm b/code/game/machinery/computer/record/records.dm new file mode 100644 index 000000000000..dfaf9d3acf57 --- /dev/null +++ b/code/game/machinery/computer/record/records.dm @@ -0,0 +1,90 @@ +/obj/machinery/computer/records + name = "records console" + desc = "This can be used to check medical records." + icon_screen = "medcomp" + icon_keyboard = "med_key" + req_one_access = list() + circuit = /obj/item/circuitboard/computer + +/obj/machinery/computer/records/ui_interact(mob/user, datum/tgui/ui) + . = ..() + if(.) + return + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "Records") + ui.set_autoupdate(FALSE) + ui.open() + +/obj/machinery/computer/records/ui_data(mob/user) + var/list/data = ..() + + var/has_access = (authenticated && isliving(user)) || isAdminGhostAI(user) + data["authenticated"] = has_access + if(!has_access) + return data + + var/list/records = list() + for(var/datum/data/record/target in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) + records += list(list( + age = target.fields[DATACORE_AGE], + blood_type = target.fields[DATACORE_BLOOD_TYPE], + crew_ref = REF(target), + dna = target.fields[DATACORE_BLOOD_DNA], + gender = target.fields[DATACORE_GENDER], + disabilities = target.fields[DATACORE_DISABILITIES], + physical_status = target.fields[DATACORE_PHYSICAL_HEALTH], + mental_status = target.fields[DATACORE_MENTAL_HEALTH], + name = target.fields[DATACORE_NAME], + rank = target.fields[DATACORE_RANK], + species = target.fields[DATACORE_SPECIES], + )) + + data["records"] = records + + return data + +/obj/machinery/computer/records/ui_act(action, list/params, datum/tgui/ui) + . = ..() + if(.) + return + + var/datum/data/record/target + if(params["crew_ref"]) + target = locate(params["crew_ref"]) in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST) + + switch(action) + if("login") + authenticated = secure_login(usr) + investigate_log("[key_name(usr)] [authenticated ? "successfully logged" : "failed to log"] into the [src].", INVESTIGATE_RECORDS) + return TRUE + + if("logout") + balloon_alert(usr, "logged out") + playsound(src, 'sound/machines/terminal_off.ogg', 70, TRUE) + authenticated = FALSE + + return TRUE + + if("view_record") + if(!target) + return FALSE + + playsound(src, "sound/machines/terminal_button0[rand(1, 8)].ogg", 50, TRUE) + balloon_alert(usr, "viewing record for [target.fields[DATACORE_NAME]]") + return TRUE + + return FALSE + +/obj/machinery/computer/records/proc/secure_login(mob/user) + if(!is_operational) + return FALSE + + if(!allowed(user)) + balloon_alert(user, "access denied") + return FALSE + + balloon_alert(user, "logged in") + playsound(src, 'sound/machines/terminal_on.ogg', 70, TRUE) + + return TRUE diff --git a/shiptest.dme b/shiptest.dme index ad4cedf2502c..00f83ac3adc1 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -941,6 +941,7 @@ #include "code\game\machinery\computer\prisoner\management.dm" #include "code\game\machinery\computer\record\medical.dm" #include "code\game\machinery\computer\record\record.dm" +#include "code\game\machinery\computer\record\records.dm" #include "code\game\machinery\computer\record\security.dm" #include "code\game\machinery\doors\airlock.dm" #include "code\game\machinery\doors\airlock_electronics.dm" diff --git a/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx b/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx new file mode 100644 index 000000000000..a9e9dec19502 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx @@ -0,0 +1,86 @@ +import { filter, sortBy } from 'common/collections'; +import { flow } from 'common/fp'; +import { useState } from 'react'; +import { useBackend, useLocalState } from 'tgui/backend'; +import { + Box, + Button, + Icon, + Input, + NoticeBox, + Section, + Stack, + Tabs, +} from 'tgui/components'; + +import { MedicalRecord, MedicalRecordData } from './types'; + +/** Displays all found records. */ +export const MedicalRecordTabs = (props, context) => { + const { act, data } = useBackend(context); + + return ( + + +
    + + {data.records.map((record, index) => ( + + ))} + +
    +
    + + + + + + + act('purge_records')} + tooltip="Wipe all record data." + /> + + + +
    + ); +}; + +/** Individual crew tab */ +const CrewTab = (props: { record: MedicalRecord }, context) => { + const [selectedRecord, setSelectedRecord] = useLocalState(context, 'medicalRecord', undefined); + + const { act, data } = useBackend(context); + const { assigned_view } = data; + const { record } = props; + const { crew_ref, name } = record; + + /** Sets the record to preview */ + const selectRecord = (record: MedicalRecord) => { + if (selectedRecord?.crew_ref === crew_ref) { + setSelectedRecord(undefined); + } else { + setSelectedRecord(record); + act('view_record', { assigned_view: assigned_view, crew_ref: crew_ref }); + } + }; + + return ( + selectRecord(record)} + selected={selectedRecord?.crew_ref === crew_ref} + > + {name} + + ); +}; diff --git a/tgui/packages/tgui/interfaces/Records/RecordView.tsx b/tgui/packages/tgui/interfaces/Records/RecordView.tsx new file mode 100644 index 000000000000..40a4d0103023 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/RecordView.tsx @@ -0,0 +1,119 @@ +import { + Box, + Button, + LabeledList, + NoticeBox, + RestrictedInput, + Section, + Stack, +} from 'tgui/components'; + +import { useBackend } from '../../backend'; +import { EditableText } from '../common/EditableText'; +import { + MENTALSTATUS2COLOR, + MENTALSTATUS2DESC, + MENTALSTATUS2ICON, + PHYSICALSTATUS2COLOR, + PHYSICALSTATUS2DESC, + PHYSICALSTATUS2ICON, +} from './constants'; +import { getMedicalRecord } from './helpers'; +import { MedicalRecordData } from './types'; + +/** Views a selected record. */ +export const MedicalRecordView = (props, context) => { + const foundRecord = getMedicalRecord(props, context); + if (!foundRecord) return No record selected.; + + const { act, data } = useBackend(context); + + const { + age, + blood_type, + crew_ref, + dna, + gender, + physical_status, + mental_status, + name, + rank, + species, + } = foundRecord; + + return ( + + + + + + + + +
    act('expunge_record', { crew_ref: crew_ref })} + tooltip="Expunge record data." + /> + } + fill + scrollable + title={name} + > + + + + + + + + + + act('edit_field', { + field: 'age', + ref: crew_ref, + value: value, + }) + } + value={age} + /> + + + + + + + + + + + + + + +
    +
    +
    + ); +}; diff --git a/tgui/packages/tgui/interfaces/Records/constants.ts b/tgui/packages/tgui/interfaces/Records/constants.ts new file mode 100644 index 000000000000..fcb63caf06a3 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/constants.ts @@ -0,0 +1,42 @@ +export const PHYSICALSTATUS2ICON = { + Active: 'person-running', + Debilitated: 'crutch', + Unconscious: 'moon-o', + Deceased: 'skull', +}; + +export const PHYSICALSTATUS2COLOR = { + Active: 'green', + Debilitated: 'purple', + Unconscious: 'orange', + Deceased: 'red', +} as const; + +export const PHYSICALSTATUS2DESC = { + Active: 'Active. Individual is conscious and healthy.', + Debilitated: 'Debilitated. Individual is conscious, but unhealthy.', + Unconscious: 'Unconscious. Individual may require medical attention.', + Deceased: 'Deceased. Individual has died and begun to decay.', +} as const; + +export const MENTALSTATUS2ICON = { + Stable: 'face-smile-o', + Watch: 'eye-o', + Unstable: 'scale-unbalanced-flip', + Insane: 'head-side-virus', +}; + +export const MENTALSTATUS2COLOR = { + Stable: 'green', + Watch: 'purple', + Unstable: 'orange', + Insane: 'red', +} as const; + +export const MENTALSTATUS2DESC = { + Stable: 'Stable. Individual is sane and free from psychological disorders.', + Watch: + 'Watch. Individual has symptoms of mental illness. Monitor them closely.', + Unstable: 'Unstable. Individual has one or more mental illnesses.', + Insane: 'Insane. Individual exhibits severe, abnormal mental behaviors.', +} as const; diff --git a/tgui/packages/tgui/interfaces/Records/helpers.ts b/tgui/packages/tgui/interfaces/Records/helpers.ts new file mode 100644 index 000000000000..425aa591e2b6 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/helpers.ts @@ -0,0 +1,17 @@ +import { useBackend, useLocalState } from 'tgui/backend'; + +import { MedicalRecord, MedicalRecordData } from './types'; + +/** We need an active reference and this a pain to rewrite */ +export const getMedicalRecord = (props, context) => { + const [selectedRecord, SetRecord] = useLocalState(context, 'Record', ''); + if (!selectedRecord) return; + const { data } = useBackend(context); + const { records = [] } = data; + const foundRecord = records.find( + (record) => record.crew_ref === selectedRecord.crew_ref, + ); + if (!foundRecord) return; + + return foundRecord; +}; diff --git a/tgui/packages/tgui/interfaces/Records/index.tsx b/tgui/packages/tgui/interfaces/Records/index.tsx new file mode 100644 index 000000000000..b015f8e27c5a --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/index.tsx @@ -0,0 +1,84 @@ +import { useBackend } from 'tgui/backend'; +import { Box, Button, Icon, NoticeBox, Stack } from 'tgui/components'; +import { Window } from 'tgui/layouts'; + +import { MedicalRecordData } from './types'; + + +import { MedicalRecordTabs } from './RecordTabs'; +import { MedicalRecordView } from './RecordView'; + +export const Records = (props, context) => { + const { data } = useBackend(context); + const { authenticated } = data; + + return ( + + + + {!authenticated ? : } + + + + ); +}; + +const UnauthorizedView = (props, context) => { + const { act } = useBackend(context); + return ( + + + + + + + + + Nanotrasen HealthPRO + + + + + You are not logged in. + + + + + + ); +}; + +const AuthView = (props, context) => { + const { data, act } = useBackend(context); + + return ( + <> + + + + + + + + + + + Secure Your Workspace. + + + + + + + ); +}; diff --git a/tgui/packages/tgui/interfaces/Records/types.ts b/tgui/packages/tgui/interfaces/Records/types.ts new file mode 100644 index 000000000000..4fdbf5ac8300 --- /dev/null +++ b/tgui/packages/tgui/interfaces/Records/types.ts @@ -0,0 +1,27 @@ +import { BooleanLike } from 'common/react'; + +export type MedicalRecordData = { + assigned_view: string; + authenticated: BooleanLike; + physical_statuses: string[]; + mental_statuses: string[]; + records: MedicalRecord[]; + min_age: number; + max_age: number; +}; + + +export type MedicalRecord = { + age: number; + blood_type: string; + crew_ref: string; + dna: string; + gender: string; + disabilities: string; + physical_status: string; + mental_status: string; + name: string; + quirk_notes: string; + rank: string; + species: string; +}; diff --git a/tgui/packages/tgui/interfaces/common/EditableText.tsx b/tgui/packages/tgui/interfaces/common/EditableText.tsx new file mode 100644 index 000000000000..3c004e94f033 --- /dev/null +++ b/tgui/packages/tgui/interfaces/common/EditableText.tsx @@ -0,0 +1,73 @@ +import { useBackend, useLocalState } from 'tgui/backend'; +import { Box, Button, Input, Stack } from 'tgui/components'; + +type Props = { + color?: string; + field: string; + target_ref: string; + text: string; +}; + +/** + * Expects a referrence to the thing you're modifying, + * then attempts to set the field with the value. + * + * When user presses ENTER, this is called to Byond: + * ``` + * act('edit_field', { field: field, ref: target_ref, value: value }) + * ``` + * Ensure that you have the corresponding action case in your Byond code. + * + */ +export const EditableText = (props: Props, context) => { + const { color, field, target_ref, text } = props; + if (!field) return <> ; + + const { act } = useBackend(context); + const [editing, setEditing] = useLocalState(context, 'editing', ''); + + return editing ? ( + setEditing(false)} + onEnter={(event, value) => { + setEditing(false); + act('edit_field', { field: field, ref: target_ref, value: value }); + }} + value={text} + /> + ) : ( + + + setEditing(true)} + > + {!text ? '(none)' : text} + + + + + ); + })} + label="Physical Status" + > + + {physical_status} + + + { + const isSelected = button === mental_status; + return ( + + ); + })} + label="Mental Status" + > + + {mental_status} + + + + {disabilities_array.map((disability, index) => ( + • {disability} + ))} + diff --git a/tgui/packages/tgui/interfaces/Records/helpers.ts b/tgui/packages/tgui/interfaces/Records/helpers.ts index d2182f8571fa..c17832024c7b 100644 --- a/tgui/packages/tgui/interfaces/Records/helpers.ts +++ b/tgui/packages/tgui/interfaces/Records/helpers.ts @@ -2,6 +2,11 @@ import { useBackend, useLocalState } from 'tgui/backend'; import { MedicalRecord, MedicalRecordData } from './types'; +/** Splits a medical string on
    into a string array */ +export const getQuirkStrings = (string: string) => { + return string?.split('
    ') || []; +}; + /** We need an active reference and this a pain to rewrite */ export const getMedicalRecord = (props, context) => { const [selectedRecord, SetRecord] = useLocalState(context, 'medicalRecord', ''); diff --git a/tgui/packages/tgui/interfaces/Records/types.ts b/tgui/packages/tgui/interfaces/Records/types.ts index 4fdbf5ac8300..7effb74772de 100644 --- a/tgui/packages/tgui/interfaces/Records/types.ts +++ b/tgui/packages/tgui/interfaces/Records/types.ts @@ -21,7 +21,14 @@ export type MedicalRecord = { physical_status: string; mental_status: string; name: string; - quirk_notes: string; + notes: MedicalNote[]; rank: string; species: string; }; + +export type MedicalNote = { + author: string; + content: string; + note_ref: string; + time: string; +}; From 69278a8412ec86f790dcd70d4e021b48562a6094 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 28 May 2024 02:01:05 -0500 Subject: [PATCH 21/47] small stuff --- code/__DEFINES/datacore.dm | 51 +++++++- .../game/machinery/computer/record/records.dm | 49 +++++++- code/modules/mob/living/carbon/human/human.dm | 119 +++++++++--------- .../tgui/interfaces/Records/RecordTabs.tsx | 23 ++-- .../tgui/interfaces/Records/RecordView.tsx | 31 ++--- .../tgui/interfaces/Records/helpers.ts | 10 +- .../tgui/interfaces/Records/index.tsx | 2 +- .../packages/tgui/interfaces/Records/types.ts | 3 +- 8 files changed, 187 insertions(+), 101 deletions(-) diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm index 604c5848a0f8..440f6f47e334 100644 --- a/code/__DEFINES/datacore.dm +++ b/code/__DEFINES/datacore.dm @@ -35,9 +35,50 @@ #define DATACORE_RECORDS_MEDICAL "medical" #define DATACORE_RECORDS_LOCKED "locked" -//#define DATACORE_RECORDS_AETHER "aether" -//#define DATACORE_RECORDS_DAEDALUS "daedalus" -//#define DATACORE_RECORDS_HERMES "hermes" -//#define DATACORE_RECORDS_MARS "mars" - #define DATACORE_IMAGE "image" + +/// Physical statuses +#define PHYSICAL_ACTIVE "Active" +#define PHYSICAL_DEBILITATED "Debilitated" +#define PHYSICAL_UNCONSCIOUS "Unconscious" +#define PHYSICAL_DECEASED "Deceased" + +/// List of available physical statuses +#define PHYSICAL_STATUSES list(\ + PHYSICAL_ACTIVE, \ + PHYSICAL_DEBILITATED, \ + PHYSICAL_UNCONSCIOUS, \ + PHYSICAL_DECEASED, \ +) + +/// Mental statuses +#define MENTAL_STABLE "Stable" +#define MENTAL_WATCH "Watch" +#define MENTAL_UNSTABLE "Unstable" +#define MENTAL_INSANE "Insane" + +/// List of available mental statuses +#define MENTAL_STATUSES list(\ + MENTAL_STABLE, \ + MENTAL_WATCH, \ + MENTAL_UNSTABLE, \ + MENTAL_INSANE, \ +) + +/// Wanted statuses +#define WANTED_ARREST "Arrest" +#define WANTED_DISCHARGED "Discharged" +#define WANTED_NONE "None" +#define WANTED_PAROLE "Parole" +#define WANTED_PRISONER "Incarcerated" +#define WANTED_SUSPECT "Suspected" + +/// List of available wanted statuses +#define WANTED_STATUSES(...) list(\ + WANTED_NONE, \ + WANTED_SUSPECT, \ + WANTED_ARREST, \ + WANTED_PRISONER, \ + WANTED_PAROLE, \ + WANTED_DISCHARGED, \ +) diff --git a/code/game/machinery/computer/record/records.dm b/code/game/machinery/computer/record/records.dm index da1822072334..45f1ed76b6f1 100644 --- a/code/game/machinery/computer/record/records.dm +++ b/code/game/machinery/computer/record/records.dm @@ -27,6 +27,14 @@ ui.set_autoupdate(FALSE) ui.open() +/obj/machinery/computer/records/ui_static_data(mob/user) + var/list/data = list() + data["min_age"] = AGE_MIN + data["max_age"] = AGE_MAX + data["physical_statuses"] = PHYSICAL_STATUSES + data["mental_statuses"] = MENTAL_STATUSES + return data + /obj/machinery/computer/records/ui_data(mob/user) var/list/data = ..() @@ -40,7 +48,7 @@ records += list(list( age = target.fields[DATACORE_AGE], blood_type = target.fields[DATACORE_BLOOD_TYPE], - crew_ref = REF(target), + record_ref = REF(target), dna = target.fields[DATACORE_BLOOD_DNA], gender = target.fields[DATACORE_GENDER], disabilities = target.fields[DATACORE_DISABILITIES], @@ -59,12 +67,23 @@ . = ..() if(.) return + var/mob/user = ui.user var/datum/data/record/target - if(params["crew_ref"]) - target = SSdatacore.find_record("crew_ref", params["crew_ref"], linked_ship) + if(params["record_ref"]) + target = locate(params["record_ref"]) in SSdatacore.get_records(linked_ship) switch(action) + if("expunge_record") + if(!target) + return FALSE + + expunge_record_info(target) + balloon_alert(user, "record expunged") + investigate_log("[key_name(user)] expunged the record of [target[DATACORE_NAME]].", INVESTIGATE_RECORDS) + + return TRUE + if("login") authenticated = secure_login(usr) investigate_log("[key_name(usr)] [authenticated ? "successfully logged" : "failed to log"] into the [src].", INVESTIGATE_RECORDS) @@ -78,7 +97,7 @@ return TRUE if("edit_field") - target = SSdatacore.find_record("ref", params["ref"], linked_ship) + target = locate(params["ref"]) in SSdatacore.get_records(linked_ship) var/field = params["field"] if(!field || !(field in target.fields)) return FALSE @@ -97,8 +116,30 @@ balloon_alert(usr, "viewing record for [target.fields[DATACORE_NAME]]") return TRUE + if("set_physical_status") + var/physical_status = params["physical_status"] + if(!physical_status || !(physical_status in PHYSICAL_STATUSES)) + return FALSE + + target.fields[DATACORE_PHYSICAL_HEALTH] = physical_status + + return TRUE + + if("set_mental_status") + var/mental_status = params["mental_status"] + if(!mental_status || !(mental_status in MENTAL_STATUSES)) + return FALSE + + target.fields[DATACORE_MENTAL_HEALTH] = mental_status + + return TRUE + return FALSE +/// Expunges info from a record. +/obj/machinery/computer/records/proc/expunge_record_info(datum/record/target) + return + /obj/machinery/computer/records/proc/secure_login(mob/user) if(!is_operational) return FALSE diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ce975392d9ab..ab5238781840 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -279,30 +279,31 @@ if(href_list["hud"]) if(!ishuman(usr)) return - var/mob/living/carbon/human/H = usr + var/mob/living/carbon/human/human_or_ghost_user = usr var/perpname = get_face_name(get_id_name("")) - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD) && !HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD)) return - var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_OUTPOST) - /* + var/datum/data/record/target_record = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_OUTPOST) if(href_list["photo_front"] || href_list["photo_side"]) - if(!R) + if(!target_record) return - if(!H.canUseHUD()) - return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD) && !HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) + if(ishuman(human_or_ghost_user)) + var/mob/living/carbon/human/human_user = human_or_ghost_user + if(!human_user.canUseHUD()) + return + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD)) return - var/obj/item/photo/P = null + var/obj/item/photo/photo_from_record = null if(href_list["photo_front"]) - P = R.fields[DATACORE_PHOTO] + photo_from_record = target_record.get_front_photo() else if(href_list["photo_side"]) - P = R.fields[DATACORE_PHOTO_SIDE] - if(P) - P.show(H) + photo_from_record = target_record.get_side_photo() + if(photo_from_record) + photo_from_record.show(human_or_ghost_user) return - */ + if(href_list["hud"] == "m") - if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD)) return if(href_list["evaluation"]) if(!getBruteLoss() && !getFireLoss() && !getOxyLoss() && getToxLoss() < 20) @@ -344,74 +345,74 @@ to_chat(usr, "Patient has signs of suffocation, emergency treatment may be required!") if(getToxLoss() > 20) to_chat(usr, "Gathered data is inconsistent with the analysis, possible cause: poisoning.") - if(!H.wear_id) //You require access from here on out. - to_chat(H, "ERROR: Invalid access") + if(!human_or_ghost_user.wear_id) //You require access from here on out. + to_chat(human_or_ghost_user, "ERROR: Invalid access") return - var/list/access = H.wear_id.GetAccess() + var/list/access = human_or_ghost_user.wear_id.GetAccess() if(!(ACCESS_MEDICAL in access)) - to_chat(H, "ERROR: Invalid access") + to_chat(human_or_ghost_user, "ERROR: Invalid access") return if(href_list["p_stat"]) - var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields[DATACORE_PHYSICAL_HEALTH]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") - if(!R) + var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", target_record.fields[DATACORE_PHYSICAL_HEALTH]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") + if(!target_record) return - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD)) return if(health_status && health_status != "Cancel") - R.fields[DATACORE_PHYSICAL_HEALTH] = health_status + target_record.fields[DATACORE_PHYSICAL_HEALTH] = health_status return if(href_list["m_stat"]) - var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields[DATACORE_MENTAL_HEALTH]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") - if(!R) + var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", target_record.fields[DATACORE_MENTAL_HEALTH]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") + if(!target_record) return - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD)) return if(health_status && health_status != "Cancel") - R.fields[DATACORE_MENTAL_HEALTH] = health_status + target_record.fields[DATACORE_MENTAL_HEALTH] = health_status return return //Medical HUD ends here. if(href_list["hud"] == "s") - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return if(usr.stat || usr == src) //|| !usr.canmove || usr.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at. return //Non-fluff: This allows sec to set people to arrest as they get disarmed or beaten // Checks the user has security clearence before allowing them to change arrest status via hud, comment out to enable all access var/allowed_access = null - var/obj/item/clothing/glasses/hud/security/G = H.glasses - if(istype(G) && (G.obj_flags & EMAGGED)) + var/obj/item/clothing/glasses/hud/security/sec_hud = human_or_ghost_user.glasses + if(istype(sec_hud) && (sec_hud.obj_flags & EMAGGED)) allowed_access = "@%&ERROR_%$*" else //Implant and standard glasses check access - if(H.wear_id) - var/list/access = H.wear_id.GetAccess() + if(human_or_ghost_user.wear_id) + var/list/access = human_or_ghost_user.wear_id.GetAccess() if(ACCESS_SEC_DOORS in access) - allowed_access = H.get_authentification_name() + allowed_access = human_or_ghost_user.get_authentification_name() if(!allowed_access) - to_chat(H, "ERROR: Invalid access.") + to_chat(human_or_ghost_user, "ERROR: Invalid access.") return if(!perpname) - to_chat(H, "ERROR: Can not identify target.") + to_chat(human_or_ghost_user, "ERROR: Can not identify target.") return - var/datum/data/record/security_record = SSdatacore.get_records(DATACORE_RECORDS_SECURITY)[perpname] + var/datum/data/record/security_record = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(!R) + if(!target_record) to_chat(usr, "ERROR: Unable to locate data core entry for target.") return if(href_list["status"]) var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", security_record.fields[DATACORE_CRIMINAL_STATUS]) in list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel") if(setcriminal != "Cancel") - if(!R) + if(!target_record) return - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return investigate_log("[key_name(src)] has been set from [security_record.fields[DATACORE_CRIMINAL_STATUS]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) security_record.fields[DATACORE_CRIMINAL_STATUS] = setcriminal @@ -419,9 +420,9 @@ return if(href_list["view"]) - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return to_chat(usr, "Name: [security_record.fields[DATACORE_NAME]] Criminal Status: [security_record.fields[DATACORE_CRIMINAL_STATUS]]") for(var/datum/data/crime/c in security_record.fields[DATACORE_CRIMES]) @@ -439,9 +440,9 @@ var/t1 = stripped_input("Please input crime name:", "Security HUD", "", null) if(!security_record || !t1 || !allowed_access) return - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return var/crime = SSdatacore.new_crime_entry(t1, null, allowed_access, station_time_timestamp()) @@ -454,9 +455,9 @@ var/t1 = stripped_input(usr, "Please input crime details:", "Secure. records", "", null) if(!security_record || !t1 || !allowed_access) return - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return if(href_list["cdataid"]) @@ -466,9 +467,9 @@ return if(href_list["view_comment"]) - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return to_chat(usr, "Comments/Log:") var/counter = 1 @@ -482,9 +483,9 @@ var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null) if (!security_record || !t1 || !allowed_access) return - if(!H.canUseHUD()) + if(!human_or_ghost_user.canUseHUD()) return - if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return var/counter = 1 while(security_record.fields[text("com_[]", counter)]) @@ -565,9 +566,9 @@ //Check for arrest warrant if(judgement_criteria & JUDGE_RECORDCHECK) var/perpname = get_face_name(get_id_name()) - var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(R && R.fields[DATACORE_CRIMINAL_STATUS]) - switch(R.fields[DATACORE_CRIMINAL_STATUS]) + var/datum/data/record/target_record = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) + if(target_record && target_record.fields[DATACORE_CRIMINAL_STATUS]) + switch(target_record.fields[DATACORE_CRIMINAL_STATUS]) if("*Arrest*") threatcount += 5 if("Incarcerated") @@ -835,11 +836,11 @@ /mob/living/carbon/human/replace_records_name(oldname,newname) // Only humans have records right now, move this up if changed. for(var/id as anything in SSdatacore.library) var/datum/data_library/library = SSdatacore.library[id] - var/datum/data/record/R = library.get_record_by_name(oldname) - if(R) - R.fields[DATACORE_NAME] = newname + var/datum/data/record/target_record = library.get_record_by_name(oldname) + if(target_record) + target_record.fields[DATACORE_NAME] = newname library.records_by_name -= oldname - library.records_by_name[newname] = R + library.records_by_name[newname] = target_record /mob/living/carbon/human/get_total_tint() . = ..() diff --git a/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx b/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx index a9e9dec19502..3d0b1f95852c 100644 --- a/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx +++ b/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx @@ -17,7 +17,7 @@ import { MedicalRecord, MedicalRecordData } from './types'; /** Displays all found records. */ export const MedicalRecordTabs = (props, context) => { - const { act, data } = useBackend(context); + const { act, data } = useBackend(context); return ( @@ -25,7 +25,7 @@ export const MedicalRecordTabs = (props, context) => {
    {data.records.map((record, index) => ( - + ))}
    @@ -57,20 +57,27 @@ export const MedicalRecordTabs = (props, context) => { /** Individual crew tab */ const CrewTab = (props: { record: MedicalRecord }, context) => { - const [selectedRecord, setSelectedRecord] = useLocalState(context, 'medicalRecord', undefined); + const [selectedRecord, setSelectedRecord] = useLocalState( + context, + 'medicalRecord', + undefined + ); const { act, data } = useBackend(context); const { assigned_view } = data; const { record } = props; - const { crew_ref, name } = record; + const { record_ref, name } = record; /** Sets the record to preview */ const selectRecord = (record: MedicalRecord) => { - if (selectedRecord?.crew_ref === crew_ref) { + if (selectedRecord?.record_ref === record_ref) { setSelectedRecord(undefined); } else { setSelectedRecord(record); - act('view_record', { assigned_view: assigned_view, crew_ref: crew_ref }); + act('view_record', { + assigned_view: assigned_view, + record_ref: record_ref, + }); } }; @@ -78,9 +85,9 @@ const CrewTab = (props: { record: MedicalRecord }, context) => { selectRecord(record)} - selected={selectedRecord?.crew_ref === crew_ref} + selected={selectedRecord?.record_ref === record_ref} > - {name} + {name} ); }; diff --git a/tgui/packages/tgui/interfaces/Records/RecordView.tsx b/tgui/packages/tgui/interfaces/Records/RecordView.tsx index f010906a828a..3df7bb6d0200 100644 --- a/tgui/packages/tgui/interfaces/Records/RecordView.tsx +++ b/tgui/packages/tgui/interfaces/Records/RecordView.tsx @@ -34,14 +34,13 @@ export const MedicalRecordView = (props, context) => { const { age, blood_type, - crew_ref, + record_ref, dna, gender, disabilities, physical_status, mental_status, name, - quirk_notes, rank, species, } = foundRecord; @@ -50,19 +49,13 @@ export const MedicalRecordView = (props, context) => { return ( - - - - - -
    act('expunge_record', { crew_ref: crew_ref })} + onClick={() => act('expunge_record', { record_ref: record_ref })} tooltip="Expunge record data." /> } @@ -72,10 +65,10 @@ export const MedicalRecordView = (props, context) => { > - + - - + + { onEnter={(event, value) => act('edit_field', { field: 'age', - ref: crew_ref, + ref: record_ref, value: value, }) } @@ -94,14 +87,14 @@ export const MedicalRecordView = (props, context) => { @@ -109,14 +102,14 @@ export const MedicalRecordView = (props, context) => { @@ -131,7 +124,7 @@ export const MedicalRecordView = (props, context) => { key={index} onClick={() => act('set_physical_status', { - crew_ref: crew_ref, + record_ref: record_ref, physical_status: button, }) } @@ -161,7 +154,7 @@ export const MedicalRecordView = (props, context) => { key={index} onClick={() => act('set_mental_status', { - crew_ref: crew_ref, + record_ref: record_ref, mental_status: button, }) } diff --git a/tgui/packages/tgui/interfaces/Records/helpers.ts b/tgui/packages/tgui/interfaces/Records/helpers.ts index c17832024c7b..8b4318e59750 100644 --- a/tgui/packages/tgui/interfaces/Records/helpers.ts +++ b/tgui/packages/tgui/interfaces/Records/helpers.ts @@ -9,11 +9,15 @@ export const getQuirkStrings = (string: string) => { /** We need an active reference and this a pain to rewrite */ export const getMedicalRecord = (props, context) => { - const [selectedRecord, SetRecord] = useLocalState(context, 'medicalRecord', ''); - const { data } = useBackend(context); + const [selectedRecord, SetRecord] = useLocalState( + context, + 'medicalRecord', + '' + ); + const { data } = useBackend(context); const { records = [] } = data; const foundRecord = records.find( - (record) => record.crew_ref === selectedRecord.crew_ref, + (record) => record.record_ref === selectedRecord.record_ref ); if (!foundRecord) return; diff --git a/tgui/packages/tgui/interfaces/Records/index.tsx b/tgui/packages/tgui/interfaces/Records/index.tsx index 5e59fe145919..84690be26c78 100644 --- a/tgui/packages/tgui/interfaces/Records/index.tsx +++ b/tgui/packages/tgui/interfaces/Records/index.tsx @@ -8,7 +8,7 @@ import { MedicalRecordTabs } from './RecordTabs'; import { MedicalRecordView } from './RecordView'; export const Records = (props, context) => { - const { data } = useBackend(context); + const { data } = useBackend(context); const { authenticated } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Records/types.ts b/tgui/packages/tgui/interfaces/Records/types.ts index 7effb74772de..7547931c4b43 100644 --- a/tgui/packages/tgui/interfaces/Records/types.ts +++ b/tgui/packages/tgui/interfaces/Records/types.ts @@ -10,11 +10,10 @@ export type MedicalRecordData = { max_age: number; }; - export type MedicalRecord = { age: number; blood_type: string; - crew_ref: string; + record_ref: string; dna: string; gender: string; disabilities: string; From 8a842e349575d7881313f48af1b6e98dbb0ae76b Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 28 May 2024 05:48:16 -0500 Subject: [PATCH 22/47] yea --- code/__DEFINES/datacore.dm | 2 +- code/modules/clothing/glasses/hud.dm | 9 +++ .../mob/living/carbon/human/examine.dm | 60 +++++++++---------- code/modules/mob/living/carbon/human/human.dm | 6 ++ 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm index 440f6f47e334..3c61434ae757 100644 --- a/code/__DEFINES/datacore.dm +++ b/code/__DEFINES/datacore.dm @@ -30,7 +30,7 @@ //#define DATACORE_CITATIONS "citation" /// Keys for SSdatacore.library -#define DATACORE_RECORDS_OUTPOST "general" +#define DATACORE_RECORDS_OUTPOST "outpost" #define DATACORE_RECORDS_SECURITY "security" #define DATACORE_RECORDS_MEDICAL "medical" #define DATACORE_RECORDS_LOCKED "locked" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 385baa647432..d6268ce7676f 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -5,6 +5,15 @@ var/hud_type = null ///Used for topic calls. Just because you have a HUD display doesn't mean you should be able to interact with stuff. var/hud_trait = null + var/obj/docking_port/mobile/linked_ship + +/obj/item/clothing/glasses/hud/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) + . = ..() + linked_ship = port.current_ship + +/obj/item/clothing/glasses/hud/disconnect_from_shuttle(obj/docking_port/mobile/port) + . = ..() + linked_ship = null /obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) ..() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 543f7b9f87d2..7c270d8ca065 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -343,14 +343,36 @@ if (!isnull(trait_exam)) . += trait_exam - var/traitstring = get_trait_string() - var/perpname = get_face_name(get_id_name("")) if(perpname && (HAS_TRAIT(user, TRAIT_SECURITY_HUD) || HAS_TRAIT(user, TRAIT_MEDICAL_HUD))) - var/datum/data/record/R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_OUTPOST) - if(R) - . += "Rank: [R.fields[DATACORE_RANK]]\n\[Front photo\]\[Side photo\]" + var/obj/item/clothing/glasses/hud/glass_hud = user.get_item_by_slot(ITEM_SLOT_EYES) + var/linked_datacore = DATACORE_RECORDS_OUTPOST + if(glass_hud && glass_hud.linked_ship) + linked_datacore = glass_hud.linked_ship + var/datum/data/record/target_record = SSdatacore.get_record_by_name(perpname, linked_datacore) + if(target_record) + . += "
    found record for datacore: [linked_datacore] " + . += "Rank: [target_record.fields[DATACORE_RANK]] Name: [target_record.fields[DATACORE_NAME]]" + . += "\[Front photo\]\[Side photo\]" + if(HAS_TRAIT(user, TRAIT_MEDICAL_HUD)) + . += "\[[target_record.fields[DATACORE_PHYSICAL_HEALTH]]\]" + . += "\[[target_record.fields[DATACORE_MENTAL_HEALTH]]\]" + + if(HAS_TRAIT(user, TRAIT_SECURITY_HUD)) + var/criminal = "None" + criminal = target_record.fields[DATACORE_CRIMINAL_STATUS] + + . += "Criminal status: \[[criminal]\]" + . += jointext(list("Security record: \[View\]", + "\[Add crime\]", + "\[View comment log\]", + "\[Add comment\]"), "") + else + . += "
    no linked record in datacore: [linked_datacore]" + if(HAS_TRAIT(user, TRAIT_MEDICAL_HUD)) + . += "
    \[Medical Evaluation\]" + . += "\[See traits\]" var/cyberimp_detect for(var/obj/item/organ/cyberimp/CI in internal_organs) if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant) @@ -358,34 +380,6 @@ if(cyberimp_detect) . += "Detected cybernetic modifications:" . += "[cyberimp_detect]" - if(R) - var/health_r = R.fields[DATACORE_PHYSICAL_HEALTH] - . += "\[[health_r]\]" - health_r = R.fields[DATACORE_MENTAL_HEALTH] - . += "\[[health_r]\]" - R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_MEDICAL) - if(R) - . += "\[Medical evaluation\]
    " - if(traitstring) - . += "Detected physiological traits:" - . += "[traitstring]" - - if(HAS_TRAIT(user, TRAIT_SECURITY_HUD)) - if(!user.stat && user != src) - //|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at. - var/criminal = "None" - - R = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(R) - criminal = R.fields[DATACORE_CRIMINAL_STATUS] - - . += "Criminal status: \[[criminal]\]" - . += jointext(list("Security record: \[View\]", - "\[Add crime\]", - "\[View comment log\]", - "\[Add comment\]"), "") - else if(isobserver(user) && traitstring) - . += "Traits: [traitstring]" //No flavor text unless the face can be seen. Prevents certain metagaming with impersonation. var/invisible_man = skipface || get_visible_name() == "Unknown" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ab5238781840..15511cc443ed 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -374,6 +374,12 @@ if(health_status && health_status != "Cancel") target_record.fields[DATACORE_MENTAL_HEALTH] = health_status return + if(href_list["quirk"]) + var/quirkstring = get_trait_string() + if(quirkstring) + to_chat(human_or_ghost_user, "Detected physiological traits:\n[quirkstring]") + else + to_chat(human_or_ghost_user, "No physiological traits found.") return //Medical HUD ends here. if(href_list["hud"] == "s") From 8a8121f79ca51ee245ea4351105f29891dc038a0 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 28 May 2024 07:35:24 -0500 Subject: [PATCH 23/47] we are very close --- code/game/atoms.dm | 2 +- code/game/objects/items/devices/PDA/PDA.dm | 4 - code/game/objects/items/devices/PDA/cart.dm | 109 ------------------ .../game/objects/items/devices/ship_linker.dm | 26 +++++ code/modules/clothing/glasses/hud.dm | 7 +- shiptest.dme | 1 + 6 files changed, 34 insertions(+), 115 deletions(-) create mode 100644 code/game/objects/items/devices/ship_linker.dm diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b539e421508d..bb7447b47aae 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1338,7 +1338,7 @@ return ///Connect this atom to a shuttle -/atom/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) +/atom/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, handheld = FALSE) return /atom/proc/disconnect_from_shuttle(obj/docking_port/mobile/port) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index e58eb6486687..3e9d8a668fe0 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -248,10 +248,6 @@ GLOBAL_LIST_EMPTY(PDAs) dat += "
  • [PDAIMG(status)] Set Status Display
  • " if(cartridge.access & CART_ENGINE) dat += "
  • [PDAIMG(power)] Power Monitor
  • " - if(cartridge.access & CART_MEDICAL) - dat += "
  • [PDAIMG(medical)] Medical Records
  • " - if(cartridge.access & CART_SECURITY) - dat += "
  • [PDAIMG(cuffs)] Security Records
  • " if(cartridge.access & CART_QUARTERMASTER) dat += "
  • [PDAIMG(crate)] Supply Records
  • " diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 8e7b2df16af3..28a35332b334 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -309,99 +309,6 @@ Code: menu += "" - if (44) //medical records //This thing only displays a single screen so it's hard to really get the sub-menu stuff working. - menu = "

    [PDAIMG(medical)] Medical Record List

    " - if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - for(var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - menu += "[PDAIMG(medical)] [R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
    " - menu += "
    " - if(441) - menu = "

    [PDAIMG(medical)] Medical Record

    " - - if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - menu += "Name: [active1.fields[DATACORE_NAME]] ID: [active1.fields[DATACORE_ID]]
    " - menu += "Gender: [active1.fields[DATACORE_GENDER]]
    " - menu += "Age: [active1.fields[DATACORE_AGE]]
    " - menu += "Rank: [active1.fields[DATACORE_RANK]]
    " - menu += "Fingerprint: [active1.fields[DATACORE_FINGERPRINT]]
    " - menu += "Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]]
    " - menu += "Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]]
    " - else - menu += "Record Lost!
    " - - menu += "
    " - - menu += "

    [PDAIMG(medical)] Medical Data

    " - if(active2 in SSdatacore.get_records(DATACORE_RECORDS_MEDICAL)) - menu += "Blood Type: [active2.fields[DATACORE_BLOOD_TYPE]]

    " - - menu += "Minor Disabilities: [active2.fields["mi_dis"]]
    " - menu += "Details: [active2.fields["mi_dis_d"]]

    " - - menu += "Major Disabilities: [active2.fields[DATACORE_DISABILITIES]]
    " - menu += "Details: [active2.fields[DATACORE_DISABILITIES_DETAILS]]

    " - - menu += "Allergies: [active2.fields["alg"]]
    " - menu += "Details: [active2.fields["alg_d"]]

    " - - menu += "Current Diseases: [active2.fields[DATACORE_DISEASES]]
    " - menu += "Details: [active2.fields[DATACORE_DISEASES_DETAILS]]

    " - - menu += "Important Notes: [active2.fields[DATACORE_NOTES]]
    " - else - menu += "Record Lost!
    " - - menu += "
    " - if (45) //security records - menu = "

    [PDAIMG(cuffs)] Security Record List

    " - if(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - for (var/datum/data/record/R in sortRecord(SSdatacore.get_records(DATACORE_RECORDS_OUTPOST))) - menu += "[PDAIMG(cuffs)] [R.fields[DATACORE_ID]]: [R.fields[DATACORE_NAME]]
    " - - menu += "
    " - if(451) - menu = "

    [PDAIMG(cuffs)] Security Record

    " - - if(active1 in SSdatacore.get_records(DATACORE_RECORDS_OUTPOST)) - menu += "Name: [active1.fields[DATACORE_NAME]] ID: [active1.fields[DATACORE_ID]]
    " - menu += "Gender: [active1.fields[DATACORE_GENDER]]
    " - menu += "Age: [active1.fields[DATACORE_AGE]]
    " - menu += "Rank: [active1.fields[DATACORE_RANK]]
    " - menu += "Fingerprint: [active1.fields[DATACORE_FINGERPRINT]]
    " - menu += "Physical Status: [active1.fields[DATACORE_PHYSICAL_HEALTH]]
    " - menu += "Mental Status: [active1.fields[DATACORE_MENTAL_HEALTH]]
    " - else - menu += "Record Lost!
    " - - menu += "
    " - - menu += "

    [PDAIMG(cuffs)] Security Data

    " - if(active3 in SSdatacore.get_records(DATACORE_RECORDS_SECURITY)) - menu += "Criminal Status: [active3.fields[DATACORE_CRIMINAL_STATUS]]
    " - - menu += text("
    \nCrimes:") - - menu +={" - - - - - -"} - for(var/datum/data/crime/c in active3.fields[DATACORE_CRIMES]) - menu += "" - menu += "" - menu += "" - menu += "" - menu += "" - menu += "
    CrimeDetailsAuthorTime Added
    [c.crimeName][c.crimeDetails][c.author][c.time]
    " - menu += "
    \nImportant Notes:
    " - menu += "[active3.fields[DATACORE_NOTES]]" - else - menu += "Record Lost!
    " - - menu += "
    " - if (49) //janitorial locator // hey there people, so there were two in world loops here that didnt have a timer assosciated with them. // and instead of redoing this to not be actually god awful for perf and malcontent issues, I've removed it entirely. @@ -465,22 +372,6 @@ Code: return switch(href_list["choice"]) - if("Medical Records") - active1 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_OUTPOST) - if(active1) - active2 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_MEDICAL) - host_pda.mode = 441 - if(!active2) - active1 = null - - if("Security Records") - active1 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_OUTPOST) - if(active1) - active3 = SSdatacore.find_record(DATACORE_ID, href_list["target"], DATACORE_RECORDS_SECURITY) - host_pda.mode = 451 - if(!active3) - active1 = null - if("Send Signal") INVOKE_ASYNC(radio, TYPE_PROC_REF(/obj/item/integrated_signaler, send_activation)) diff --git a/code/game/objects/items/devices/ship_linker.dm b/code/game/objects/items/devices/ship_linker.dm new file mode 100644 index 000000000000..fb75d5e5483c --- /dev/null +++ b/code/game/objects/items/devices/ship_linker.dm @@ -0,0 +1,26 @@ +/obj/item/ship_linker + name = "Ship Linker" + icon = 'icons/obj/tools.dmi' + icon_state = "multitool" + var/datum/overmap/ship/controlled/linked_ship + +/obj/item/ship_linker/examine(mob/user) + . = ..() + if(linked_ship) + . += "Linked to: [linked_ship]" + +/obj/item/ship_linker/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) + . = ..() + linked_ship = port.current_ship + +/obj/item/ship_linker/disconnect_from_shuttle(obj/docking_port/mobile/port) + . = ..() + linked_ship = null + +/obj/item/ship_linker/afterattack(atom/target, mob/user, proximity) + . = ..() + if(!proximity || !check_allowed_items(target)) + return + target.connect_to_shuttle(linked_ship.shuttle_port, linked_ship.shuttle_port.docked, TRUE) + to_chat(user, span_notice("You link the [target] to the [linked_ship].")) + playsound(src, 'sound/weapons/empty.ogg', 30, TRUE) diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index d6268ce7676f..c4f5638c3748 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -5,7 +5,7 @@ var/hud_type = null ///Used for topic calls. Just because you have a HUD display doesn't mean you should be able to interact with stuff. var/hud_trait = null - var/obj/docking_port/mobile/linked_ship + var/datum/overmap/ship/controlled/linked_ship /obj/item/clothing/glasses/hud/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) . = ..() @@ -15,6 +15,11 @@ . = ..() linked_ship = null +/obj/item/clothing/glasses/hud/examine(mob/user) + . = ..() + if(linked_ship) + . += "It is currently connected to [linked_ship] records." + /obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) ..() if(slot != ITEM_SLOT_EYES) diff --git a/shiptest.dme b/shiptest.dme index 57038df93749..f9c1ffec43e0 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1216,6 +1216,7 @@ #include "code\game\objects\items\devices\reverse_bear_trap.dm" #include "code\game\objects\items\devices\scanners.dm" #include "code\game\objects\items\devices\sensor_device.dm" +#include "code\game\objects\items\devices\ship_linker.dm" #include "code\game\objects\items\devices\spyglasses.dm" #include "code\game\objects\items\devices\swapper.dm" #include "code\game\objects\items\devices\taperecorder.dm" From ad74c95e504d4161d46c39336a8b36cd05bc0c75 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 28 May 2024 08:28:37 -0500 Subject: [PATCH 24/47] yea --- code/__HELPERS/icons.dm | 266 ++++++++---------- .../game/objects/items/devices/ship_linker.dm | 6 +- code/modules/datacore/records.dm | 13 +- code/modules/mob/living/carbon/human/human.dm | 6 +- 4 files changed, 138 insertions(+), 153 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 38e540e996b9..11f1bd430a81 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -712,206 +712,180 @@ world /// appearance system (overlays/underlays, etc.) is not available. /// /// Only the first argument is required. -/proc/getFlatIcon(image/A, defdir, deficon, defstate, defblend, start = TRUE, no_anim = TRUE) - //Define... defines. +/proc/getFlatIcon(image/appearance, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE) + // Loop through the underlays, then overlays, sorting them into the layers list + #define PROCESS_OVERLAYS_OR_UNDERLAYS(flat, process, base_layer) \ + for (var/i in 1 to process.len) { \ + var/image/current = process[i]; \ + if (!current) { \ + continue; \ + } \ + if (current.plane != FLOAT_PLANE && current.plane != appearance.plane) { \ + continue; \ + } \ + var/current_layer = current.layer; \ + if (current_layer < 0) { \ + if (current_layer <= -1000) { \ + return flat; \ + } \ + current_layer = base_layer + appearance.layer + current_layer / 1000; \ + } \ + for (var/index_to_compare_to in 1 to layers.len) { \ + var/compare_to = layers[index_to_compare_to]; \ + if (current_layer < layers[compare_to]) { \ + layers.Insert(index_to_compare_to, current); \ + break; \ + } \ + } \ + layers[current] = current_layer; \ + } + var/static/icon/flat_template = icon('icons/blanks/32x32.dmi', "nothing") - #define BLANK icon(flat_template) - #define SET_SELF(SETVAR) do { \ - var/icon/SELF_ICON=icon(icon(curicon, curstate, base_icon_dir),"",SOUTH,no_anim?1:null); \ - if(A.alpha<255) { \ - SELF_ICON.Blend(rgb(255,255,255,A.alpha),ICON_MULTIPLY);\ - } \ - if(A.color) { \ - if(islist(A.color)){ \ - SELF_ICON.MapColors(arglist(A.color))} \ - else{ \ - SELF_ICON.Blend(A.color,ICON_MULTIPLY)} \ - } \ - ##SETVAR=SELF_ICON;\ - } while (0) - #define INDEX_X_LOW 1 - #define INDEX_X_HIGH 2 - #define INDEX_Y_LOW 3 - #define INDEX_Y_HIGH 4 - - #define flatX1 flat_size[INDEX_X_LOW] - #define flatX2 flat_size[INDEX_X_HIGH] - #define flatY1 flat_size[INDEX_Y_LOW] - #define flatY2 flat_size[INDEX_Y_HIGH] - #define addX1 add_size[INDEX_X_LOW] - #define addX2 add_size[INDEX_X_HIGH] - #define addY1 add_size[INDEX_Y_LOW] - #define addY2 add_size[INDEX_Y_HIGH] - - if(!A || A.alpha <= 0) - return BLANK - - var/noIcon = FALSE + if(!appearance || appearance.alpha <= 0) + return icon(flat_template) + if(start) if(!defdir) - defdir = A.dir + defdir = appearance.dir if(!deficon) - deficon = A.icon + deficon = appearance.icon if(!defstate) - defstate = A.icon_state + defstate = appearance.icon_state if(!defblend) - defblend = A.blend_mode + defblend = appearance.blend_mode + + var/curicon = appearance.icon || deficon + var/curstate = appearance.icon_state || defstate + var/curdir = (!appearance.dir || appearance.dir == SOUTH) ? defdir : appearance.dir - var/curicon = A.icon || deficon - var/curstate = A.icon_state || defstate + var/render_icon = curicon - if(!((noIcon = (!curicon)))) + if (render_icon) var/curstates = icon_states(curicon) if(!(curstate in curstates)) - if("" in curstates) + if ("" in curstates) curstate = "" else - noIcon = TRUE // Do not render this object. + render_icon = FALSE - var/curdir - var/base_icon_dir //We'll use this to get the icon state to display if not null BUT NOT pass it to overlays as the dir we have - - //These should use the parent's direction (most likely) - if(!A.dir || A.dir == SOUTH) - curdir = defdir - else - curdir = A.dir + var/base_icon_dir //We'll use this to get the icon state to display if not null BUT NOT pass it to overlays as the dir we have //Try to remove/optimize this section ASAP, CPU hog. //Determines if there's directionals. - if(!noIcon && curdir != SOUTH) - var/exist = FALSE - var/static/list/checkdirs = list(NORTH, EAST, WEST) - for(var/i in checkdirs) //Not using GLOB for a reason. - if(length(icon_states(icon(curicon, curstate, i)))) - exist = TRUE - break - if(!exist) + if(render_icon && curdir != SOUTH) + if ( + !length(icon_states(icon(curicon, curstate, NORTH))) \ + && !length(icon_states(icon(curicon, curstate, EAST))) \ + && !length(icon_states(icon(curicon, curstate, WEST))) \ + ) base_icon_dir = SOUTH - // if(!base_icon_dir) base_icon_dir = curdir - ASSERT(!BLEND_DEFAULT) //I might just be stupid but lets make sure this define is 0. + var/curblend = appearance.blend_mode || defblend - var/curblend = A.blend_mode || defblend - - if(A.overlays.len || A.underlays.len) - var/icon/flat = BLANK + if(appearance.overlays.len || appearance.underlays.len) + var/icon/flat = icon(flat_template) // Layers will be a sorted list of icons/overlays, based on the order in which they are displayed var/list/layers = list() var/image/copy // Add the atom's icon itself, without pixel_x/y offsets. - if(!noIcon) - copy = image(icon=curicon, icon_state=curstate, layer=A.layer, dir=base_icon_dir) - copy.color = A.color - copy.alpha = A.alpha + if(render_icon) + copy = image(icon=curicon, icon_state=curstate, layer=appearance.layer, dir=base_icon_dir) + copy.color = appearance.color + copy.alpha = appearance.alpha copy.blend_mode = curblend - layers[copy] = A.layer - - // Loop through the underlays, then overlays, sorting them into the layers list - for(var/process_set in 0 to 1) - var/list/process = process_set? A.overlays : A.underlays - for(var/i in 1 to process.len) - var/image/current = process[i] - if(!current) - continue - if(current.plane != FLOAT_PLANE && current.plane != A.plane) - continue - var/current_layer = current.layer - if(current_layer < 0) - if(current_layer <= -1000) - return flat - current_layer = process_set + A.layer + current_layer / 1000 - - for(var/p in 1 to layers.len) - var/image/cmp = layers[p] - if(current_layer < layers[cmp]) - layers.Insert(p, current) - break - layers[current] = current_layer - - //sortTim(layers, /proc/cmp_image_layer_asc) + layers[copy] = appearance.layer + + PROCESS_OVERLAYS_OR_UNDERLAYS(flat, appearance.underlays, 0) + PROCESS_OVERLAYS_OR_UNDERLAYS(flat, appearance.overlays, 1) var/icon/add // Icon of overlay being added - // Current dimensions of flattened icon - var/list/flat_size = list(1, flat.Width(), 1, flat.Height()) - // Dimensions of overlay being added - var/list/add_size[4] + var/flatX1 = 1 + var/flatX2 = flat.Width() + var/flatY1 = 1 + var/flatY2 = flat.Height() - for(var/V in layers) - var/image/I = V - if(I.alpha == 0) + var/addX1 = 0 + var/addX2 = 0 + var/addY1 = 0 + var/addY2 = 0 + + for(var/image/layer_image as anything in layers) + if(layer_image.alpha == 0) continue - if(I == copy) // 'I' is an /image based on the object being flattened. + if(layer_image == copy) // 'layer_image' is an /image based on the object being flattened. curblend = BLEND_OVERLAY - add = icon(I.icon, I.icon_state, base_icon_dir) + add = icon(layer_image.icon, layer_image.icon_state, base_icon_dir) else // 'I' is an appearance object. - add = getFlatIcon(image(I), curdir, curicon, curstate, curblend, FALSE, no_anim) + add = getFlatIcon(image(layer_image), curdir, curicon, curstate, curblend, FALSE, no_anim) if(!add) continue + // Find the new dimensions of the flat icon to fit the added overlay - add_size = list( - min(flatX1, I.pixel_x+1), - max(flatX2, I.pixel_x+add.Width()), - min(flatY1, I.pixel_y+1), - max(flatY2, I.pixel_y+add.Height()) + addX1 = min(flatX1, layer_image.pixel_x + 1) + addX2 = max(flatX2, layer_image.pixel_x + add.Width()) + addY1 = min(flatY1, layer_image.pixel_y + 1) + addY2 = max(flatY2, layer_image.pixel_y + add.Height()) + + if ( + addX1 != flatX1 \ + && addX2 != flatX2 \ + && addY1 != flatY1 \ + && addY2 != flatY2 \ ) - - if(flat_size ~! add_size) // Resize the flattened icon so the new icon fits flat.Crop( - addX1 - flatX1 + 1, - addY1 - flatY1 + 1, - addX2 - flatX1 + 1, - addY2 - flatY1 + 1 + addX1 - flatX1 + 1, + addY1 - flatY1 + 1, + addX2 - flatX1 + 1, + addY2 - flatY1 + 1 ) - flat_size = add_size.Copy() + + flatX1 = addX1 + flatX2 = addY1 + flatY1 = addX2 + flatY2 = addY2 // Blend the overlay into the flattened icon - flat.Blend(add, blendMode2iconMode(curblend), I.pixel_x + 2 - flatX1, I.pixel_y + 2 - flatY1) + flat.Blend(add, blendMode2iconMode(curblend), layer_image.pixel_x + 2 - flatX1, layer_image.pixel_y + 2 - flatY1) - if(A.color) - if(islist(A.color)) - flat.MapColors(arglist(A.color)) + if(appearance.color) + if(islist(appearance.color)) + flat.MapColors(arglist(appearance.color)) else - flat.Blend(A.color, ICON_MULTIPLY) + flat.Blend(appearance.color, ICON_MULTIPLY) - if(A.alpha < 255) - flat.Blend(rgb(255, 255, 255, A.alpha), ICON_MULTIPLY) + if(appearance.alpha < 255) + flat.Blend(rgb(255, 255, 255, appearance.alpha), ICON_MULTIPLY) if(no_anim) //Clean up repeated frames var/icon/cleaned = new /icon() cleaned.Insert(flat, "", SOUTH, 1, 0) - . = cleaned + return cleaned else - . = icon(flat, "", SOUTH) - else //There's no overlays. - if(!noIcon) - SET_SELF(.) - - //Clear defines - #undef flatX1 - #undef flatX2 - #undef flatY1 - #undef flatY2 - #undef addX1 - #undef addX2 - #undef addY1 - #undef addY2 - - #undef INDEX_X_LOW - #undef INDEX_X_HIGH - #undef INDEX_Y_LOW - #undef INDEX_Y_HIGH - - #undef BLANK - #undef SET_SELF + return icon(flat, "", SOUTH) + else if (render_icon) // There's no overlays. + var/icon/final_icon = icon(icon(curicon, curstate, base_icon_dir), "", SOUTH, no_anim ? TRUE : null) + + if (appearance.alpha < 255) + final_icon.Blend(rgb(255,255,255, appearance.alpha), ICON_MULTIPLY) + + if (appearance.color) + if (islist(appearance.color)) + final_icon.MapColors(arglist(appearance.color)) + else + final_icon.Blend(appearance.color, ICON_MULTIPLY) + + return final_icon + + #undef PROCESS_OVERLAYS_OR_UNDERLAYS + /proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A. diff --git a/code/game/objects/items/devices/ship_linker.dm b/code/game/objects/items/devices/ship_linker.dm index fb75d5e5483c..c20520813a02 100644 --- a/code/game/objects/items/devices/ship_linker.dm +++ b/code/game/objects/items/devices/ship_linker.dm @@ -21,6 +21,8 @@ . = ..() if(!proximity || !check_allowed_items(target)) return - target.connect_to_shuttle(linked_ship.shuttle_port, linked_ship.shuttle_port.docked, TRUE) - to_chat(user, span_notice("You link the [target] to the [linked_ship].")) playsound(src, 'sound/weapons/empty.ogg', 30, TRUE) + if(do_after(user, 3 SECONDS, TRUE, src)) + target.connect_to_shuttle(linked_ship.shuttle_port, linked_ship.shuttle_port.docked, TRUE) + to_chat(user, span_notice("You link the [target] to the [linked_ship].")) + playsound(src, 'sound/weapons/empty.ogg', 30, TRUE) diff --git a/code/modules/datacore/records.dm b/code/modules/datacore/records.dm index 6a5356c5469b..ad06a81a0a9b 100644 --- a/code/modules/datacore/records.dm +++ b/code/modules/datacore/records.dm @@ -51,16 +51,21 @@ * returns the generated/cached photo otherwise. */ /datum/data/record/proc/get_photo(field_name, orientation) - if(fields[field_name]) - return fields[field_name] + if(!field_name) + return if(!fields[DATACORE_APPEARANCE]) return new /icon() var/mutable_appearance/character_appearance = fields[DATACORE_APPEARANCE] - character_appearance.setDir(orientation) - var/icon/picture_image = getFlatIcon(character_appearance) + var/icon/picture_image + if(!isicon(character_appearance)) + var/mutable_appearance/appearance = character_appearance + appearance.setDir(orientation) + picture_image = getFlatIcon(appearance) + else + picture_image = character_appearance var/datum/picture/picture = new picture.picture_name = "[fields[DATACORE_NAME]]" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 15511cc443ed..b18e35ef361c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -283,7 +283,11 @@ var/perpname = get_face_name(get_id_name("")) if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD)) return - var/datum/data/record/target_record = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_OUTPOST) + var/obj/item/clothing/glasses/hud/glass_hud = human_or_ghost_user.get_item_by_slot(ITEM_SLOT_EYES) + var/linked_datacore = DATACORE_RECORDS_OUTPOST + if(glass_hud && glass_hud.linked_ship) + linked_datacore = glass_hud.linked_ship + var/datum/data/record/target_record = SSdatacore.get_record_by_name(perpname, linked_datacore) if(href_list["photo_front"] || href_list["photo_side"]) if(!target_record) return From 54ecbb180c654551385e734c3bc6262f15fb5cc1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 28 May 2024 08:45:40 -0500 Subject: [PATCH 25/47] sechud stuff works --- code/modules/mob/living/carbon/human/human.dm | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b18e35ef361c..5561f9e42b33 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -410,13 +410,11 @@ to_chat(human_or_ghost_user, "ERROR: Can not identify target.") return - var/datum/data/record/security_record = SSdatacore.get_record_by_name(perpname, DATACORE_RECORDS_SECURITY) - if(!target_record) to_chat(usr, "ERROR: Unable to locate data core entry for target.") return if(href_list["status"]) - var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", security_record.fields[DATACORE_CRIMINAL_STATUS]) in list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel") + var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", target_record.fields[DATACORE_CRIMINAL_STATUS]) in list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel") if(setcriminal != "Cancel") if(!target_record) return @@ -424,8 +422,8 @@ return if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return - investigate_log("[key_name(src)] has been set from [security_record.fields[DATACORE_CRIMINAL_STATUS]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) - security_record.fields[DATACORE_CRIMINAL_STATUS] = setcriminal + investigate_log("[key_name(src)] has been set from [target_record.fields[DATACORE_CRIMINAL_STATUS]] to [setcriminal] by [key_name(usr)].", INVESTIGATE_RECORDS) + target_record.fields[DATACORE_CRIMINAL_STATUS] = setcriminal sec_hud_set_security_status() return @@ -434,8 +432,8 @@ return if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return - to_chat(usr, "Name: [security_record.fields[DATACORE_NAME]] Criminal Status: [security_record.fields[DATACORE_CRIMINAL_STATUS]]") - for(var/datum/data/crime/c in security_record.fields[DATACORE_CRIMES]) + to_chat(usr, "Name: [target_record.fields[DATACORE_NAME]] Criminal Status: [target_record.fields[DATACORE_CRIMINAL_STATUS]]") + for(var/datum/data/crime/c in target_record.fields[DATACORE_CRIMES]) to_chat(usr, "Crime: [c.crimeName]") if (c.crimeDetails) to_chat(usr, "Details: [c.crimeDetails]") @@ -443,12 +441,12 @@ to_chat(usr, "Details: \[Add details]") to_chat(usr, "Added by [c.author] at [c.time]") to_chat(usr, "----------") - to_chat(usr, "Notes: [security_record.fields[DATACORE_NOTES]]") + to_chat(usr, "Notes: [target_record.fields[DATACORE_NOTES]]") return if(href_list["add_crime"]) var/t1 = stripped_input("Please input crime name:", "Security HUD", "", null) - if(!security_record || !t1 || !allowed_access) + if(!target_record || !t1 || !allowed_access) return if(!human_or_ghost_user.canUseHUD()) return @@ -456,14 +454,14 @@ return var/crime = SSdatacore.new_crime_entry(t1, null, allowed_access, station_time_timestamp()) - security_record.add_crime(crime) - investigate_log("New Crime: [t1] | Added to [security_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) + target_record.add_crime(crime) + investigate_log("New Crime: [t1] | Added to [target_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) to_chat(usr, span_notice("Successfully added a crime.")) return if(href_list["add_details"]) var/t1 = stripped_input(usr, "Please input crime details:", "Secure. records", "", null) - if(!security_record || !t1 || !allowed_access) + if(!target_record || !t1 || !allowed_access) return if(!human_or_ghost_user.canUseHUD()) return @@ -471,8 +469,8 @@ return if(href_list["cdataid"]) - security_record.add_crime_details(href_list["cdataid"], t1) - investigate_log("New Crime details: [t1] | Added to [security_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) + target_record.add_crime_details(href_list["cdataid"], t1) + investigate_log("New Crime details: [t1] | Added to [target_record.fields[DATACORE_NAME]] by [key_name(usr)]", INVESTIGATE_RECORDS) to_chat(usr, span_notice("Successfully added details.")) return @@ -483,24 +481,24 @@ return to_chat(usr, "Comments/Log:") var/counter = 1 - while(security_record.fields[text("com_[]", counter)]) - to_chat(usr, security_record.fields[text("com_[]", counter)]) + while(target_record.fields[text("com_[]", counter)]) + to_chat(usr, target_record.fields[text("com_[]", counter)]) to_chat(usr, "----------") counter++ return if(href_list["add_comment"]) var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null) - if (!security_record || !t1 || !allowed_access) + if (!target_record || !t1 || !allowed_access) return if(!human_or_ghost_user.canUseHUD()) return if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD)) return var/counter = 1 - while(security_record.fields[text("com_[]", counter)]) + while(target_record.fields[text("com_[]", counter)]) counter++ - security_record.fields[text("com_[]", counter)] = text("Made by [] on [], []
    []", allowed_access, station_time_timestamp(), sector_datestamp(shortened = TRUE), t1) + target_record.fields[text("com_[]", counter)] = text("Made by [] on [], []
    []", allowed_access, station_time_timestamp(), sector_datestamp(shortened = TRUE), t1) to_chat(usr, "Successfully added comment.") return From e750ac46d1cf602968256f357666306770076c1e Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 28 May 2024 11:02:01 -0500 Subject: [PATCH 26/47] alot --- code/controllers/subsystem/datacore.dm | 16 +- .../game/machinery/computer/record/medical.dm | 34 +++ .../game/machinery/computer/record/records.dm | 95 ++++-- .../machinery/computer/record/security.dm | 42 +++ code/modules/photography/camera/camera.dm | 4 +- sound/machines/terminal_error.ogg | Bin 0 -> 5455 bytes .../RecordTabs.tsx | 6 +- .../RecordView.tsx | 0 .../{Records => MedicalRecords}/constants.ts | 0 .../{Records => MedicalRecords}/helpers.ts | 0 .../{Records => MedicalRecords}/index.tsx | 2 +- .../{Records => MedicalRecords}/types.ts | 0 .../SecurityRecords/CrimeWatcher.tsx | 284 ++++++++++++++++++ .../interfaces/SecurityRecords/RecordTabs.tsx | 87 ++++++ .../interfaces/SecurityRecords/RecordView.tsx | 193 ++++++++++++ .../interfaces/SecurityRecords/constants.ts | 15 + .../interfaces/SecurityRecords/helpers.ts | 73 +++++ .../tgui/interfaces/SecurityRecords/index.tsx | 83 +++++ .../tgui/interfaces/SecurityRecords/types.ts | 52 ++++ 19 files changed, 943 insertions(+), 43 deletions(-) create mode 100644 sound/machines/terminal_error.ogg rename tgui/packages/tgui/interfaces/{Records => MedicalRecords}/RecordTabs.tsx (92%) rename tgui/packages/tgui/interfaces/{Records => MedicalRecords}/RecordView.tsx (100%) rename tgui/packages/tgui/interfaces/{Records => MedicalRecords}/constants.ts (100%) rename tgui/packages/tgui/interfaces/{Records => MedicalRecords}/helpers.ts (100%) rename tgui/packages/tgui/interfaces/{Records => MedicalRecords}/index.tsx (97%) rename tgui/packages/tgui/interfaces/{Records => MedicalRecords}/types.ts (100%) create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/CrimeWatcher.tsx create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/RecordTabs.tsx create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/RecordView.tsx create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/constants.ts create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/helpers.ts create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/index.tsx create mode 100644 tgui/packages/tgui/interfaces/SecurityRecords/types.ts diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index 85aac94afacc..ca8c56d2d2fd 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -182,15 +182,9 @@ SUBSYSTEM_DEF(datacore) G.fields[DATACORE_AGE] = H.age G.fields[DATACORE_SPECIES] = H.dna.species.name G.fields[DATACORE_FINGERPRINT] = md5(H.dna.uni_identity) - G.fields[DATACORE_PHYSICAL_HEALTH] = "Active" - G.fields[DATACORE_MENTAL_HEALTH] = "Stable" + G.fields[DATACORE_PHYSICAL_HEALTH] = PHYSICAL_ACTIVE + G.fields[DATACORE_MENTAL_HEALTH] = MENTAL_STABLE G.fields[DATACORE_GENDER] = H.gender - if(H.gender == "male") - G.fields[DATACORE_GENDER] = "Male" - else if(H.gender == "female") - G.fields[DATACORE_GENDER] = "Female" - else - G.fields[DATACORE_GENDER] = "Other" G.fields[DATACORE_APPEARANCE] = character_appearance G.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type.name @@ -211,6 +205,12 @@ SUBSYSTEM_DEF(datacore) else library[custom_library].inject_record(G) +/datum/controller/subsystem/datacore/proc/create_record(library_target, name) + var/datum/data/record/new_record = new /datum/data/record + new_record.fields[DATACORE_NAME] = name + library[library_target].inject_record(new_record) + return new_record + /** * Supporing proc for getting general records * and using them as pAI ui data. This gets diff --git a/code/game/machinery/computer/record/medical.dm b/code/game/machinery/computer/record/medical.dm index 7e7179d33036..532aba0990f6 100644 --- a/code/game/machinery/computer/record/medical.dm +++ b/code/game/machinery/computer/record/medical.dm @@ -9,6 +9,39 @@ circuit = /obj/item/circuitboard/computer/med_data light_color = LIGHT_COLOR_BLUE +/obj/machinery/computer/records/med/ui_interact(mob/user, datum/tgui/ui) + . = ..() + if(.) + return + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "MedicalRecords") + ui.set_autoupdate(FALSE) + ui.open() + +/obj/machinery/computer/records/med/ui_data(mob/user) + var/list/data = ..() + + var/list/records = list() + for(var/datum/data/record/target in SSdatacore.get_records(linked_ship)) + records += list(list( + age = target.fields[DATACORE_AGE], + blood_type = target.fields[DATACORE_BLOOD_TYPE], + record_ref = REF(target), + dna = target.fields[DATACORE_BLOOD_DNA], + gender = target.fields[DATACORE_GENDER], + disabilities = target.fields[DATACORE_DISABILITIES], + physical_status = target.fields[DATACORE_PHYSICAL_HEALTH], + mental_status = target.fields[DATACORE_MENTAL_HEALTH], + name = target.fields[DATACORE_NAME], + rank = target.fields[DATACORE_RANK], + species = target.fields[DATACORE_SPECIES], + )) + + data["records"] = records + + return data + /obj/machinery/computer/records/med/syndie icon_keyboard = "syndie_key" @@ -20,3 +53,4 @@ icon_keyboard = "laptop_key" pass_flags = PASSTABLE unique_icon = TRUE + diff --git a/code/game/machinery/computer/record/records.dm b/code/game/machinery/computer/record/records.dm index 45f1ed76b6f1..1a4532a33177 100644 --- a/code/game/machinery/computer/record/records.dm +++ b/code/game/machinery/computer/record/records.dm @@ -17,15 +17,13 @@ . = ..() linked_ship = null -/obj/machinery/computer/records/ui_interact(mob/user, datum/tgui/ui) +/* +/obj/machinery/computer/records/attacked_by(obj/item/attacking_item, mob/living/user) . = ..() - if(.) + if(!istype(attacking_item, /obj/item/photo)) return - ui = SStgui.try_update_ui(user, src, ui) - if (!ui) - ui = new(user, src, "Records") - ui.set_autoupdate(FALSE) - ui.open() + insert_new_record(user, attacking_item) +*/ /obj/machinery/computer/records/ui_static_data(mob/user) var/list/data = list() @@ -43,24 +41,6 @@ if(!has_access) return data - var/list/records = list() - for(var/datum/data/record/target in SSdatacore.get_records(linked_ship)) - records += list(list( - age = target.fields[DATACORE_AGE], - blood_type = target.fields[DATACORE_BLOOD_TYPE], - record_ref = REF(target), - dna = target.fields[DATACORE_BLOOD_DNA], - gender = target.fields[DATACORE_GENDER], - disabilities = target.fields[DATACORE_DISABILITIES], - physical_status = target.fields[DATACORE_PHYSICAL_HEALTH], - mental_status = target.fields[DATACORE_MENTAL_HEALTH], - name = target.fields[DATACORE_NAME], - rank = target.fields[DATACORE_RANK], - species = target.fields[DATACORE_SPECIES], - )) - - data["records"] = records - return data /obj/machinery/computer/records/ui_act(action, list/params, datum/tgui/ui) @@ -81,7 +61,19 @@ expunge_record_info(target) balloon_alert(user, "record expunged") investigate_log("[key_name(user)] expunged the record of [target[DATACORE_NAME]].", INVESTIGATE_RECORDS) + return TRUE + + if("purge_records") + SSdatacore.wipe_records(linked_ship) + return TRUE + + if("new_record") + var/name = stripped_input(user, "Enter the name of the new record.", "New Record", "", MAX_NAME_LEN) + if(!name) + return FALSE + SSdatacore.create_record(linked_ship, name) + balloon_alert(user, "record created") return TRUE if("login") @@ -136,10 +128,6 @@ return FALSE -/// Expunges info from a record. -/obj/machinery/computer/records/proc/expunge_record_info(datum/record/target) - return - /obj/machinery/computer/records/proc/secure_login(mob/user) if(!is_operational) return FALSE @@ -152,3 +140,52 @@ playsound(src, 'sound/machines/terminal_on.ogg', 70, TRUE) return TRUE + +/// Deletes medical information from a record. +/obj/machinery/computer/records/proc/expunge_record_info(datum/data/record/target) + if(!target) + return FALSE + + target.fields[DATACORE_NAME] = "Unknown" + target.fields[DATACORE_AGE] = 18 + target.fields[DATACORE_GENDER] = "Unknown" + target.fields[DATACORE_SPECIES] = "Unknown" + target.fields[DATACORE_BLOOD_TYPE] = pick(list("A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-")) + target.fields[DATACORE_BLOOD_DNA] = "Unknown" + target.fields[DATACORE_DISABILITIES] = "" + target.fields[DATACORE_DISABILITIES_DETAILS] = "" + target.fields[DATACORE_PHYSICAL_HEALTH] = "" + target.fields[DATACORE_MENTAL_HEALTH] = "" + target.fields[DATACORE_RANK] = "Unknown" + + return TRUE + +/* +/obj/machinery/computer/records/proc/insert_new_record(mob/user, obj/item/photo/mugshot) + if(!mugshot || !is_operational) + return FALSE + + if(!authenticated && !allowed(user)) + balloon_alert(user, "access denied") + playsound(src, 'sound/machines/terminal_error.ogg', 70, TRUE) + return FALSE + + if(mugshot.picture.psize_x > world.icon_size || mugshot.picture.psize_y > world.icon_size) + balloon_alert(user, "photo too large!") + playsound(src, 'sound/machines/terminal_error.ogg', 70, TRUE) + return FALSE + + var/trimmed = copytext(mugshot.name, 9, MAX_NAME_LEN) // Remove "photo - " + var/name = stripped_input(user, "Enter the name of the new record.", "New Record", trimmed, MAX_NAME_LEN) + if(!name || !is_operational || !mugshot || QDELETED(mugshot) || QDELETED(src)) + return FALSE + + var/datum/data/record/new_record = SSdatacore.create_record(linked_ship, name) + new_record.fields[DATACORE_APPEARANCE] = mugshot.picture.picture_image + balloon_alert(user, "record created") + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 70, TRUE) + + qdel(mugshot) + + return TRUE +*/ diff --git a/code/game/machinery/computer/record/security.dm b/code/game/machinery/computer/record/security.dm index 157587597c87..da2c48ddee29 100644 --- a/code/game/machinery/computer/record/security.dm +++ b/code/game/machinery/computer/record/security.dm @@ -7,6 +7,48 @@ circuit = /obj/item/circuitboard/computer/secure_data light_color = COLOR_SOFT_RED +/obj/machinery/computer/records/sec/ui_interact(mob/user, datum/tgui/ui) + . = ..() + if(.) + return + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "SecurityRecords") + ui.set_autoupdate(FALSE) + ui.open() + +/obj/machinery/computer/records/med/ui_data(mob/user) + var/list/data = ..() + + data["available_statuses"] = WANTED_STATUSES() + data["current_user"] = user.name + + var/list/records = list() + for(var/datum/data/record/target in SSdatacore.get_records(linked_ship)) + var/list/crimes = list() + for(var/datum/data/crime/crime in target.fields[DATACORE_CRIMES]) + crimes += list(list( + author = crime.author, + crime_ref = REF(crime), + details = crime.crimeDetails, + name = crime.crimeName, + time = crime.time, + )) + records += list(list( + age = target.fields[DATACORE_AGE], + record_ref = REF(target), + fingerprint = target.fields[DATACORE_FINGERPRINT], + gender = target.fields[DATACORE_GENDER], + name = target.fields[DATACORE_NAME], + rank = target.fields[DATACORE_RANK], + species = target.fields[DATACORE_SPECIES], + wanted_status = target.fields[DATACORE_CRIMINAL_STATUS], + )) + + data["records"] = records + + return data + /obj/machinery/computer/records/sec/syndie icon_keyboard = "syndie_key" diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 93b8319dbed7..5223da803b76 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -172,8 +172,8 @@ if(!isturf(target_turf)) blending = FALSE return FALSE - size_x = clamp(size_x, CAMERA_PICTURE_SIZE_HARD_MINIMUM, CAMERA_PICTURE_SIZE_HARD_LIMIT) - size_y = clamp(size_y, CAMERA_PICTURE_SIZE_HARD_MINIMUM, CAMERA_PICTURE_SIZE_HARD_LIMIT) + size_x = clamp(size_x, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT) + size_y = clamp(size_y, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT) var/list/desc = list("This is a photo of an area of [size_x+1] meters by [size_y+1] meters.") var/list/mobs_spotted = list() var/list/dead_spotted = list() diff --git a/sound/machines/terminal_error.ogg b/sound/machines/terminal_error.ogg new file mode 100644 index 0000000000000000000000000000000000000000..22556e5ea4b0f2901131756df208788631d13619 GIT binary patch literal 5455 zcmeHLd011|w%-|mh=3siCYaJh5fh{qFjzuG!z3gSC5HqVL>YxZZPh@XUTaXW5F@@P;sbK1wk|nVG^oPTLttwv<`Tm)%*5IwD-RI$NRqb_5O9gyT5%_etTGJ z@3q!GYp;`yiHRWq3*HvKu>o|A+MmYQVLtzCSFBiqc42)R0Qeg$9pi@I9?V9R^N)gZ zVqhx?KW@7q3!V8#`2uH<;{=Dp#5h9dN|0bUFAiZEQ$k3QVmh2>QYnF`Q9Txs%sy2rX)HuGFjeG`EZ$5p z5`-cdZ>Chz&%Re0BIgm@3L`>#TrvwH1DUBCyiIB|v`FBI)Lfp)veaOY6m}sggjp6B z>Yd!KriNT=tSOer)BAHp=sr6*MB5fq5DWnEa3w>A%{bhE1+D<#rx-bR7>XrqMI75k zKLvV{2tdaUD{h`u?*NrQ=yYRnO-NBf_}dyanifT4#ap9NISdm@Cz+U0&_W`ZhZ_MJ zG}}SOWg_mKc?beK`n}5P+xs6|?tBXSe@x`y51hF`{oys&9ME)($~bn7_qkwyb)~{>RIP?Y!@+4f6Dp z^`snSgQ#)(cCrEKoBu=%=7IXgkXL8zysDZT-yc)F{IGahHCMj>t|rlJpXmvR9$!Eg zM|lmJ!{b5EAR+F>8vkdUL`-^d)oR z=Ck}IYp%i?vc^Bv7p(=p+*V)yGhYGAPt@vnYlshP)G&XdO%!=5A!;-#YBV8g1cJ1` z*V6{op(Zi8Ud9x-5vWZ8B6H~?OSJ5FYSQ3>oSjzwJE=W+_B}05H-2;KBe{jFato2T zZIbwHO5=~Fibhe&--LpwO=&1aD+{H%e^_ymUc~?aX54drepl@=mGpW5DClWo$nK!s z3VUvmI$U`-yviZDN+WBU#pmDzUOATv-F@|D)RK4|pyB!8@r}VaqN(YO{7^{}F@Yo*u=cqo_zM#uFtghIg6Kw#r)2ETiq3KN;oSTY zpP7PKA~eGaytLm899oJ|)Sy*w4j}zyuXMRgdN1411hl<&71?%E*-PHG|J09S8dJ{1 zmNVXlcj-2nl%bR+Dc=gM$X+s4vV^8|_*09#Wk%OxV9S%qwt3rUy%eJuyL5KZ|n z(d%Ea-~Y(?cea2O04Xqm&-}{%Tx$%c6i9#A=`zRnlT zGX7NIKxtAO;7I2sRP^T-0*)1sdhKMHyXVwk{0CXl;&PKGYorWpkYz<3fRj1t=wx#x z=?KoswuJ<;u)x_}mLOI#6!!e5EP*{&d2er3fNo9S)1Zar(|c>?39S5d84OvK_!5gB zB1#w6)j<`psEUhO%WO;-`p`rI(L1QUzpW8GTO(lcMG4`k6o#y(wyvpH!MXuMq7`J0 zIu7IRbaoX(SyOj*CE7i}5{X1ni^`YF;7Hy5vrY5+7W%=MD1tXYCb}p(v&jhuh3bT& z(ZU3pUgnD47BiH0I4vr?2;CAoX<{`;1bY&0p29#$Fm9eQ4@OzSPi>bzfbEG>+i^Rh zU~9q#I${duG|~97cwudD|4B;fM-N6 zRPbtPDh0x%s0)xl=Am4kSRGG9n6(91&|yJ^k5dK=_*k$PfD9LcOINXkL|3ENVsL%Uz~RB^!7>Xq&N7UT8rh0P^viQ(gL-0tU-V(UE!6Vl9bj^TJ1RZCvJ{&NZzP$;00~+dq zA^~+Mv}LBjwks~9ZiTmQ%mg%JlT&Z=_F=uHr_MG(Gn>bcra=oD0qJsg0IbKFJuYzv z!lL1&f{~g5aEW}#%A3H1Sq*`%D)5Ha^go|Q5G_}eQ?`?VBRcrwLVEh zxO#u1i5%2K%Qit#z%n(or9Qb^R#@;3sTI()a1`2C0S|^AK`Zc>nFtRK8K7s)4?9={4sG5i;#KF{^SVAY6 z)<>s%QCRNRaZ-~kLN=hecn#dYWHb{C7R_9WvLJX7@m@q5a}I_y)iLkWCmA2@Ik?z8 zJ*P@#0RtgCHCV6~iZ-P!sVb>&KGV_NKQ=Y<$2_u)cG%IUc)1^Dur9N?o zsxSYHvxgioq``tGN~Kag;y@~u>c0^29{&0+fPNvujRPL5DSd&ZJDW-2e0;0-*56i* zw{xzHwOl?wrr7131*VDwfa0h;^ZNAh1wtb!hI8k|Wcj*aYXHLqd@1MjbWIQrMY)7vIA3qRV89sfFX;zR!7?)a(Qa&6Lg z8_zqX?9(N`Quh!`%zn=qpgeq@eLUgDfp}wez;oF{>HCx?;{gXBngF~?QCGM5)b@Os z0yMZz?Rw~)JU744p@PgREiup6Ay2dZtk~|WmNS-x;??UUcklc@-Z*P1cs4U~ zV)c=b5>GebkKb;I6m2;wH~0KibM_gvlwSua^ynB)jl%1&*_Wjo zj&B`Ls#&r8c7m{S?}dF%k{sRaZ-I+%q~5)9PVUJ1Zqu;@Z8dn4&cik{TYkp@*ILA? zRwhz$$6GO39&&h_aGZrOc1C#nm6hCY0JLGZgF(3}COa_SH*b>EyxqIfu|i|hhNtz` z83`5%grgRD!8Fp5Onke;)xyF0`t%^}gW{Z&8QF{IryGmL%i5mHEPoZ%ZW$;a4&^NP zE0@}{)nBQ(I22PILI^l;YQDp}AFm9^TH z55KN99(wRT@9NzbTiz(n)s;3K-S=O`veqcO*9CVs*Rx-pcc{sF`O&PWY4PKPf*qE|n3cBH zE$I~p&8*i>m`|+Ru4=j2@A7f&mdP(OSSN2azt*jH{M!7zllk|bKlJZ@a^WsvOt{G| zOU<+iTw0_;>gujtm*14i_CyRVjI$J~G!01G66-=ya$P|}l^onVt;F7sG72;Z+VBv)cyO*Z?<`MF>0;ud%Sk9STL0H ztX%1G1q1$pU#lXjhJ6Za+k9Ct^OGm%&ly6WmN+;r-%4^CF?o;=z2p#F+H?$_(r z^X964VePDW>2|>NXjki8`8Vlvvv(Q4K3Y1r$AsF~y)PtG!TS+eKl@C(4w29Ca_pb& z#2s@ATf66VO5bN1EWk;Bc(8Ty&GX6fNf^Fi^p}s7s1LrBJ76baz zDk7yuJC0a*6jeX|F|D667Fo8+hPUqQ4`kiI*0CQ4M-$J+Y%7UMz0f!9?D;rz^7gSs zyFb;PyD;!7<(O`F<;IHx3*2Y57GNwXe@jnWhX)6E# literal 0 HcmV?d00001 diff --git a/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx similarity index 92% rename from tgui/packages/tgui/interfaces/Records/RecordTabs.tsx rename to tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx index 3d0b1f95852c..62c90660390f 100644 --- a/tgui/packages/tgui/interfaces/Records/RecordTabs.tsx +++ b/tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx @@ -34,11 +34,11 @@ export const MedicalRecordTabs = (props, context) => { diff --git a/tgui/packages/tgui/interfaces/Records/RecordView.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/RecordView.tsx similarity index 100% rename from tgui/packages/tgui/interfaces/Records/RecordView.tsx rename to tgui/packages/tgui/interfaces/MedicalRecords/RecordView.tsx diff --git a/tgui/packages/tgui/interfaces/Records/constants.ts b/tgui/packages/tgui/interfaces/MedicalRecords/constants.ts similarity index 100% rename from tgui/packages/tgui/interfaces/Records/constants.ts rename to tgui/packages/tgui/interfaces/MedicalRecords/constants.ts diff --git a/tgui/packages/tgui/interfaces/Records/helpers.ts b/tgui/packages/tgui/interfaces/MedicalRecords/helpers.ts similarity index 100% rename from tgui/packages/tgui/interfaces/Records/helpers.ts rename to tgui/packages/tgui/interfaces/MedicalRecords/helpers.ts diff --git a/tgui/packages/tgui/interfaces/Records/index.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx similarity index 97% rename from tgui/packages/tgui/interfaces/Records/index.tsx rename to tgui/packages/tgui/interfaces/MedicalRecords/index.tsx index 84690be26c78..2e017bdee301 100644 --- a/tgui/packages/tgui/interfaces/Records/index.tsx +++ b/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx @@ -7,7 +7,7 @@ import { MedicalRecordData } from './types'; import { MedicalRecordTabs } from './RecordTabs'; import { MedicalRecordView } from './RecordView'; -export const Records = (props, context) => { +export const MedicalRecords = (props, context) => { const { data } = useBackend(context); const { authenticated } = data; diff --git a/tgui/packages/tgui/interfaces/Records/types.ts b/tgui/packages/tgui/interfaces/MedicalRecords/types.ts similarity index 100% rename from tgui/packages/tgui/interfaces/Records/types.ts rename to tgui/packages/tgui/interfaces/MedicalRecords/types.ts diff --git a/tgui/packages/tgui/interfaces/SecurityRecords/CrimeWatcher.tsx b/tgui/packages/tgui/interfaces/SecurityRecords/CrimeWatcher.tsx new file mode 100644 index 000000000000..f5f0c7323b47 --- /dev/null +++ b/tgui/packages/tgui/interfaces/SecurityRecords/CrimeWatcher.tsx @@ -0,0 +1,284 @@ +import { useBackend, useLocalState } from 'tgui/backend'; +import { + BlockQuote, + Box, + Button, + Collapsible, + Icon, + Input, + LabeledList, + NoticeBox, + RestrictedInput, + Section, + Stack, + Tabs, + TextArea, + Tooltip, +} from 'tgui/components'; + +import { getSecurityRecord } from './helpers'; +import { Crime, SECURETAB, SecurityRecordsData } from './types'; + +/** Displays a list of crimes and allows to add new ones. */ +export const CrimeWatcher = (props, context) => { + const foundRecord = getSecurityRecord(); + if (!foundRecord) return <> ; + + const { crimes, citations } = foundRecord; + const [selectedTab, setSelectedTab] = useLocalState( + context, + 'selectedTab', + SECURETAB.Crimes + ); + + return ( + + + + setSelectedTab(SECURETAB.Crimes)} + selected={selectedTab === SECURETAB.Crimes} + > + Crimes: {crimes.length} + + setSelectedTab(SECURETAB.Citations)} + selected={selectedTab === SECURETAB.Citations} + > + Citations: {citations.length} + + + setSelectedTab(SECURETAB.Add)} + selected={selectedTab === SECURETAB.Add} + > + + + + + + +
    + {selectedTab < SECURETAB.Add ? ( + + ) : ( + + )} +
    +
    +
    + ); +}; + +/** Displays the crimes and citations of a record. */ +const CrimeList = (props) => { + const foundRecord = getSecurityRecord(); + if (!foundRecord) return <> ; + + const { citations, crimes } = foundRecord; + const { tab } = props; + const toDisplay = tab === SECURETAB.Crimes ? crimes : citations; + + return ( + + {!toDisplay.length ? ( + + + No {tab === SECURETAB.Crimes ? 'crimes' : 'citations'} found. + + + ) : ( + toDisplay.map((item, index) => ) + )} + + ); +}; + +/** Displays an individual crime */ +const CrimeDisplay = (props, context, { item }: { item: Crime }) => { + const foundRecord = getSecurityRecord(props, context); + if (!foundRecord) return <> ; + + const { crew_ref } = foundRecord; + const { act, data } = useBackend(context); + const { current_user, higher_access } = data; + const { author, crime_ref, details, fine, name, paid, time, valid } = item; + const showFine = !!fine && fine > 0 ? `: ${fine} cr` : ''; + + let collapsibleColor = ''; + if (!valid) { + collapsibleColor = 'grey'; + } else if (fine && fine > 0) { + collapsibleColor = 'average'; + } + + let displayTitle = name; + if (fine && fine > 0) { + displayTitle = name.slice(0, 18) + showFine; + } + + const [editing, setEditing] = useLocalState(`editing_${crime_ref}`, false); + + return ( + + + + {time} + {author} + + {!valid ? 'Void' : 'Active'} + + {fine && ( + <> + + {fine}cr + + + {paid}cr + + + )} + + + Details: + +
    {details}
    + + {!editing ? ( + + + + act('invalidate_crime', { + crew_ref: crew_ref, + crime_ref: crime_ref, + }) + } + /> + + ) : ( + <> + setEditing(false)} + onEnter={(event, value) => { + setEditing(false); + act('edit_crime', { + crew_ref: crew_ref, + crime_ref: crime_ref, + name: value, + }); + }} + placeholder="Enter a new name" + /> + setEditing(false)} + onEnter={(event, value) => { + setEditing(false); + act('edit_crime', { + crew_ref: crew_ref, + crime_ref: crime_ref, + description: value, + }); + }} + placeholder="Enter a new description" + /> + + )} +
    +
    + ); +}; + +/** Writes a new crime. Reducers don't seem to work here, so... */ +const CrimeAuthor = (props) => { + const foundRecord = getSecurityRecord(); + if (!foundRecord) return <> ; + + const { crew_ref } = foundRecord; + const { act } = useBackend(); + + const [crimeName, setCrimeName] = useState(''); + const [crimeDetails, setCrimeDetails] = useState(''); + const [crimeFine, setCrimeFine] = useState(0); + const [selectedTab, setSelectedTab] = useLocalState( + 'selectedTab', + SECURETAB.Crimes + ); + + const nameMeetsReqs = crimeName?.length > 2; + + /** Sends form to backend */ + const createCrime = () => { + if (!crimeName) return; + act('add_crime', { + crew_ref: crew_ref, + details: crimeDetails, + fine: crimeFine, + name: crimeName, + }); + reset(); + }; + + /** Resets form data since it persists.. */ + const reset = () => { + setCrimeDetails(''); + setCrimeFine(0); + setCrimeName(''); + setSelectedTab(crimeFine ? SECURETAB.Citations : SECURETAB.Crimes); + }; + + return ( + + + Name + setCrimeName(value)} + placeholder="Brief overview" + /> + + + Details +