Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of record system code and migrate all record UI to TGUI #6266

Closed
wants to merge 119 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
838fc31
new ui for medcomputer
May 9, 2024
925eb0e
e
May 9, 2024
ec55e30
p
May 9, 2024
508a7a4
m
May 9, 2024
57d8a87
okay
May 9, 2024
b8982ec
g
May 9, 2024
2a0d571
b
May 9, 2024
dbf74ed
y
May 9, 2024
c694cb3
l
May 9, 2024
241b4e6
more intuitive squad modifier
May 10, 2024
e107dcc
o
May 10, 2024
6c1cc46
c
May 10, 2024
9277e4d
I mean...
May 10, 2024
7f2f7ee
t
May 10, 2024
8682007
nvm, it makes more sense to have them separate
May 10, 2024
f023db7
unshit the copy pasta code.
May 10, 2024
795b67d
more
May 10, 2024
4c718af
m
May 10, 2024
6d0a9d1
j
May 10, 2024
0aa3dbd
a
May 10, 2024
dd40c9f
again, fixing copy pasta issues.
May 10, 2024
bb66808
piss
May 10, 2024
5a19207
t
May 10, 2024
388f456
beno
May 10, 2024
4d50ea1
n
May 10, 2024
7c25a65
update icon
May 11, 2024
b23ca83
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 May 11, 2024
08efde8
Notes, The.
May 11, 2024
827cbc3
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
May 11, 2024
821327c
fix the copy pasta
May 11, 2024
0172d5e
fix
May 11, 2024
44c1b78
comments
May 11, 2024
79b9bb7
already one
May 11, 2024
a4eab3c
comments
May 11, 2024
295ff7a
progress, partial datacore overhaul.
May 12, 2024
65155a0
changes
May 12, 2024
b8773aa
progress.
May 13, 2024
8f71b5d
progress
May 13, 2024
6fb02b9
progress, needs testing.
May 14, 2024
a610a62
r
May 14, 2024
9ba0c02
r
May 14, 2024
e3bf0dd
e
May 14, 2024
d6bd20f
l
May 14, 2024
f95dacf
whoop
May 14, 2024
84a7b63
mk
May 14, 2024
42a9dfe
suggested change
May 14, 2024
35f5722
l
May 14, 2024
27457dc
f
May 14, 2024
73ad0f4
more more
May 14, 2024
9ddcdd1
Update code/game/machinery/computer/security.dm
vero5123 May 18, 2024
318d107
?
May 18, 2024
bd2e8c2
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
May 18, 2024
a932814
yeah yeah
May 18, 2024
229301f
tgui
May 18, 2024
c85ea48
as anything
May 18, 2024
50625d8
we don't need to typecheck if something is just a var
May 19, 2024
451d482
redundant
May 19, 2024
cb20f10
again not necessary
May 19, 2024
0587bd5
man.
vero5123 May 19, 2024
5b26946
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 May 24, 2024
69db211
lin
May 24, 2024
6d234fe
ye
May 24, 2024
33bc75a
whoop
May 24, 2024
431e61e
prettier --write go fuck yourself
May 24, 2024
53cf524
ripped out the skills laptop for now, migrate it later.
May 24, 2024
ab1b68b
fix
May 24, 2024
334a174
f
May 24, 2024
759cb6a
yep
May 24, 2024
1a3a29b
updating sec records should reflect criminal status icons
May 24, 2024
4801d71
runtime
May 24, 2024
0b47e4a
Apply suggestions from code review
vero5123 May 24, 2024
0ad80ea
Update code/modules/cm_marines/marines_consoles.dm
vero5123 May 24, 2024
366cdfc
Update code/game/machinery/computer/medical.dm
vero5123 May 24, 2024
f8cc221
Update code/game/machinery/computer/medical.dm
vero5123 May 24, 2024
79806b0
Apply suggestions from code review
vero5123 May 24, 2024
ff4c75d
runtime
May 24, 2024
6aeb7d0
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
May 24, 2024
15f3a93
Update code/game/machinery/computer/security.dm
vero5123 May 24, 2024
e477a28
Update code/modules/cm_marines/marines_consoles.dm
vero5123 May 24, 2024
74a2ee9
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 May 30, 2024
032b893
added a cool terminal
May 31, 2024
1f8f953
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
May 31, 2024
b1e6139
t
May 31, 2024
4b69c9c
suggested changes
May 31, 2024
07b7a3f
e
May 31, 2024
69b47ba
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 May 31, 2024
3621eb9
tsx migration
Jun 3, 2024
fffcc9d
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
Jun 3, 2024
30809ac
m
Jun 3, 2024
2b1b8fc
bug fix, bahhh
Jun 3, 2024
be54d08
f
Jun 3, 2024
9bd6a65
more fixes
Jun 3, 2024
22bf461
f
Jun 4, 2024
095ad42
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 Jun 4, 2024
c63f21b
Update marines_consoles.dm
vero5123 Jun 4, 2024
f6c06e3
real
Jun 4, 2024
a2ff91e
f
Jun 4, 2024
826f326
removed the comment
Jun 4, 2024
d266f9f
fixed spacing
Jun 4, 2024
c096531
terminal should be a different pr
Jun 5, 2024
b01301f
f
Jun 5, 2024
54f7bd8
del
Jun 5, 2024
5ceab6f
more
Jun 5, 2024
282df9e
f
Jun 5, 2024
08291e7
y
Jun 5, 2024
c210002
y
Jun 5, 2024
83e1713
whoops
Jun 5, 2024
b4b5d81
should be fine yeah?
Jun 5, 2024
c661de7
teehee
Jun 5, 2024
0bbc160
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 Jun 6, 2024
17c04ee
virgin, lmao.
Jun 11, 2024
683e24d
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
Jun 11, 2024
653dbed
suggestions
Jun 11, 2024
05c1253
suggested changes
Jun 11, 2024
b7b066d
singe letter var, removed legacy
Jun 11, 2024
e3a9a64
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 Jun 15, 2024
bf2f480
card
Jun 15, 2024
4d4f0ff
Merge branch 'DOGSHIT-LAPTOP' of github.com:vero5123/cmss13 into DOGS…
Jun 15, 2024
f25855f
Merge branch 'master' into DOGSHIT-LAPTOP
vero5123 Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions code/__DEFINES/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,92 @@
#define RELIGION_AGNOSTICISM "Agnostic"

