From d8d9cf7fde5833bf2b66f4a9ad5fc0d803b72677 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Fri, 8 Oct 2021 23:15:00 +0100 Subject: [PATCH] Allows OOC examine at all times (#8694) * e chad e E * 000 * Update ExaminePanel.js * Update ExaminePanel.js * EEEEE * Update examine_tgui.dm * Update examine_tgui.dm --- .../mob/living/carbon/human/examine.dm | 7 +-- .../mob/living/carbon/human/examine_tgui.dm | 33 ++++++++-- .../client/preferences/erp_preferences.dm | 60 +++++++++++++++++++ tgui/packages/tgui/interfaces/ExaminePanel.js | 22 ++++--- .../skyrat/cursed_shit.tsx | 10 ++++ 5 files changed, 114 insertions(+), 18 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index b7e30576953..fa1e3c5855c 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -468,10 +468,9 @@ if(!(G.is_hidden(src))) . += "[t_He] has exposed genitals... Look closer..." break - if(!skipface) - var/line = span_notice("Examine closely...") - if(line) - . += line + var/line = span_notice("Examine closely...") + if(line) + . += line if(client) var/erp_status_pref = client.prefs.read_preference(/datum/preference/choiced/erp_status) if(erp_status_pref && erp_status_pref != "disabled") diff --git a/code/modules/mob/living/carbon/human/examine_tgui.dm b/code/modules/mob/living/carbon/human/examine_tgui.dm index 1be20882348..f637a844929 100644 --- a/code/modules/mob/living/carbon/human/examine_tgui.dm +++ b/code/modules/mob/living/carbon/human/examine_tgui.dm @@ -34,10 +34,33 @@ /datum/examine_panel/ui_data(mob/user) var/list/data = list() - data["character_name"] = holder.name + + var/datum/preferences/preferences = holder.client?.prefs + + var/obscured = (holder.wear_mask && (holder.wear_mask.flags_inv & HIDEFACE)) || (holder.head && (holder.head.flags_inv & HIDEFACE)) + var/name = obscured ? "Unknown" : holder.name + var/flavor_text = obscured ? "Obscured" : holder.dna.features["flavor_text"] + var/custom_species = obscured ? "Obscured" : holder.dna.features["custom_species"] + var/custom_species_lore = obscured ? "Obscured" : holder.dna.features["custom_species_lore"] + + var/ooc_notes = "" + + if(preferences && preferences.read_preference(/datum/preference/toggle/master_erp_preferences)) + var/e_prefs = preferences.read_preference(/datum/preference/choiced/erp_status) + var/e_prefs_nc = preferences.read_preference(/datum/preference/choiced/erp_status_nc) + var/e_prefs_v = preferences.read_preference(/datum/preference/choiced/erp_status_v) + ooc_notes += "ERP: [e_prefs]\n" + ooc_notes += "Non-conforming - [e_prefs_nc]\n" + ooc_notes += "VR - [e_prefs_v]\n" + ooc_notes += "\n" + + ooc_notes += holder.dna.features["ooc_notes"] + + data["obscured"] = obscured ? TRUE : FALSE + data["character_name"] = name data["assigned_map"] = examine_panel_screen.assigned_map - data["flavor_text"] = holder.dna.features["flavor_text"] - data["ooc_notes"] = holder.dna.features["ooc_notes"] - data["custom_species"] = holder.dna.features["custom_species"] - data["custom_species_lore"] = holder.dna.features["custom_species_lore"] + data["flavor_text"] = flavor_text + data["ooc_notes"] = ooc_notes + data["custom_species"] = custom_species + data["custom_species_lore"] = custom_species_lore return data diff --git a/modular_skyrat/master_files/code/modules/client/preferences/erp_preferences.dm b/modular_skyrat/master_files/code/modules/client/preferences/erp_preferences.dm index 165cb28a427..7f5da5f7df4 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences/erp_preferences.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences/erp_preferences.dm @@ -91,3 +91,63 @@ /datum/preference/choiced/erp_status/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) return FALSE + +/datum/preference/choiced/erp_status_nc + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "erp_status_pref_nc" + +/datum/preference/choiced/erp_status_nc/init_possible_values() + return list("Yes", "Ask", "No") + +/datum/preference/choiced/erp_status_nc/create_default_value() + return "Ask" + +/datum/preference/choiced/erp_status_nc/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + if(CONFIG_GET(flag/disable_erp_preferences)) + return FALSE + + return preferences.read_preference(/datum/preference/toggle/master_erp_preferences) + +/datum/preference/choiced/erp_status_nc/deserialize(input, datum/preferences/preferences) + if(CONFIG_GET(flag/disable_erp_preferences)) + return "disabled" + if(!preferences.read_preference(/datum/preference/toggle/master_erp_preferences)) + return "disabled" + . = ..() + +/datum/preference/choiced/erp_status_nc/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + +/datum/preference/choiced/erp_status_v + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "erp_status_pref_v" + +/datum/preference/choiced/erp_status_v/init_possible_values() + return list("Yes", "Ask", "No") + +/datum/preference/choiced/erp_status_v/create_default_value() + return "Ask" + +/datum/preference/choiced/erp_status_v/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + if(CONFIG_GET(flag/disable_erp_preferences)) + return FALSE + + return preferences.read_preference(/datum/preference/toggle/master_erp_preferences) + +/datum/preference/choiced/erp_status_v/deserialize(input, datum/preferences/preferences) + if(CONFIG_GET(flag/disable_erp_preferences)) + return "disabled" + if(!preferences.read_preference(/datum/preference/toggle/master_erp_preferences)) + return "disabled" + . = ..() + +/datum/preference/choiced/erp_status_v/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE diff --git a/tgui/packages/tgui/interfaces/ExaminePanel.js b/tgui/packages/tgui/interfaces/ExaminePanel.js index a3e1726fea0..1f3b21e3b7a 100644 --- a/tgui/packages/tgui/interfaces/ExaminePanel.js +++ b/tgui/packages/tgui/interfaces/ExaminePanel.js @@ -6,6 +6,7 @@ export const ExaminePanel = (props, context) => { const { act, data } = useBackend(context); const { character_name, + obscured, assigned_map, flavor_text, ooc_notes, @@ -20,16 +21,19 @@ export const ExaminePanel = (props, context) => { theme="admin"> - +
- + {!obscured + && ( + + )}
diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/cursed_shit.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/cursed_shit.tsx index 0404bc60832..13aef3bc39d 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/cursed_shit.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/cursed_shit.tsx @@ -119,3 +119,13 @@ export const erp_status_pref: FeatureChoiced = { name: "ERP Status", component: FeatureDropdownInput, }; + +export const erp_status_pref_nc: FeatureChoiced = { + name: "ERP Non-conforming Status", + component: FeatureDropdownInput, +}; + +export const erp_status_pref_v: FeatureChoiced = { + name: "ERP VR Status", + component: FeatureDropdownInput, +};