Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Semi-Modular] Silicon Flavor Text #975

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2223,9 +2223,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
features["naked_flavor_text"] = strip_html_simple(msg, MAX_FLAVOR_LEN, TRUE)
//SPLURT 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()
var/msg = input(usr, "Set the flavor text in your 'examine' verb. This is for describing what people can tell by looking at your character.", "Silicon Flavor Text", features["silicon_flavor_text"]) as message|null
if(!isnull(msg))
features["silicon_flavor_text"] = strip_html_simple(msg, MAX_FLAVOR_LEN, TRUE) //Skyrat edit, uses strip_html_simple()
features["silicon_flavor_text"] = strip_html_simple(msg, MAX_FLAVOR_LEN, TRUE)

if("ooc_notes")
var/msg = stripped_multiline_input(usr, "Set always-visible OOC notes related to content preferences. THIS IS NOT FOR CHARACTER DESCRIPTIONS!", "OOC notes", html_decode(features["ooc_notes"]), MAX_FLAVOR_LEN, TRUE)
Expand Down
13 changes: 13 additions & 0 deletions code/modules/mob/living/silicon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@
. += "<b>[src] has the following laws:</b>"
for(var/law in laws.get_law_list(include_zeroth = TRUE))
. += law

//SPLURT EDIT ADDITION BEGIN - CUSTOMIZATION
if(client)
var/line
if(length(client.prefs.features["silicon_flavor_text"]))
var/message = client.prefs.features["silicon_flavor_text"]
if(length_char(message) <= 40)
line = "<span class='notice'>[message]</span>"
else
line = "<span class='notice'>[copytext_char(message, 1, 37)]... <a href='?src=[REF(src)];lookup_info=silicon_flavor_text'>More...</a></span>"
line += " <span class='notice'><a href='?src=[REF(src)];lookup_info=ooc_notes'>\[OOC\]</a></span>"
. += line
//SPLURT EDIT ADDITION END
25 changes: 17 additions & 8 deletions code/modules/mob/living/silicon/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@
diag_hud_set_health()
ADD_TRAIT(src, TRAIT_ASHSTORM_IMMUNE, ROUNDSTART_TRAIT)

/mob/living/silicon/ComponentInitialize()
. = ..()
AddElement(/datum/element/flavor_text, _name = "Silicon Flavor Text", _save_key = "silicon_flavor_text")
AddElement(/datum/element/flavor_text, "", "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)

/mob/living/silicon/med_hud_set_health()
return //we use a different hud

Expand Down Expand Up @@ -221,8 +215,23 @@
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
statelaws()

return

//SPLURT EDIT ADDITION BEGIN - CUSTOMIZATION
if(href_list["lookup_info"])
switch(href_list["lookup_info"])
if("ooc_notes")
if(client && length(client.prefs.features["ooc_notes"]))
var/datum/browser/popup = new(usr, "[name]'s ooc info", "[name]'s OOC Information", 500, 200)
popup.set_content(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", "[name]'s OOC information", replacetext(client.prefs.features["ooc_notes"], "\n", "<BR>")))
popup.open()
return

if("silicon_flavor_text")
if(client && length(client.prefs.features["silicon_flavor_text"]))
var/datum/browser/popup = new(usr, "[name]'s flavor text", "[name]'s Flavor Text", 500, 200)
popup.set_content(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", "[name]'s flavor text", replacetext(client.prefs.features["silicon_flavor_text"], "\n", "<BR>")))
popup.open()
return
//SPLURT EDIT ADDITION END

/mob/living/silicon/proc/statelaws(force = 0)

Expand Down
10 changes: 6 additions & 4 deletions modular_splurt/code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@

dat += "<table><tr><td width='20%' height='300px' valign='top'>"
dat += "<h2>Flavor Text</h2>"
// Carbon flavor text
dat += "<a href='?_src_=prefs;preference=flavor_text;task=input'><b>Set Examine Text</b></a><br>"
if(length(features["flavor_text"]) <= MAX_FLAVOR_PREVIEW_LEN)
if(!length(features["flavor_text"]))
Expand All @@ -165,15 +166,16 @@
else
dat += "[TextPreview(html_encode(features["naked_flavor_text"]))]...<BR>"
//SPLURT edit end
// Silicon flavor text
dat += "<h2>Silicon Flavor Text</h2>"
dat += "<a href='?_src_=prefs;preference=silicon_flavor_text;task=input'><b>Set Silicon Examine Text</b></a><br>"
if(length(features["silicon_flavor_text"]) <= MAX_FLAVOR_PREVIEW_LEN)
if(length(features["silicon_flavor_text"]) <= 40)
if(!length(features["silicon_flavor_text"]))
dat += "\[...\]<BR>"
dat += "\[...\]"
else
dat += "[features["silicon_flavor_text"]]<BR>"
dat += "[html_encode(features["silicon_flavor_text"])]"
else
dat += "[TextPreview(features["silicon_flavor_text"])]...<BR>"
dat += "[copytext(html_encode(features["silicon_flavor_text"]), 1, 40)]..."
dat += "<h2>OOC notes</h2>"
dat += "<a href='?_src_=prefs;preference=ooc_notes;task=input'><b>Set OOC notes</b></a><br>"
var/ooc_notes_len = length(features["ooc_notes"])
Expand Down
Loading