#define MAXIMUM_DROPPED_OBJECTS_REMEMBERED 2

// DEFINES FOR RECORD SYSTEM STAT TYPES, arguably pointless to create defines for these, could of just renamed the string but eh, who cares.
// --------------------------------------------------------------------------------------------------------------- //

// general records
#define MOB_NAME "name"
#define RECORD_UNIQUE_ID "id"
#define MOB_SHOWN_RANK "rank"
#define MOB_REAL_RANK "real_rank"
#define MOB_SEX "sex"
#define MOB_AGE "age"
#define MOB_ETHNICITY "ethnicity"
#define MOB_HEALTH_STATUS "p_stat"
#define MOB_MENTAL_STATUS "m_stat"
#define MOB_SPECIES "species"
#define MOB_ORIGIN "origin"
#define MOB_SHOWN_FACTION "faction"
#define MOB_REAL_FACTION "mob_faction"
#define MOB_RELIGION "religion"
#define MOB_SQUAD "squad"
#define MOB_GENERAL_NOTES "g_notes"
#define MOB_EXPLOIT_RECORD "mob_exploit_record"
#define MOB_WEAKREF "ref"

#define GENERAL_RECORD_LIST list(MOB_NAME, RECORD_UNIQUE_ID, MOB_SHOWN_RANK, MOB_REAL_RANK, MOB_SEX, MOB_AGE, MOB_ETHNICITY, MOB_HEALTH_STATUS, MOB_MENTAL_STATUS, MOB_SPECIES, MOB_ORIGIN, MOB_SHOWN_FACTION, MOB_REAL_FACTION, MOB_RELIGION, MOB_SQUAD, MOB_GENERAL_NOTES, MOB_EXPLOIT_RECORD, MOB_WEAKREF)

