From 38a03fa0f8992550a67f1f43f925bffae8b13b19 Mon Sep 17 00:00:00 2001 From: Geeves Date: Thu, 2 Jan 2020 11:49:26 +0200 Subject: [PATCH] Added Synthetics to the Manifest (#7750) Stationbounds have been added to the Crew Manifest in a Sub-manifest catagory. They are not crew. --- code/_helpers/text.dm | 8 ++++++++ code/controllers/subsystems/records.dm | 19 +++++++++++++++++-- code/modules/mob/living/silicon/ai/ai.dm | 1 + .../modules/mob/living/silicon/robot/robot.dm | 2 ++ html/changelogs/geeves - manifesto.yml | 6 ++++++ 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/geeves - manifesto.yml diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 9897106b80a..da8ea395628 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -542,3 +542,11 @@ proc/TextPreview(var/string,var/len=40) for (var/replacement in replacements) . = replacetext(., replacement, replacements[replacement]) + +// Finds the first letter of each word in the provided string and capitalize them +/proc/capitalize_first_letters(var/string) + var/list/text = splittext(string, " ") + var/list/finalized_text = list() + for(var/word in text) + finalized_text += capitalize(word) + return jointext(finalized_text, " ") \ No newline at end of file diff --git a/code/controllers/subsystems/records.dm b/code/controllers/subsystems/records.dm index 8b19f10ac12..0928a2684eb 100644 --- a/code/controllers/subsystems/records.dm +++ b/code/controllers/subsystems/records.dm @@ -203,7 +203,7 @@ else isactive[M.real_name] = 0 - var/nameMap = list("heads" = "Heads", "sec" = "Security", "eng" = "Engineering", "med" = "Medical", "sci" = "Science", "car" = "Cargo", "civ" = "Civilian", "bot" = "Silicon", "misc" = "Miscellaneous") + var/nameMap = list("heads" = "Heads", "sec" = "Security", "eng" = "Engineering", "med" = "Medical", "sci" = "Science", "car" = "Cargo", "civ" = "Civilian", "misc" = "Miscellaneous", "bot" = "Equipment") for(var/dep in manifest) var/list/depI = manifest[dep] if(depI.len > 0) @@ -262,6 +262,21 @@ if(!department && !(name in manifest["heads"])) manifest["misc"][++manifest["misc"].len] = list("name" = name, "rank" = rank, "active" = isactive) + for(var/mob/living/silicon/S in player_list) + if(istype(S, /mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = S + if(R.scrambledcodes) + continue + var/selected_module = "Default Module" + if(R.module) + selected_module = capitalize_first_letters(R.module.name) + manifest["bot"][++manifest["bot"].len] = list("name" = sanitize(R.name), "rank" = selected_module, "active" = "Online") + if(istype(S, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/A = S + manifest["bot"][++manifest["bot"].len] = list("name" = sanitize(A.name), "rank" = "Station Intelligence", "active" = "Online") + if(manifest["bot"].len != 1) + manifest["bot"].Swap(1, manifest["bot"].len) + manifest_json = json_encode(manifest) return manifest_json @@ -334,4 +349,4 @@ //if(istype(value)) // .[field] = compute_localized_field(value) // continue - .[field] = value \ No newline at end of file + .[field] = value diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index ae310e9b9df..69109d9b350 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -265,6 +265,7 @@ var/list/ai_verbs_default = list( idcard.update_name() setup_icon() //this is because the ai custom name is related to the ai name, so, we just call the setup icon after someone named their ai + SSrecords.reset_manifest() /* The AI Power supply is a dummy object used for powering the AI since only machinery should be using power. diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index ac504b57122..3b65c5edf27 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -313,6 +313,7 @@ updatename() recalculate_synth_capacities() notify_ai(ROBOT_NOTIFICATION_NEW_MODULE, module.name) + SSrecords.reset_manifest() selecting_module = 0 /mob/living/silicon/robot/proc/updatename(var/prefix as text) @@ -374,6 +375,7 @@ updatename() updateicon() + SSrecords.reset_manifest() // this verb lets cyborgs see the stations manifest /mob/living/silicon/robot/verb/cmd_station_manifest() diff --git a/html/changelogs/geeves - manifesto.yml b/html/changelogs/geeves - manifesto.yml new file mode 100644 index 00000000000..fe7327b8350 --- /dev/null +++ b/html/changelogs/geeves - manifesto.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Stationbounds have been added to the Crew Manifest in a Station Equipment catagory. They are not crew. It will also not appear on PDA's (yet)."