Reduced copypasta

This commit is contained in:
Putnam
2020-02-22 02:38:57 -08:00
parent 146b2a35f2
commit d328d554ba
2 changed files with 3 additions and 14 deletions
+2 -13
View File
@@ -129,7 +129,7 @@ GLOBAL_VAR_INIT(miscreants_allowed, FALSE)
flavor_text_2 = new_flavor
to_chat(src, "Your temporary flavor text has been updated.")
/mob/proc/print_flavor_text(flavor)
/mob/proc/print_flavor_text(flavor,temp = FALSE)
if(!flavor)
return
// We are decoding and then encoding to not only get correct amount of characters, but also to prevent partial escaping characters being shown.
@@ -137,18 +137,7 @@ GLOBAL_VAR_INIT(miscreants_allowed, FALSE)
if(length_char(msg) <= 40)
return "<span class='notice'>[html_encode(msg)]</span>"
else
return "<span class='notice'>[html_encode(copytext_char(msg, 1, 37))]... <a href='?src=[REF(src)];flavor_more=1'>More...</span></a>"
/mob/proc/print_flavor_text_2(flavor)
if(!flavor)
return
// We are decoding and then encoding to not only get correct amount of characters, but also to prevent partial escaping characters being shown.
var/msg = html_decode(replacetext(flavor, "\n", " "))
if(length_char(msg) <= 40)
return "<span class='notice'>[html_encode(msg)]</span>"
else
return "<span class='notice'>[html_encode(copytext_char(msg, 1, 37))]... <a href='?src=[REF(src)];flavor2_more=1'>More...</span></a>"
return "<span class='notice'>[html_encode(copytext_char(msg, 1, 37))]... <a href='?src=[REF(src)];flavor[temp ? "2" : ""]_more=1'>More...</span></a>"
//LOOC toggles
/client/verb/listen_looc()
@@ -397,7 +397,7 @@
var/flavor = print_flavor_text(flavor_text)
if(flavor)
. += flavor
var/temp_flavor = print_flavor_text_2(flavor_text_2)
var/temp_flavor = print_flavor_text(flavor_text_2,TRUE)
if(temp_flavor)
. += temp_flavor
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)