diff --git a/code/_globalvars/tgui.dm b/code/_globalvars/tgui.dm index aaaab9c5e49..6174a78a4ce 100644 --- a/code/_globalvars/tgui.dm +++ b/code/_globalvars/tgui.dm @@ -1,2 +1,3 @@ GLOBAL_DATUM(crew_manifest_tgui, /datum/crew_manifest) GLOBAL_DATUM(changelog_tgui, /datum/changelog) +GLOBAL_DATUM(record_manifest_tgui, /datum/record_manifest) //SKYRAT EDIT ADDITION -- EXPLOITABLE VERB diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index c79c60b9d9b..3038044d269 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -257,6 +257,16 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) G.fields["gender"] = "Other" G.fields["photo_front"] = photo_front G.fields["photo_side"] = photo_side + // SKYRAT ADDITION START - RP RECORDS + if(C && C.prefs && C.prefs.read_preference(/datum/preference/text/general)) + G.fields["past_records"] = C.prefs.read_preference(/datum/preference/text/general) + else + G.fields["past_records"] = "" + if (C && C.prefs && C.prefs.read_preference(/datum/preference/text/exploitable)) + G.fields["exploitable_records"] = C.prefs.read_preference(/datum/preference/text/exploitable) + else + G.fields["exploitable_records"] = "" + // SKYRAT ADDITION END general += G //Medical Record @@ -273,6 +283,12 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." M.fields["notes"] = H.get_quirk_string(!medical, CAT_QUIRK_NOTES) M.fields["notes_d"] = H.get_quirk_string(medical, CAT_QUIRK_NOTES) + // SKYRAT EDIT ADD - RP RECORDS + if(C && C.prefs && C.prefs.read_preference(/datum/preference/text/medical)) + M.fields["past_records"] = C.prefs.read_preference(/datum/preference/text/medical) + else + M.fields["past_records"] = "" + // SKYRAT EDIT END medical += M //Security Record @@ -283,6 +299,12 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) S.fields["citation"] = list() S.fields["crim"] = list() S.fields["notes"] = "No notes." + // SKYRAT EDIT ADD - RP RECORDS + if(C && C.prefs && C.prefs.read_preference(/datum/preference/text/security)) + S.fields["past_records"] = C.prefs.read_preference(/datum/preference/text/security) + else + S.fields["past_records"] = "" + // SKYRAT EDIT END security += S //Locked Record diff --git a/code/datums/mind.dm b/code/datums/mind.dm index ec6aa9c5a46..0b53f639956 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -93,6 +93,9 @@ var/list/active_addictions ///List of objective-specific equipment that couldn't properly be given to the mind var/list/failed_special_equipment + // SKYRAT EDIT ADDITION -- EXPLOITABLE MENU + ///Tracks if the target has the view_exploitables_verb verb. THIS MUST BE CHANGED IF THE VERB IS ADDED OR REMOVED OR ELSE STUFF BREAKS. + var/has_exploitable_menu = FALSE /datum/mind/New(_key) key = _key @@ -274,6 +277,7 @@ last_death = world.time // Datum antag mind procs + /datum/mind/proc/add_antag_datum(datum_type_or_instance, team) if(!datum_type_or_instance) return @@ -309,6 +313,8 @@ if(my_ambitions.submitted) A.ambitions_add() //SKYRAT EDIT ADDITION END + //SKYRAT EDIT ADDITION - EXPLOITABLES MENU + src.handle_exploitables_menu() return A /datum/mind/proc/remove_antag_datum(datum_type) @@ -321,6 +327,9 @@ if(A.uses_ambitions && my_ambitions.submitted) A.ambitions_removal() //SKYRAT EDIT ADDITION END + //SKYRAT EDIT ADDITION - EXPLOITABLE MENU + src.handle_exploitables_menu() + return TRUE @@ -328,6 +337,11 @@ for(var/a in antag_datums) var/datum/antagonist/A = a A.on_removal() + //SKYRAT EDIT ADDITION BEGIN - EXPLOITABLE MENU + if (has_exploitable_menu) + remove_verb(current, /mob/proc/view_exploitables_verb) + has_exploitable_menu = FALSE + //SKYRAT EDIT ADDITION END /datum/mind/proc/has_antag_datum(datum_type, check_subtypes = TRUE) if(!datum_type) diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index f11cf0c0a71..b5eef7dd685 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -301,7 +301,6 @@ GLOBAL_LIST_EMPTY(antagonists) //ADMIN TOOLS - //Called when using admin tools to give antag status /datum/antagonist/proc/admin_add(datum/mind/new_owner,mob/admin) message_admins("[key_name_admin(admin)] made [key_name_admin(new_owner)] into [name].") @@ -318,8 +317,8 @@ GLOBAL_LIST_EMPTY(antagonists) if(uses_ambitions && owner.my_ambitions.submitted) ambitions_removal() //SKYRAT EDIT ADDITION END - on_removal() - + //SKYRAT EDIT CHANGE -- ORIGINALLY CALLED on_removal() + owner.remove_antag_datum(src) //gamemode/proc/is_mode_antag(antagonist/A) => TRUE/FALSE /** diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index f66c1540a16..89653ec8764 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -424,13 +424,17 @@ . += "\[[health_r]\]" health_r = R.fields["m_stat"] . += "\[[health_r]\]" - R = find_record("name", perpname, GLOB.data_core.medical) - if(R) + var/datum/data/record/M = find_record("name", perpname, GLOB.data_core.medical) //SKYRAT EDIT CHANGE - EXAMINE RECORDS - VAR WAS ORIGINALLY R + if(M) . += "\[Medical evaluation\]
" . += "\[See quirks\]" //SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS - . += "\[View medical records\]" - . += "\[View general records\]" + var/medical_records_empty = (length(M.fields["past_records"]) < 2) + if (!(medical_records_empty)) + . += "\[View medical records\]" + var/general_records_empty = (length(R.fields["past_records"]) < 2) + if (!(general_records_empty)) + . += "\[View general records\]" //SKYRAT EDIT END if(HAS_TRAIT(user, TRAIT_SECURITY_HUD)) @@ -438,18 +442,24 @@ //|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at. var/criminal = "None" - R = find_record("name", perpname, GLOB.data_core.security) - if(R) - criminal = R.fields["criminal"] + var/datum/data/record/S = find_record("name", perpname, GLOB.data_core.security) //SKYRAT EDIT CHANGE - EXAMINE RECORDS - VAR WAS ORIGINALLY R + if(S) + criminal = S.fields["criminal"] . += "Criminal status: \[[criminal]\]" - . += jointext(list("Security record: \[View security records\]", //SKYRAT EDIT CHANGE - EXAMINE RECORDS (changed viewsec) + . += jointext(list("Misc. security record: \[View security records\]", //SKYRAT EDIT CHANGE - EXAMINE RECORDS - Security record > Misc. security record "\[Add citation\]", "\[Add crime\]", "\[View comment log\]", "\[Add comment\]"), "") - - . += jointext(list("General record: \[View general records\]"), "") //SKYRAT EDIT ADDITION - EXAMINE RECORDS + // SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS + var/general_records_empty = (length(R.fields["past_records"]) < 2) + if (!(general_records_empty)) + . += jointext(list("General record: \[View general records\]"), "") + var/security_records_empty = (length(S.fields["past_records"]) < 2) + if (!(security_records_empty)) + . += jointext(list("Security record: \[View security records\]"), "") + // SKYRAT EDIT ADDITION END else if(isobserver(user)) . += "Traits: [get_quirk_string(FALSE, CAT_QUIRK_ALL)]" //SKYRAT EDIT ADDITION BEGIN - GUNPOINT @@ -484,6 +494,15 @@ //. += "*---------*" SKYRAT EDIT REMOVAL SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .) + //SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS + var/datum/data/record/is_in_world = find_record("name", perpname, GLOB.data_core.general) //apparantly golden is okay with offstation roles having no records, FYI + var/exploitables_empty = (length(is_in_world.fields["exploitable_records"]) < 2) + for(var/datum/antagonist/antag_datum in user?.mind?.antag_datums) + if ((is_special_character(user)) && is_in_world && (antag_datum.view_exploitables) && !exploitables_empty) + . += "\[View exploitable info\]" + break + //SKYRAT EDIT END + /mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects! var/list/dat = list() if(!pronoun_replacement) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index eb3e92b7c90..fb079f7da0a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -209,8 +209,8 @@ to_chat(usr, "Detected physiological traits:\n[quirkstring]") else to_chat(usr, "No physiological traits found.") - if(href_list["medrecords"]) //SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS + if(href_list["medrecords"]) to_chat(usr, "Medical Record: [med_record.fields["past_records"]]") if(href_list["genrecords"]) to_chat(usr, "General Record: [general_record.fields["past_records"]]") @@ -260,7 +260,7 @@ sec_hud_set_security_status() return - if(href_list["viewsec"]) //SKYRAT EDIT CHANGE - EXAMINE RECORDS + if(href_list["view"]) if(!H.canUseHUD()) return if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) @@ -275,7 +275,6 @@ to_chat(usr, "Added by [c.author] at [c.time]") to_chat(usr, "----------") to_chat(usr, "Notes: [sec_record.fields["notes"]]") //SKYRAT EDIT CHANGE - EXAMINE RECORDS - to_chat(usr, "Security Record: [sec_record.fields["past_records"]]") //SKYRAT EDIT ADDITION - EXAMINE RECORDS return //SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS @@ -285,6 +284,13 @@ if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) return to_chat(usr, "General Record: [general_record.fields["past_records"]]") + + if(href_list["secrecords"]) + if(!H.canUseHUD()) + return + if(!HAS_TRAIT(H, TRAIT_SECURITY_HUD)) + return + to_chat(usr, "Security Record: [sec_record.fields["past_records"]]") //SKYRAT EDIT END if(href_list["add_citation"]) @@ -379,9 +385,9 @@ //SKYRAT EDIT ADDITION BEGIN - VIEW RECORDS if (is_special_character(usr)) var/perpname = get_face_name(get_id_name("")) - var/datum/data/record/EXP = find_record("name", perpname, GLOB.data_core.locked) + var/datum/data/record/EXP = find_record("name", perpname, GLOB.data_core.general) if(href_list["exprecords"]) - to_chat(usr, "Exploitable information: [EXP.fields["exp_records"]]") + to_chat(usr, "Exploitable information: [EXP.fields["exploitable_records"]]") //SKYRAT EDIT END ..() //end of this massive fucking chain. TODO: make the hud chain not spooky. - Yeah, great job doing that. diff --git a/modular_skyrat/master_files/code/modules/antagonists/_common/antag_datum.dm b/modular_skyrat/master_files/code/modules/antagonists/_common/antag_datum.dm index fbeb97bc687..78ff1c4427d 100644 --- a/modular_skyrat/master_files/code/modules/antagonists/_common/antag_datum.dm +++ b/modular_skyrat/master_files/code/modules/antagonists/_common/antag_datum.dm @@ -28,3 +28,18 @@ /datum/antagonist/traitor view_exploitables = TRUE + +/datum/antagonist/pirate + view_exploitables = TRUE //pirates are flexible antags, not strictly bound by their objective. i could see this working + +/datum/antagonist/rev/head + view_exploitables = TRUE //heads only. while all revs having exploitables would be fine, i feel this would complement the "leaders leading the masses" stuff rev naturally makes + +/*/datum/antagonist/cortical_borer //come back to borer when its not as new + view_exploitables = TRUE */ + +/datum/antagonist/cult //cult is adminbus only... im not sure about this but im doing it anyway + view_exploitables = TRUE + +/*/datum/antagonist/abductor //maybe? + view_exploitables = TRUE */ diff --git a/modular_skyrat/master_files/code/modules/client/preferences/flavor_text.dm b/modular_skyrat/master_files/code/modules/client/preferences/flavor_text.dm index 2359d51975e..245b9d04e11 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences/flavor_text.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences/flavor_text.dm @@ -38,3 +38,46 @@ /datum/preference/text/custom_species_lore/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) target.dna.features["custom_species_lore"] = value + +// SKYRAT EDIT ADDITION BEGIN -- RP RECORDS REJUVINATION +/datum/preference/text/general + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "general_record" + +/datum/preference/text/general/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + +/datum/preference/text/medical + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "medical_record" + +/datum/preference/text/medical/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + +/datum/preference/text/security + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "security_record" + +/datum/preference/text/security/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + +/datum/preference/text/exploitable + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "exploitable_info" + +/datum/preference/text/exploitable/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + +/datum/preference/text/background + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "background_info" + +/datum/preference/text/background/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + +// SKYRAT EDIT END diff --git a/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm b/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm index 78d78318625..46da76a64a8 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm @@ -24,11 +24,13 @@ READ_FILE(S["mismatched_customization"], mismatched_customization) READ_FILE(S["allow_advanced_colors"], allow_advanced_colors) - READ_FILE(S["general_record"], general_record) +//SKYRAT EDIT REMOVAL BEGIN -- RECORDS REJUVINATION +/* READ_FILE(S["general_record"], general_record) READ_FILE(S["security_record"], security_record) READ_FILE(S["medical_record"], medical_record) READ_FILE(S["background_info"], background_info) - READ_FILE(S["exploitable_info"], exploitable_info) + READ_FILE(S["exploitable_info"], exploitable_info) */ +//SKYRAT EDIT REMOVAL END READ_FILE(S["alt_job_titles"], alt_job_titles) @@ -68,11 +70,13 @@ WRITE_FILE(S["mismatched_customization"], mismatched_customization) WRITE_FILE(S["allow_advanced_colors"], allow_advanced_colors) - WRITE_FILE(S["general_record"] , general_record) +//SKYRAT EDIT REMOVAL BEGIN -- RECORDS REJUVINATION +/* WRITE_FILE(S["general_record"] , general_record) WRITE_FILE(S["security_record"] , security_record) WRITE_FILE(S["medical_record"] , medical_record) WRITE_FILE(S["background_info"] , background_info) - WRITE_FILE(S["exploitable_info"] , exploitable_info) + WRITE_FILE(S["exploitable_info"] , exploitable_info) */ +//SKYRAT EDIT REMOVAL END WRITE_FILE(S["alt_job_titles"], alt_job_titles) WRITE_FILE(S["languages"] , languages) WRITE_FILE(S["tgui_prefs_migration"] , tgui_prefs_migration) diff --git a/modular_skyrat/modules/ambitions/code/ambition.dm b/modular_skyrat/modules/ambitions/code/ambition.dm index a94dfd39dae..1712e47b532 100644 --- a/modular_skyrat/modules/ambitions/code/ambition.dm +++ b/modular_skyrat/modules/ambitions/code/ambition.dm @@ -63,6 +63,8 @@ dat += "Antagonists are supposed to provide excitement and intrigue, drive a story with the crew, and provide fun and interesting experience for people involved.
Remember, it's not about winning or losing, but about the story and interactions, this is a roleplay server.


