Merge pull request #4590 from TheGreatKitsune/flavor-clear-fix

Earlyports Fix clearing flavor text when cancelling
This commit is contained in:
Nadyr
2022-07-20 21:02:26 -04:00
committed by GitHub
@@ -59,12 +59,12 @@
switch(href_list["flavor_text"])
if("open")
if("general")
var/msg = sanitize(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
if(CanUseTopic(user))
var/msg = sanitize(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
if(CanUseTopic(user) && !isnull(msg))
pref.flavor_texts[href_list["flavor_text"]] = msg
else
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user))
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]]. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user) && !isnull(msg))
pref.flavor_texts[href_list["flavor_text"]] = msg
SetFlavorText(user)
return TOPIC_HANDLED
@@ -73,12 +73,12 @@
switch(href_list["flavour_text_robot"])
if("open")
if("Default")
var/msg = sanitize(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user))
var/msg = sanitize(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user) && !isnull(msg))
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
else
var/msg = sanitize(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user))
var/msg = sanitize(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this blank, default flavour text will be used for this module. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user) && !isnull(msg))
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
SetFlavourTextRobot(user)
return TOPIC_HANDLED