From ea17a468a8abc4477973d8dc4b6e0e00dbdd8c74 Mon Sep 17 00:00:00 2001 From: nullfag Date: Sat, 9 Apr 2022 14:33:28 +0200 Subject: [PATCH] naked flavor text --- code/__HELPERS/mobs.dm | 1 + code/datums/elements/flavor_text.dm | 9 +++++++-- code/modules/client/preferences.dm | 18 ++++++++++++++++++ code/modules/client/preferences_savefile.dm | 4 ++++ code/modules/mob/living/carbon/human/human.dm | 1 + .../modules/client/preferences_savefile.dm | 1 + 6 files changed, 32 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index f2885f4405..30c0dc031d 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -234,6 +234,7 @@ "ipc_antenna" = "None", "flavor_text" = "", "silicon_flavor_text" = "", + "naked_flavor_text" = "", //tempt edit "meat_type" = "Mammalian", "body_model" = body_model, "body_size" = RESIZE_DEFAULT_SIZE diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index 60722bba71..83c452ccae 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -7,6 +7,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code var/list/texts_by_atom = list() var/addendum = "" var/always_show = FALSE + var/show_on_naked = FALSE var/max_len = MAX_FLAVOR_LEN var/can_edit = TRUE /// For preference/DNA saving/loading. Null to prevent. Prefs are only loaded from obviously if it exists in preferences.features. @@ -16,7 +17,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code /// Examine FULLY views. Overrides examine_no_preview var/examine_full_view = FALSE -/datum/element/flavor_text/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE) +/datum/element/flavor_text/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE, _show_on_naked) . = ..() if(. == ELEMENT_INCOMPATIBLE || !isatom(target)) //no reason why this shouldn't work on atoms too. @@ -29,6 +30,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code flavor_name = _name if(!isnull(addendum)) addendum = _addendum + show_on_naked = _show_on_naked always_show = _always_show can_edit = _edit save_key = _save_key @@ -62,6 +64,9 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code if(!unknown && iscarbon(target)) var/mob/living/carbon/C = L unknown = (C.wear_mask && (C.wear_mask.flags_inv & HIDEFACE)) || (C.head && (C.head.flags_inv & HIDEFACE)) + if(show_on_naked && ishuman(C)) + var/mob/living/carbon/human/H = C + unknown = (unknown || (H.w_uniform || H.wear_suit)) if(unknown) if(!("...?" in examine_list)) //can't think of anything better in case of multiple flavor texts. examine_list += "...?" @@ -174,7 +179,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code var/static/list/i_dont_even_know_who_you_are = typecacheof(list(/datum/antagonist/abductor, /datum/antagonist/ert, /datum/antagonist/nukeop, /datum/antagonist/wizard)) -/datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE) +/datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE, _show_on_naked) if(!iscarbon(target)) return ELEMENT_INCOMPATIBLE . = ..() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index ad01396475..83a0b0da96 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -218,6 +218,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) "ipc_screen" = "Sunburst", "ipc_antenna" = "None", "flavor_text" = "", +"naked_flavor_text" = "", //tempt edit "silicon_flavor_text" = "", "ooc_notes" = "", "meat_type" = "Mammalian", @@ -483,6 +484,17 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "[html_encode(features["flavor_text"])]
" //skyrat - adds
and uses html_encode else dat += "[TextPreview(html_encode(features["flavor_text"]))]...
" //skyrat edit, uses html_encode + //tempt edit - nekked flavor text + dat += "

Naked Flavor Text

" + dat += "Set Naked Examine Text
" + if(length(features["naked_flavor_text"]) <= 40) + if(!length(features["naked_flavor_text"])) + dat += "\[...\]
" + else + dat += "[html_encode(features["naked_flavor_text"])]
" + else + dat += "[TextPreview(html_encode(features["naked_flavor_text"]))]...
" + //tempt edit end dat += "

Silicon Flavor Text

" dat += "Set Silicon Examine Text
" if(length(features["silicon_flavor_text"]) <= 40) @@ -1926,6 +1938,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(!isnull(msg)) features["flavor_text"] = strip_html_simple(msg, MAX_FLAVOR_LEN, TRUE) //Skyrat edit, removed strip_html_simple() + //tempt edit + if("naked_flavor_text") + var/msg = input(usr, "Set the naked flavor text in your 'examine' verb. This should be IC, describing how your character would look like if naked.", "Naked Flavor Text", features["naked_flavor_text"]) as message|null + if(!isnull(msg)) + features["naked_flavor_text"] = strip_html_simple(msg, MAX_FLAVOR_LEN, TRUE) + //tempt edit end if("silicon_flavor_text") var/msg = input(usr, "Set the silicon flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Silicon Flavor Text", features["silicon_flavor_text"]) as message|null //Skyrat edit, removed stripped_multiline_input() if(!isnull(msg)) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 689bcf09d1..5ad194a832 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -948,6 +948,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else //We have no old flavortext, default to new S["feature_flavor_text"] >> features["flavor_text"] + //tempt edit + S["feature_naked_flavor_text"] >> features["naked_flavor_text"] + //end S["silicon_feature_flavor_text"] >> features["silicon_flavor_text"] @@ -1102,6 +1105,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car medical_records = copytext(medical_records, 1, MAX_FLAVOR_LEN) features["flavor_text"] = copytext(features["flavor_text"], 1, MAX_FLAVOR_LEN) + features["naked_flavor_text"] = copytext(features["naked_flavor_text"], 1, MAX_FLAVOR_LEN) features["silicon_flavor_text"] = copytext(features["silicon_flavor_text"], 1, MAX_FLAVOR_LEN) features["ooc_notes"] = copytext(features["ooc_notes"], 1, MAX_FLAVOR_LEN) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 933cee55b2..f34eb80645 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -46,6 +46,7 @@ AddComponent(/datum/component/mood) AddComponent(/datum/component/combat_mode) AddElement(/datum/element/flavor_text/carbon, _name = "Flavor Text", _save_key = "flavor_text") + AddElement(/datum/element/flavor_text/carbon, _name = "Naked Flavor Text", _save_key = "naked_flavor_text", _show_on_naked = TRUE) AddElement(/datum/element/flavor_text/carbon/temporary, "", "Set Pose (Temporary Flavor Text)", "This should be used only for things pertaining to the current round!", _save_key = null) AddElement(/datum/element/flavor_text, _name = "OOC Notes", _addendum = "Put information on ERP/vore/lewd-related preferences here. THIS SHOULD NOT CONTAIN REGULAR FLAVORTEXT!!", _save_key = "ooc_notes", _examine_no_preview = TRUE) AddElement(/datum/element/strippable, GLOB.strippable_human_items, /mob/living/carbon/human/.proc/should_strip) diff --git a/modular_citadel/code/modules/client/preferences_savefile.dm b/modular_citadel/code/modules/client/preferences_savefile.dm index 5c2137c76c..442f04f7fe 100644 --- a/modular_citadel/code/modules/client/preferences_savefile.dm +++ b/modular_citadel/code/modules/client/preferences_savefile.dm @@ -59,6 +59,7 @@ WRITE_FILE(S["feature_xeno_head"], features["xenohead"]) //flavor text WRITE_FILE(S["feature_flavor_text"], features["flavor_text"]) + WRITE_FILE(S["feature_naked_flavor_text"], features["naked_flavor_text"]) //tempt edit WRITE_FILE(S["silicon_feature_flavor_text"], features["silicon_flavor_text"]) //sandstorm stuff