" dat += "Here you write your ambitions for your antagonist round! Ambitions are your motive and what you plan to accomplish throught the round." dat += "
After filling all things out and submitting your ambition, your uplink/powers will unlock." + //SKYRAT EDIT ADDITION -- RECORDS MENU + dat += "
For your narrative, you could try thinking about your character's current conflicts, use the View Crew Exploitables verb in the OOC tab, or many other things." dat += "
If you can't come up with anything, use a template, and if you don't know if your ambition are proper, or too extreme, request admin review." dat += "
You can still edit them post submission." dat += "
If your ambitions are nonsensical, you may be subjected to an antagonist ban." @@ -84,7 +86,8 @@ dat += "
[last_requested_change]" dat += "
Notify admin that you've done them!" dat += "

Narrative:

" - dat += "Here you set your narrative. It's the reason on why you're doing antagonistic things. Perhaps you need money for personal reasons, or you were contracted to do someone's dirty work, or want to take down the BigPharma." + //SKYRAT EDIT -- RECORDS MENU + dat += "Here you set your narrative. It's the reason on why you're doing antagonistic things. Perhaps you need money for personal reasons, or you were contracted to do someone's dirty work, or want to take down the BigPharma? And if you're stumped, you can always view the exploitables of your fellow crew via the View Crew Exploitables verb in the OOC tab!" dat += "
" if(narrative == "") dat += "Please set your narrative!" diff --git a/modular_skyrat/modules/records_on_examine/code/datums/mind.dm b/modular_skyrat/modules/records_on_examine/code/datums/mind.dm new file mode 100644 index 00000000000..829dd0574f9 --- /dev/null +++ b/modular_skyrat/modules/records_on_examine/code/datums/mind.dm @@ -0,0 +1,21 @@ +/datum/mind/proc/handle_exploitables_menu() + //Only returns true if no datums are present in the mind. Without this, the for loop would end prematurely, as it would be null. + if (!antag_datums) + if (has_exploitable_menu) + remove_verb(current, /mob/proc/view_exploitables_verb) + has_exploitable_menu = FALSE + return + var/should_see_exploitables = FALSE + for(var/datum/antagonist/antag_datum in src?.antag_datums) + // Players are allowed to view exploitables if they have at least one antag_datum datum with view_exploitables set to TRUE. + if (antag_datum.view_exploitables) + should_see_exploitables = TRUE + break + if(!has_exploitable_menu && should_see_exploitables) + add_verb(current, /mob/proc/view_exploitables_verb) + has_exploitable_menu = TRUE + to_chat(current, span_danger("You now have access to the View-Crew-Exploitables verb, which shows all crew who currently have exploitable info and a link to view it!")) + + else if(has_exploitable_menu && !should_see_exploitables) + remove_verb(current, /mob/proc/view_exploitables_verb) + has_exploitable_menu = FALSE diff --git a/modular_skyrat/modules/records_on_examine/code/modules/mob/living/record_manifest.dm b/modular_skyrat/modules/records_on_examine/code/modules/mob/living/record_manifest.dm new file mode 100644 index 00000000000..9d6943d0892 --- /dev/null +++ b/modular_skyrat/modules/records_on_examine/code/modules/mob/living/record_manifest.dm @@ -0,0 +1,87 @@ +/datum/record_manifest + +/datum/datacore/proc/get_exploitable_manifest() + var/list/exp_manifest_out = list() + for(var/datum/job_department/department as anything in SSjob.joinable_departments) + exp_manifest_out[department.department_name] = list() + exp_manifest_out[DEPARTMENT_UNASSIGNED] = list() + + var/list/departments_by_type = SSjob.joinable_departments_by_type + for(var/datum/data/record/general_record in GLOB.data_core.general) + var/exploitables = general_record.fields["exploitable_records"] + var/exploitables_empty = (length(general_record.fields["exploitable_records"]) < 2) + if (exploitables_empty) + continue + var/name = general_record.fields["name"] + var/rank = general_record.fields["rank"] +// var/truerank = general_record.fields["truerank"] + var/datum/job/job = SSjob.GetJob(rank) + if(!job || !(job.job_flags & JOB_CREW_MANIFEST) || !LAZYLEN(job.departments_list) && (!exploitables_empty)) // In case an unlawful custom rank is added. + var/list/exp_misc_list = exp_manifest_out[DEPARTMENT_UNASSIGNED] + exp_misc_list[++exp_misc_list.len] = list( + "name" = name, + "rank" = rank, +// "truerank" = truerank, + "exploitable_records" = exploitables, + ) + continue + for(var/department_type as anything in job.departments_list) + var/datum/job_department/department = departments_by_type[department_type] + if(!department) + stack_trace("get_exploitable_manifest() failed to get job department for [department_type] of [job.type]") + continue + var/list/exp_entry = list( + "name" = name, + "rank" = rank, +// "truerank" = truerank, + "exploitable_records" = exploitables, + ) + var/list/exp_department_list = exp_manifest_out[department.department_name] + if(istype(job, department.department_head)) + exp_department_list.Insert(1, null) + exp_department_list[1] = exp_entry + else + exp_department_list[++exp_department_list.len] = exp_entry + + // Trim the empty categories. + for (var/department in exp_manifest_out) + if(!length(exp_manifest_out[department])) + exp_manifest_out -= department + + return exp_manifest_out + +/datum/record_manifest/ui_state(mob/user) + return GLOB.always_state + +/datum/record_manifest/ui_status(mob/user, datum/ui_state/state) + return (is_special_character(user)) ? UI_INTERACTIVE : UI_CLOSE + +/datum/record_manifest/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "RecordManifest") + ui.open() + +/datum/record_manifest/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + if(action == "show_exploitables") + var/exploitable_id = params["exploitable_id"] + var/datum/data/record/exploitable_record = find_record("name", exploitable_id, GLOB.data_core.general) + to_chat(usr, "Exploitable information: [exploitable_record.fields["exploitable_records"]]") + +/datum/record_manifest/ui_data(mob/user) + var/list/positions = list() + for(var/datum/job_department/department as anything in SSjob.joinable_departments) + var/list/exceptions = list() + for(var/datum/job/job as anything in department.department_jobs) + if(job.total_positions == -1) + exceptions += job.title + continue + positions[department.department_name] = list("exceptions" = exceptions) + + return list( + "manifest" = GLOB.data_core.get_exploitable_manifest(), + "positions" = positions + ) diff --git a/modular_skyrat/modules/records_on_examine/code/modules/mob/verbs/view_exploitables.dm b/modular_skyrat/modules/records_on_examine/code/modules/mob/verbs/view_exploitables.dm new file mode 100644 index 00000000000..cc6efa381c0 --- /dev/null +++ b/modular_skyrat/modules/records_on_examine/code/modules/mob/verbs/view_exploitables.dm @@ -0,0 +1,22 @@ +/mob/proc/view_exploitables_verb() + set name = "View Crew Exploitables" + set category = "OOC" + + if(world.time < client.crew_manifest_delay) + return + client.crew_manifest_delay = world.time + (1 SECONDS) + + if(is_special_character(src)) + for(var/datum/antagonist/antag_datum in src?.mind?.antag_datums) + if(!(antag_datum.view_exploitables) || !(is_special_character(src))) + continue + if (antag_datum.view_exploitables) + + if(!GLOB.record_manifest_tgui) + GLOB.record_manifest_tgui = new /datum/record_manifest(src) + + GLOB.record_manifest_tgui.ui_interact(src) + break + else + to_chat(src, span_danger("You're not an antagonist that can view exploitables! This message should not appear!")) + return diff --git a/modular_skyrat/modules/records_on_examine/readme.md b/modular_skyrat/modules/records_on_examine/readme.md index 4455f285316..accedb76d64 100644 --- a/modular_skyrat/modules/records_on_examine/readme.md +++ b/modular_skyrat/modules/records_on_examine/readme.md @@ -1,23 +1,18 @@ -https://github.com/Skyrat-SS13/Skyrat-tg/pull/7859 +https://github.com/Skyrat-SS13/Skyrat-tg/pull/9081 -## Title: Enables sec/med huds to view records on examine, as well as antagonists being able to view exploitables. +## Title: Re-implements complete records functionality, my old records on examine PR, implements a exploitables menu. MODULE ID: records_on_examine ### Description: This PR allows med/sec huds to view medical/security records on examine, respectively, as well as allowing you to view general records. It -also allows certain antags to view exploitables on examine as well. - -Originally I planned to add a PDA program to allow all crew to view general -records, and a OOC verb to allow antags to view exploitables of the entire crew, as well as a way for background info to be seen, however -I am not that good at coding and chickened out. +also allows certain antags to view exploitables on examine as well. It also fully restores what functionality records had prior to the pref rework. Basically, +my last 2 prs in one. It also refactors how record saves are handled, and how admin antag removals work. ### TG Proc/File Changes: -EDIT: examine.dm, human.dm, datacore.dm. Modified the behavior of examining things while wearing HUDs, and the behavior of examining as -certain antagonists in examine.dm. Added a few variables that store records to human.dm, added the functionality to the new links -acquired by examining. Added a field for exploitables in the locked record section of datacore.dm. +EDIT: examine.dm, human.dm, datacore.dm, flavor_text.dm, species_features.tx, tgui.dm, preferences_savefile.dm, antag_datum.dm, mind.dm. Allowed links to appear in chat when viewing people with huds/as certain antags, allows clikcing them to paste the records of the other party into chat. Re-implements the storing and handling of records into datacore, adds UI for that in flavor_text and species_features. Modified TGUI to recognize the exploitable manifest. Changed preferences_savefile.dm to comment out the way we used to save and load records, it's handled in flavor_text.dm now. Adds and removes the exploitables verb now, by changing mind.dm and antag_datum.dm. ### Defines: @@ -29,8 +24,8 @@ acquired by examining. Added a field for exploitables in the locked record secti ### Included files that are not contained in this module: -- N/A +- RecordManifest.js ### Credits: -Niko#7526, and #development_discuss for giving me the help I needed +Niko#7526, MrMelbert for giving me much needed advice and code examples, and #development_discuss for helping me diff --git a/tgstation.dme b/tgstation.dme index ea700f35bae..7eed00081a7 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4945,6 +4945,9 @@ #include "modular_skyrat\modules\reagent_forging\code\modules\reagent_forging\forge_weapons.dm" #include "modular_skyrat\modules\reagent_forging\code\modules\reagent_forging\reagent_component.dm" #include "modular_skyrat\modules\reagent_forging\code\modules\reagent_forging\water_basin.dm" +#include "modular_skyrat\modules\records_on_examine\code\datums\mind.dm" +#include "modular_skyrat\modules\records_on_examine\code\modules\mob\living\record_manifest.dm" +#include "modular_skyrat\modules\records_on_examine\code\modules\mob\verbs\view_exploitables.dm" #include "modular_skyrat\modules\roboclothes\code\clothing\robotics_clothing.dm" #include "modular_skyrat\modules\roboclothes\code\vending\wardrobes.dm" #include "modular_skyrat\modules\rod-stopper\code\immovable_skyrat.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx index 9d951eeea05..f8f3b73800f 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx @@ -43,7 +43,37 @@ export const custom_species_lore: Feature = { description: "Add some lore for your species! Won't show up if there's no custom species.", component: FeatureTextInput, }; +// SKYRAT EDIT ADDITION BEGIN -- RECORDS REJUVINATION +export const general_record: Feature = { + name: "Records - General", + description: "Your general records! These are records that are for general viewing-things like employment, qualifications, etc. By default, anyone with a HUD/records access can view these.", + component: FeatureTextInput, +}; +export const security_record: Feature = { + name: "Records - Security", + description: "Your security records! These are records for criminal records, arrest history, things like that. Sec officers can view these.", + component: FeatureTextInput, +}; + +export const medical_record: Feature = { + name: "Records - Medical", + description: "Your medical records! These are records for things like medical history, prescriptions, DNR orders, etc. Medical staff can view these.", + component: FeatureTextInput, +}; + +export const exploitable_info: Feature = { + name: "Records - Exploitable", + description: "This section is for information antagonists can use, IN CHARACTER AND OUT. If you are willing to be disrupted by antagonists MORE than the average player (this is usually a very fun experience, if you're into that kind of roleplay), put it here! Also for things antagonists can use against your character.", + component: FeatureTextInput, +}; + +export const background_info: Feature = { + name: "Records - Background", + description: "nobody uses this lmao", + component: FeatureTextInput, +}; +// SKYRAT EDIT END export const allow_mismatched_parts_toggle: FeatureToggle = { name: "Allow Mismatched Parts", description: "Want to go completely crazy with your character design? Use this to select any parts from any species!", diff --git a/tgui/packages/tgui/interfaces/RecordManifest.js b/tgui/packages/tgui/interfaces/RecordManifest.js new file mode 100644 index 00000000000..7485ecde85e --- /dev/null +++ b/tgui/packages/tgui/interfaces/RecordManifest.js @@ -0,0 +1,103 @@ +import { classes } from 'common/react'; +import { useBackend } from "../backend"; +import { Icon, Section, Table, Tooltip, Button } from "../components"; +import { Window } from "../layouts"; + +const commandJobs = [ + "Head of Personnel", + "Head of Security", + "Chief Engineer", + "Research Director", + "Chief Medical Officer", +]; + +export const RecordManifest = (props, context) => { + const { data: { manifest, positions } } = useBackend(context); + const { act } = useBackend(context); + + return ( + + + {Object.entries(manifest).map(([dept, crew]) => ( +
+ + {Object.entries(crew).map(([crewIndex, crewMember]) => ( + + + {crewMember.name} + + +
+
+ ))} +
+
+ ); +};