// security record stat types
#define MOB_INCIDENTS "incidents"
#define MOB_CRIMINAL_STATUS "criminal"
#define MOB_SECURITY_COMMENT_LOG "comments"
#define MOB_SECURITY_NOTES "s_notes"

#define SECURITY_RECORD_LIST list(MOB_INCIDENTS, MOB_CRIMINAL_STATUS, MOB_SECURITY_COMMENT_LOG, MOB_SECURITY_NOTES)

// medical record stat types
#define MOB_BLOOD_TYPE "b_type"
#define MOB_DISABILITIES "mi_dis"
#define MOB_AUTOPSY_NOTES "a_stat"
#define MOB_MEDICAL_NOTES "m_notes"
#define MOB_DISEASES "cdi"
#define MOB_CAUSE_OF_DEATH "d_stat"
#define MOB_AUTOPSY_SUBMISSION "aut_sub"
#define MOB_LAST_SCAN_TIME "last_scan_time"
#define MOB_LAST_SCAN_RESULT "last_scan_result"
#define MOB_AUTODOC_DATA "autodoc_data"
#define MOB_AUTODOC_MANUAL "autodoc_manual"

#define MEDICAL_RECORD_LIST list(MOB_BLOOD, MOB_DISABILITIES, MOB_AUTOPSY_NOTES, MOB_MEDICAL_NOTES, MOB_DISEASES, MOB_CAUSE_OF_DEATH, MOB_AUTOPSY_SUBMISSION, MOB_LAST_SCAN_TIME, MOB_LAST_SCAN_RESULT, MOB_AUTODOC_DATA, MOB_AUTODOC_MANUAL)

// --------------------------------------------------------------------------------------------------------------- //

// The actual stat that is set, for now we reduce the useless bullshit no one cares about and keep it minimal.
// --------------------------------------------------------------------------------------------------------------- //

// gender/sex stats
#define MOB_STAT_SEX_MALE "Male"
#define MOB_STAT_SEX_FEMALE "Female"

#define MOB_STAT_GENDER_LIST list(MOB_STAT_SEX_MALE, MOB_STAT_SEX_FEMALE)

// health stats
#define MOB_STAT_HEALTH_DECEASED "Deceased"
#define MOB_STAT_HEALTH_ACTIVE "Active"
#define MOB_STAT_HEALTH_UNFIT "Unfit"

#define MOB_STAT_HEALTH_LIST list(MOB_STAT_SEX_MALE, MOB_STAT_SEX_FEMALE)

// Mental stats
#define MOB_STAT_MENTAL_STATUS_STABLE "Stable"
#define MOB_STAT_MENTAL_STATUS_ON_WATCH "Watch" // i.e. potentailly unstable
#define MOB_STAT_MENTAL_STATUS_UNSTABLE "Insane"

#define MOB_STAT_MENTAL_STATUS_LIST list(MOB_STAT_MENTAL_STATUS_STABLE, MOB_STAT_MENTAL_STATUS_ON_WATCH, MOB_STAT_MENTAL_STATUS_UNSTABLE)

// crime stats
#define MOB_STAT_CRIME_NONE "None"
#define MOB_STAT_CRIME_ARREST "Arrest"
#define MOB_STAT_CRIME_INCARCERATED "Incarcerated"

#define MOB_STAT_CRIME_STATUS_LIST list(MOB_STAT_CRIME_NONE, MOB_STAT_CRIME_ARREST, MOB_STAT_CRIME_INCARCERATED)
// ------------------------------------------------------------------------------------------------------------------ //

// types of records
#define RECORD_TYPE_GENERAL "general"
#define RECORD_TYPE_SECURITY "security"
#define RECORD_TYPE_MEDICAL "medical"
#define RECORD_TYPE_STATIC "locked" // immutable records, keeping it for now I guess.

#define RECORD_TYPE_LIST list(RECORD_TYPE_GENERAL, RECORD_TYPE_SECURITY, RECORD_TYPE_MEDICAL, RECORD_TYPE_STATIC )
10 changes: 3 additions & 7 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,9 @@

