Merge pull request #14750 from Cyantime/ftextreset

Stop 'cancel' button from wiping flavor text
This commit is contained in:
Heroman3003
2023-04-03 06:22:41 +10:00
committed by CHOMPStation2
parent ee54791e47
commit bfd45cf2d0
4 changed files with 16 additions and 11 deletions

View File

@@ -133,19 +133,19 @@
else if(href_list["set_medical_records"])
var/new_medical = strip_html_simple(tgui_input_text(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(!isnull(new_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
if(new_medical && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.med_record = new_medical
return TOPIC_REFRESH
else if(href_list["set_general_records"])
var/new_general = strip_html_simple(tgui_input_text(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(!isnull(new_general) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
if(new_general && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.gen_record = new_general
return TOPIC_REFRESH
else if(href_list["set_security_records"])
var/sec_medical = strip_html_simple(tgui_input_text(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
if(!isnull(sec_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
if(sec_medical && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.sec_record = sec_medical
return TOPIC_REFRESH

View File

@@ -60,11 +60,11 @@
if("open")
if("general")
var/msg = strip_html_simple(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)) //VOREStation Edit: separating out OOC notes
if(CanUseTopic(user) && !isnull(msg))
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
else
var/msg = strip_html_simple(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))
if(CanUseTopic(user) && !isnull(msg))
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
SetFlavorText(user)
return TOPIC_HANDLED
@@ -74,11 +74,11 @@
if("open")
if("Default")
var/msg = strip_html_simple(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))
if(CanUseTopic(user) && !isnull(msg))
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
else
var/msg = strip_html_simple(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))
if(CanUseTopic(user) && !isnull(msg))
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
SetFlavourTextRobot(user)
return TOPIC_HANDLED

View File

@@ -689,12 +689,15 @@
return
if("general")
var/msg = strip_html_simple(tgui_input_text(usr,"Update the general description of your character. This will be shown regardless of clothing.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE, prevent_enter = TRUE)) //VOREStation Edit: separating out OOC notes
flavor_texts[href_list["flavor_change"]] = msg
if(msg)
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
return
else
var/msg = strip_html_simple(tgui_input_text(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE, prevent_enter = TRUE))
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
if(msg)
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
return
..()
return

View File

@@ -266,7 +266,9 @@
set desc = "Sets an extended description of your character's features."
set category = "IC"
flavor_text = strip_html_simple(tgui_input_text(usr, "Please enter your new flavour text.", "Flavour text", null))
var/new_flavortext = strip_html_simple(tgui_input_text(usr, "Please enter your new flavour text.", "Flavour text", null))
if(new_flavortext)
flavor_text = new_flavortext
/mob/living/silicon/binarycheck()
return 1