Skip to content

Commit

Permalink
yea
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed May 28, 2024
1 parent f4a9cea commit 0b6dd1a
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 37 deletions.
17 changes: 8 additions & 9 deletions code/__DEFINES/datacore.dm
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
17 changes: 12 additions & 5 deletions code/controllers/subsystem/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -181,24 +187,25 @@ 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
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_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)
Expand Down
35 changes: 35 additions & 0 deletions code/game/machinery/computer/record/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
18 changes: 0 additions & 18 deletions code/game/machinery/computer/record/records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const MedicalRecordTabs = (props, context) => {
</Stack.Item>
<Stack.Item>
<Button.Confirm
disabled
content="Purge"
icon="trash"
onClick={() => act('purge_records')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export const MedicalRecordView = (props, context) => {
return (
<Button
color={isSelected ? PHYSICALSTATUS2COLOR[button] : 'grey'}

icon={PHYSICALSTATUS2ICON[button]}
key={index}
onClick={() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const SecurityRecordTabs = (props, context) => {
</Stack.Item>
<Stack.Item>
<Button.Confirm
disabled
content="Purge"
icon="trash"
onClick={() => act('purge_records')}
Expand Down
5 changes: 1 addition & 4 deletions tgui/packages/tgui/interfaces/SecurityRecords/RecordView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ const RecordInfo = (props, context) => {
{name}
</Table.Cell>
}
></Section>
</Stack.Item>
<Stack.Item grow={2}>
<Section fill scrollable>
>
<LabeledList>
<LabeledList.Item label="Name">
<EditableText field="name" target_ref={record_ref} text={name} />
Expand Down

0 comments on commit 0b6dd1a

Please sign in to comment.