if(oldname)
//update the datacore records! This is goig to be a bit costly.
var/mob_ref = WEAKREF(src)
for(var/list/L in list(GLOB.data_core.general, GLOB.data_core.medical, GLOB.data_core.security, GLOB.data_core.locked))
for(var/datum/data/record/record_entry in L)
if(record_entry.fields["ref"] == mob_ref)
record_entry.fields["name"] = newname
record_entry.name = newname
break
for(var/record_type in RECORD_TYPE_LIST)
insert_record_stat(mob_name = oldname, record_type = record_type, stat_type = MOB_WEAKREF, new_stat = WEAKREF(src))
insert_record_stat(mob_name = oldname, record_type = record_type, stat_type = MOB_NAME, new_stat = newname)

//update our pda and id if we have them on our person
var/list/searching = GetAllContents(searchDepth = 3)
Expand Down
185 changes: 45 additions & 140 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
)
departments += marines_by_squad
var/list/manifest_out = list()
for(var/datum/data/record/record_entry in GLOB.data_core.general)
if(record_entry.fields["mob_faction"] != FACTION_MARINE) //we process only USCM humans
for(var/record in GLOB.data_core.general)
var/datum/data/record/record_entry = GLOB.data_core.general[record] // I regret using associated lists for this.
if(record_entry.fields[MOB_REAL_FACTION] != FACTION_MARINE) //we process only USCM humans
continue
var/name = record_entry.fields["name"]
var/rank = record_entry.fields["rank"]
var/squad = record_entry.fields["squad"]
var/name = record_entry.fields[MOB_NAME]
var/rank = record_entry.fields[MOB_REAL_RANK]
var/squad = record_entry.fields[MOB_SQUAD]
if(isnull(name) || isnull(rank))
continue
var/has_department = FALSE
Expand All @@ -51,17 +52,17 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
if(!manifest_out[department])
manifest_out[department] = list()
manifest_out[department] += list(list(
"name" = name,
"rank" = rank
MOB_NAME = name,
MOB_SHOWN_RANK = rank
))
has_department = TRUE
break
if(!has_department)
if(!manifest_out["Miscellaneous"])
manifest_out["Miscellaneous"] = list()
manifest_out["Miscellaneous"] += list(list(
"name" = name,
"rank" = rank
MOB_NAME = name,
MOB_SHOWN_RANK = rank
))
return manifest_out

Expand All @@ -85,14 +86,15 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
var/dept_flags = NO_FLAGS //Is there anybody in the department?.
var/list/squad_sublists = GLOB.ROLES_SQUAD_ALL.Copy() //Are there any marines in the squad?

for(var/datum/data/record/record_entry in GLOB.data_core.general)
if(record_entry.fields["mob_faction"] != FACTION_MARINE) //we process only USCM humans
for(var/entry in GLOB.data_core.general)
var/datum/data/record/record_entry = GLOB.data_core.general[entry]
if(record_entry.fields[MOB_REAL_FACTION] != FACTION_MARINE) //we process only USCM humans
continue

var/name = record_entry.fields["name"]
var/rank = record_entry.fields["rank"]
var/real_rank = record_entry.fields["real_rank"]
var/squad_name = record_entry.fields["squad"]
var/name = record_entry.fields[MOB_NAME]
var/rank = record_entry.fields[MOB_SHOWN_RANK]
var/real_rank = record_entry.fields[MOB_REAL_RANK]
var/squad_name = record_entry.fields[MOB_SQUAD]
if(isnull(name) || isnull(rank) || isnull(real_rank))
continue

Expand All @@ -104,7 +106,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
break
isactive[name] = active ? "Active" : "Inactive"
else
isactive[name] = record_entry.fields["p_stat"]
isactive[name] = record_entry.fields[MOB_HEALTH_STATUS]
//cael - to prevent multiple appearances of a player/job combination, add a continue after each line

if(real_rank in GLOB.ROLES_CIC)
Expand Down Expand Up @@ -212,142 +214,45 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
if(H.job in jobs_to_check)
manifest_inject(H)

