mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
TGUI Input Conversions
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
|
||||
/datum/category_item/player_setup_item/general/basic/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
if(href_list["rename"])
|
||||
var/raw_name = input(user, "Choose your character's name:", "Character Name") as text|null
|
||||
var/raw_name = tgui_input_text(user, "Choose your character's name:", "Character Name")
|
||||
if (!isnull(raw_name) && CanUseTopic(user))
|
||||
var/new_name = sanitize_name(raw_name, pref.species, is_FBP())
|
||||
if(new_name)
|
||||
@@ -125,7 +125,7 @@
|
||||
else if(href_list["age"])
|
||||
var/min_age = get_min_age()
|
||||
var/max_age = get_max_age()
|
||||
var/new_age = input(user, "Choose your character's age:\n([min_age]-[max_age])", "Character Preference", pref.age) as num|null
|
||||
var/new_age = tgui_input_number(user, "Choose your character's age:\n([min_age]-[max_age])", "Character Preference", pref.age, max_age, min_age)
|
||||
if(new_age && CanUseTopic(user))
|
||||
pref.age = max(min(round(text2num(new_age)), max_age), min_age)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
var/char
|
||||
var/keys[0]
|
||||
do
|
||||
char = input(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") as null|text
|
||||
char = tgui_input_text(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining")
|
||||
if(char)
|
||||
if(length(char) > 1)
|
||||
tgui_alert_async(user, "Only single characters allowed.", "Error")
|
||||
|
||||
@@ -836,7 +836,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(href_list["skin_tone"])
|
||||
if(!has_flag(mob_species, HAS_SKIN_TONE))
|
||||
return TOPIC_NOACTION
|
||||
var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35) as num|null
|
||||
var/new_s_tone = tgui_input_number(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35, 220, 1)
|
||||
if(new_s_tone && has_flag(mob_species, HAS_SKIN_TONE) && CanUseTopic(user))
|
||||
pref.s_tone = 35 - max(min( round(new_s_tone), 220),1)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
@@ -59,11 +59,15 @@
|
||||
switch(href_list["flavor_text"])
|
||||
if("open")
|
||||
if("general")
|
||||
<<<<<<< HEAD
|
||||
var/msg = sanitize(input(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"]])) as message, MAX_RECORD_LENGTH, extra = 0) //VOREStation Edit: separating out OOC notes
|
||||
=======
|
||||
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), extra = 0) //VOREStation Edit: separating out OOC notes
|
||||
>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions
|
||||
if(CanUseTopic(user))
|
||||
pref.flavor_texts[href_list["flavor_text"]] = msg
|
||||
else
|
||||
var/msg = sanitize(input(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]])) as message, extra = 0)
|
||||
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), extra = 0)
|
||||
if(CanUseTopic(user))
|
||||
pref.flavor_texts[href_list["flavor_text"]] = msg
|
||||
SetFlavorText(user)
|
||||
@@ -73,11 +77,11 @@
|
||||
switch(href_list["flavour_text_robot"])
|
||||
if("open")
|
||||
if("Default")
|
||||
var/msg = sanitize(input(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"])) as message, extra = 0)
|
||||
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), extra = 0)
|
||||
if(CanUseTopic(user))
|
||||
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
|
||||
else
|
||||
var/msg = sanitize(input(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"]])) as message, extra = 0)
|
||||
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), extra = 0)
|
||||
if(CanUseTopic(user))
|
||||
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
|
||||
SetFlavourTextRobot(user)
|
||||
|
||||
Reference in New Issue
Block a user