diff --git a/code/__DEFINES/datacore.dm b/code/__DEFINES/datacore.dm index 7d55dda74d29..275cff49d01a 100644 --- a/code/__DEFINES/datacore.dm +++ b/code/__DEFINES/datacore.dm @@ -1,4 +1,6 @@ #define DATACORE_ID "id" +#define DATACORE_RANK "rank" +#define DATACORE_INITIAL_RANK "initial_rank" #define DATACORE_NAME "name" #define DATACORE_AGE "age" #define DATACORE_GENDER "gender" @@ -18,26 +20,23 @@ #define DATACORE_DISABILITIES "ma_dis" #define DATACORE_DISABILITIES_DETAILS "ma_dis_d" +#define DATACORE_CRIMES "crim" +#define DATACORE_CRIMINAL_STATUS "criminal" +//#define DATACORE_CITATIONS "citation" + +#define DATACORE_IMAGE "image" + #define DATACORE_NOTES "notes" //#define DATACORE_NOTES_DETAILS "notes_d" #define DATACORE_NOTES_SECURITY "security_note" #define DATACORE_NOTES_MEDICAL "medical_note" -#define DATACORE_RANK "rank" -#define DATACORE_INITIAL_RANK "initial_rank" -//#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_OUTPOST "outpost" #define DATACORE_RECORDS_SECURITY "security" #define DATACORE_RECORDS_MEDICAL "medical" #define DATACORE_RECORDS_LOCKED "locked" -#define DATACORE_IMAGE "image" /// Physical statuses #define PHYSICAL_ACTIVE "Active" diff --git a/code/controllers/subsystem/datacore.dm b/code/controllers/subsystem/datacore.dm index ca8c56d2d2fd..df5433681256 100644 --- a/code/controllers/subsystem/datacore.dm +++ b/code/controllers/subsystem/datacore.dm @@ -171,6 +171,12 @@ SUBSYSTEM_DEF(datacore) if(!C) C = H.client + var/person_gender = "Other" + if(H.gender == "male") + person_gender = "Male" + if(H.gender == "female") + person_gender = "Female" + var/mutable_appearance/character_appearance = new(H.appearance) //General Record @@ -181,11 +187,12 @@ SUBSYSTEM_DEF(datacore) 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] = PHYSICAL_ACTIVE G.fields[DATACORE_MENTAL_HEALTH] = MENTAL_STABLE - G.fields[DATACORE_GENDER] = H.gender + + G.fields[DATACORE_GENDER] = person_gender G.fields[DATACORE_APPEARANCE] = character_appearance + G.fields[DATACORE_NOTES] = "No notes." G.fields[DATACORE_BLOOD_TYPE] = H.dna.blood_type.name G.fields[DATACORE_BLOOD_DNA] = H.dna.unique_enzymes @@ -193,12 +200,12 @@ SUBSYSTEM_DEF(datacore) 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_NOTES_MEDICAL] = "No medical notes." - G.fields[DATACORE_ID] = id - G.fields[DATACORE_NAME] = H.real_name + G.fields[DATACORE_FINGERPRINT] = md5(H.dna.uni_identity) G.fields[DATACORE_CRIMINAL_STATUS] = "None" G.fields[DATACORE_CRIMES] = list() - G.fields[DATACORE_NOTES] = "No notes." + G.fields[DATACORE_NOTES_SECURITY] = "No security notes." if(istype(custom_library, /datum/data_library)) custom_library.inject_record(G) diff --git a/code/game/machinery/computer/record/medical.dm b/code/game/machinery/computer/record/medical.dm index e4c3895b52d6..1204d1b28787 100644 --- a/code/game/machinery/computer/record/medical.dm +++ b/code/game/machinery/computer/record/medical.dm @@ -50,6 +50,41 @@ data["mental_statuses"] = MENTAL_STATUSES return data +/obj/machinery/computer/records/med/ui_act(action, list/params, datum/tgui/ui) + . = ..() + if(.) + return + + var/mob/user = ui.user + + var/datum/data/record/target + if(params["record_ref"]) + target = locate(params["record_ref"]) in SSdatacore.get_records(linked_ship) + + if(!target) + return FALSE + + switch(action) + 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 + /obj/machinery/computer/records/med/syndie icon_keyboard = "syndie_key" diff --git a/code/game/machinery/computer/record/records.dm b/code/game/machinery/computer/record/records.dm index e41098197681..52cba75865bf 100644 --- a/code/game/machinery/computer/record/records.dm +++ b/code/game/machinery/computer/record/records.dm @@ -100,24 +100,6 @@ 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 /obj/machinery/computer/records/proc/secure_login(mob/user) diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx index d9cc1bae598c..bc12ce470e63 100644 --- a/tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx +++ b/tgui/packages/tgui/interfaces/MedicalRecords/RecordTabs.tsx @@ -40,6 +40,7 @@ export const MedicalRecordTabs = (props, context) => { act('purge_records')} diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/RecordView.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/RecordView.tsx index c909fc62dfe8..8e3133f434c2 100644 --- a/tgui/packages/tgui/interfaces/MedicalRecords/RecordView.tsx +++ b/tgui/packages/tgui/interfaces/MedicalRecords/RecordView.tsx @@ -124,7 +124,6 @@ export const MedicalRecordView = (props, context) => { return (