/datum/datacore/proc/manifest_modify(name, ref, assignment, rank, p_stat)
var/datum/data/record/foundrecord
/datum/datacore/proc/manifest_modify(name, ref, assignment, rank, health_status, record_id_ref = null)
var/datum/data/record/found_record = null
found_record = retrieve_record(mob_ref = ref, mob_name = name, record_type =RECORD_TYPE_GENERAL, record_id_ref = record_id_ref)

var/use_name = isnull(ref)
for(var/datum/data/record/record_entry in GLOB.data_core.general)
if(use_name)
if(record_entry.fields["name"] == name)
foundrecord = record_entry
break
else
if(record_entry.fields["ref"] == ref)
foundrecord = record_entry
break

if(foundrecord)
if(found_record)
if(assignment)
foundrecord.fields["rank"] = assignment
found_record.fields[MOB_SHOWN_RANK] = assignment
if(rank)
foundrecord.fields["real_rank"] = rank
if(p_stat)
foundrecord.fields["p_stat"] = p_stat
if(!use_name)
if(name)
foundrecord.fields["name"] = name
found_record.fields[MOB_SHOWN_RANK] = rank
if(health_status)
found_record.fields[MOB_HEALTH_STATUS] = health_status
if(name)
found_record.fields[MOB_NAME] = name
return TRUE
return FALSE

/datum/datacore/proc/manifest_inject(mob/living/carbon/human/target)
var/assignment
if(target.job)
assignment = target.job
else
assignment = "Unassigned"

var/id = add_zero(num2hex(target.gid), 6) //this was the best they could come up with? A large random number? *sigh*
//var/icon/front = new(get_id_photo(H), dir = SOUTH)
//var/icon/side = new(get_id_photo(H), dir = WEST)

//General Record
var/datum/data/record/record_general = new()
record_general.fields["id"] = id
record_general.fields["name"] = target.real_name
record_general.name = target.real_name
record_general.fields["real_rank"] = target.job
record_general.fields["rank"] = assignment
record_general.fields["squad"] = target.assigned_squad ? target.assigned_squad.name : null
record_general.fields["age"] = target.age
record_general.fields["p_stat"] = "Active"
record_general.fields["m_stat"] = "Stable"
record_general.fields["sex"] = target.gender
record_general.fields["species"] = target.get_species()
record_general.fields["origin"] = target.origin
record_general.fields["faction"] = target.personal_faction
record_general.fields["mob_faction"] = target.faction
record_general.fields["religion"] = target.religion
record_general.fields["ref"] = WEAKREF(target)
//record_general.fields["photo_front"] = front
//record_general.fields["photo_side"] = side

if(target.gen_record && !jobban_isbanned(target, "Records"))
record_general.fields["notes"] = target.gen_record
else
record_general.fields["notes"] = "No notes found."
general += record_general

//Medical Record
var/datum/data/record/record_medical = new()
record_medical.fields["id"] = id
record_medical.fields["name"] = target.real_name
record_medical.name = target.name
record_medical.fields["b_type"] = target.blood_type
record_medical.fields["mi_dis"] = "None"
record_medical.fields["mi_dis_d"] = "No minor disabilities have been declared."
record_medical.fields["ma_dis"] = "None"
record_medical.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
record_medical.fields["alg"] = "None"
record_medical.fields["alg_d"] = "No allergies have been detected in this patient."
record_medical.fields["cdi"] = "None"
record_medical.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
record_medical.fields["last_scan_time"] = null
record_medical.fields["last_scan_result"] = "No scan data on record" // body scanner results
record_medical.fields["autodoc_data"] = list()
record_medical.fields["autodoc_manual"] = list()
record_medical.fields["ref"] = WEAKREF(target)

if(target.med_record && !jobban_isbanned(target, "Records"))
record_medical.fields["notes"] = target.med_record
else
record_medical.fields["notes"] = "No notes found."
medical += record_medical

