Refactors crew records (#72725)

## About The Pull Request
I have attempted or otherwise started this project at least 4 times. I
am sick of it being on my calendar. The code needs it. I need it.

- This makes crew records a proper datum rather than assigning
properties record.fields.
- General, medical, and security records are merged.
- Did some slight refactoring here and there for things that looked
obvious.
- Wanted states are now defined (and you can suspect someone through
sechud)
- pAI (unrelated but annoying) had some poorly named exported types that
i made more specific
- Job icons are moved back to the JS side (I wanted to get icons for
initial rank without passing trim)

<details>
<summary>previews</summary>

Editable fields & security console

![CM6d74brnC](https://user-images.githubusercontent.com/42397676/213950290-af6cfd76-eb8b-48e9-b792-925949311d9a.gif)

Medical records

![bFJErsvOaN](https://user-images.githubusercontent.com/42397676/214132534-59af1f8c-9920-4b51-8b27-297103649962.gif)

Look and feel of the more current version

![cxGruQsJpP](https://user-images.githubusercontent.com/42397676/214132611-0134eef0-e74c-4fad-9cde-328ff7c06165.gif)

</details>

## Why It's Good For The Game
TGUI'd some of the worst UIs in the game.
Creating new records is made much simpler. 
Manifest_inject is made readable.
Probably bug fixes

## Changelog

🆑
refactor: Crew records have been refactored.
refactor: Medical records -> TGUI
refactor: Security records -> TGUI
refactor: Warrants console -> TGUI
qol: Players are now alerted when their fines are paid off.
qol: Cleaned up sec hud examination text.
qol: Adding and deleting crimes is easier.
qol: Writing crimes in the console sets players to arrest.
qol: You can now mark someone as a suspect through sec hud.
/🆑

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
Jeremiah
2023-01-24 18:34:27 +00:00
committed by GitHub
co-authored by MrMelbert
parent 9de81146ec
commit 5e80257423
77 changed files with 3204 additions and 2367 deletions
+1 -1
View File
@@ -945,7 +945,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
// Finally, ensure the minds are tracked and in the manifest.
SSticker.minds += character.mind
if(ishuman(character))
GLOB.data_core.manifest_inject(character)
GLOB.manifest.inject(character)
number_made++
CHECK_TICK
+8 -11
View File
@@ -206,19 +206,16 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/mob/living/carbon/human/new_character = new//The mob being spawned.
SSjob.SendToLateJoin(new_character)
var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character.
var/datum/record/locked/record_found //Referenced to later to either randomize or not randomize the character.
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
/*Try and locate a record for the person being respawned through GLOB.data_core.
This isn't an exact science but it does the trick more often than not.*/
var/id = md5("[G_found.real_name][G_found.mind.assigned_role.title]")
record_found = find_record("id", id, GLOB.data_core.locked)
record_found = find_record(G_found.name, locked_only = TRUE)
if(record_found)//If they have a record we can determine a few things.
new_character.real_name = record_found.fields["name"]
new_character.gender = record_found.fields["gender"]
new_character.age = record_found.fields["age"]
new_character.hardset_dna(record_found.fields["identity"], record_found.fields["enzymes"], null, record_found.fields["name"], record_found.fields["blood_type"], new record_found.fields["species"], record_found.fields["features"])
new_character.real_name = record_found.name
new_character.gender = record_found.gender
new_character.age = record_found.age
var/datum/dna/found_dna = record_found.dna_ref
new_character.hardset_dna(found_dna.unique_identity, record_found.dna_string, null, record_found.name, record_found.blood_type, new record_found.species, found_dna.features)
else
new_character.randomize_human_appearance()
new_character.dna.update_dna_identity()
@@ -282,7 +279,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!record_found && (new_character.mind.assigned_role.job_flags & JOB_CREW_MEMBER))
//Power to the user!
if(tgui_alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,list("No","Yes")) == "Yes")
GLOB.data_core.manifest_inject(new_character)
GLOB.manifest.inject(new_character)
if(tgui_alert(new_character,"Would you like an active AI to announce this character?",,list("No","Yes")) == "Yes")
announce_arrival(new_character, new_character.mind.assigned_role.title)
+2 -2
View File
@@ -53,8 +53,8 @@
return
var/data = "<b>Showing Crew Manifest.</b><hr>"
data += "<table cellspacing=5 border=1><tr><th>Name</th><th>Position</th></tr>"
for(var/datum/data/record/entry in GLOB.data_core.general)
data += "<tr><td>[entry.fields["name"]]</td><td>[entry.fields["rank"]][entry.fields["rank"] != entry.fields["trim"] ? " ([entry.fields["trim"]])" : ""]</td></tr>"
for(var/datum/record/crew/entry in GLOB.manifest.general)
data += "<tr><td>[entry.name]</td><td>[entry.rank][entry.rank != entry.trim ? " ([entry.trim])" : ""]</td></tr>"
data += "</table>"
usr << browse(data, "window=manifest;size=440x410")