//Security Record
var/datum/data/record/record_security = new()
record_security.fields["id"] = id
record_security.fields["name"] = target.real_name
record_security.name = target.real_name
record_security.fields["criminal"] = "None"
record_security.fields["incident"] = ""
record_security.fields["ref"] = WEAKREF(target)

if(target.sec_record && !jobban_isbanned(target, "Records"))
var/new_comment = list("entry" = target.sec_record, "created_by" = list("name" = "\[REDACTED\]", "rank" = "Military Police"), "deleted_by" = null, "deleted_at" = null, "created_at" = "Pre-Deployment")
record_security.fields["comments"] = list("1" = new_comment)
record_security.fields["notes"] = target.sec_record
security += record_security


//Locked Record
var/datum/data/record/record_locked = new()
record_locked.fields["id"] = md5("[target.real_name][target.job]")
record_locked.fields["name"] = target.real_name
record_locked.name = target.real_name
record_locked.fields["rank"] = target.job
record_locked.fields["age"] = target.age
record_locked.fields["sex"] = target.gender
record_locked.fields["b_type"] = target.b_type
record_locked.fields["species"] = target.get_species()
record_locked.fields["origin"] = target.origin
record_locked.fields["faction"] = target.personal_faction
record_locked.fields["religion"] = target.religion
record_locked.fields["ref"] = WEAKREF(target)

if(target.exploit_record && !jobban_isbanned(target, "Records"))
record_locked.fields["exploit_record"] = target.exploit_record
else
record_locked.fields["exploit_record"] = "No additional information acquired."
locked += record_locked

if(!(target)) // big problemo.
return

// they already have a record.
if(target.record_id_ref)
return

var/id_ref = null
if(target.ckey)
id_ref = "[target.ckey]" // should be unique right?
else
id_ref = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) // not a player controlled mob.
target.record_id_ref = id_ref
create_general_record(target)
create_medical_record(target)
create_security_record(target)
create_static_character_record(target)

/proc/get_id_photo(mob/living/carbon/human/H)
var/icon/preview_icon = null

//var/g = "m"
//if (H.gender == FEMALE)
// g = "f"

var/icon/icobase = H.species.icobase
var/icon/temp

Expand Down
17 changes: 10 additions & 7 deletions code/datums/medal_awards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME
// Pick a marine
var/list/possible_recipients = list()
var/list/recipient_ranks = list()
for(var/datum/data/record/record in GLOB.data_core.general)
var/recipient_name = record.fields["name"]
recipient_ranks[recipient_name] = record.fields["rank"]
for(var/record_name in GLOB.data_core.general)
var/datum/data/record/record = GLOB.data_core.general[record_name]
var/recipient_name = record.fields[MOB_NAME]
recipient_ranks[recipient_name] = record.fields[MOB_REAL_RANK]
possible_recipients += recipient_name
var/chosen_recipient = tgui_input_list(usr, "Who do you want to award a medal to?", "Medal Recipient", possible_recipients)
if(!chosen_recipient)
Expand Down Expand Up @@ -164,9 +165,10 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME

/proc/give_medal_award_prefilled(medal_location, mob/giving_mob, chosen_recipient, recipient_rank, recipient_ckey, reason, _medal_type)
var/list/recipient_ranks = list()
for(var/datum/data/record/record in GLOB.data_core.general)
var/recipient_name = record.fields["name"]
recipient_ranks[recipient_name] = record.fields["rank"]
for(var/record_name in GLOB.data_core.general)
var/datum/data/record/record = GLOB.data_core.general[record_name]
var/recipient_name = record.fields[MOB_NAME]
recipient_ranks[recipient_name] = record.fields[MOB_SHOWN_RANK]

if(!chosen_recipient)
return FALSE
Expand Down Expand Up @@ -473,7 +475,8 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL,
// Pick a marine
var/list/possible_recipients = list()
var/list/recipient_ranks = list()
for(var/datum/data/record/record in GLOB.data_core.general)
for(var/record_name in GLOB.data_core.general)
var/datum/data/record/record = GLOB.data_core.general[record_name]
var/recipient_name = record.fields["name"]
if(recipient_name == recommendation_giver.real_name)
continue
Expand Down
Loading
Loading