Input Conversion Part 2

This commit is contained in:
ItsSelis
2022-06-19 03:40:24 +02:00
parent 12611af1ee
commit 2d7b081a55
80 changed files with 160 additions and 160 deletions
@@ -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
@@ -94,7 +94,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")
@@ -777,7 +777,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,11 @@
switch(href_list["flavor_text"])
if("open")
if("general")
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, 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
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 +73,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)
@@ -82,7 +82,7 @@
return TOPIC_REFRESH
else if(href_list["select_alpha"])
var/UI_style_alpha_new = input(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha) as num|null
var/UI_style_alpha_new = tgui_input_number(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha, 255, 50)
if(isnull(UI_style_alpha_new) || (UI_style_alpha_new < 50 || UI_style_alpha_new > 255) || !CanUseTopic(user)) return TOPIC_NOACTION
pref.UI_style_alpha = UI_style_alpha_new
return TOPIC_REFRESH
@@ -100,7 +100,7 @@
return TOPIC_REFRESH
else if(href_list["select_client_fps"])
var/fps_new = input(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps) as null|num
var/fps_new = tgui_input_number(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps, 200, 1)
if(isnull(fps_new) || !CanUseTopic(user)) return TOPIC_NOACTION
if(fps_new < 0 || fps_new > MAX_CLIENT_FPS) return TOPIC_NOACTION
pref.client_fps = fps_new
@@ -109,14 +109,14 @@
return TOPIC_REFRESH
else if(href_list["select_ambience_freq"])
var/ambience_new = input(user, "Input how often you wish to hear ambience repeated! (1-60 MINUTES, 0 for disabled)", "Global Preference", pref.ambience_freq) as null|num
var/ambience_new = tgui_input_number(user, "Input how often you wish to hear ambience repeated! (1-60 MINUTES, 0 for disabled)", "Global Preference", pref.ambience_freq, 60, 0)
if(isnull(ambience_new) || !CanUseTopic(user)) return TOPIC_NOACTION
if(ambience_new < 0 || ambience_new > 60) return TOPIC_NOACTION
pref.ambience_freq = ambience_new
return TOPIC_REFRESH
else if(href_list["select_ambience_chance"])
var/ambience_chance_new = input(user, "Input the chance you'd like to hear ambience played to you (On area change, or by random ambience). 35 means a 35% chance to play ambience. This is a range from 0-100. 0 disables ambience playing entirely. This is also affected by Ambience Frequency.", "Global Preference", pref.ambience_freq) as null|num
var/ambience_chance_new = tgui_input_number(user, "Input the chance you'd like to hear ambience played to you (On area change, or by random ambience). 35 means a 35% chance to play ambience. This is a range from 0-100. 0 disables ambience playing entirely. This is also affected by Ambience Frequency.", "Global Preference", pref.ambience_freq, 100, 0)
if(isnull(ambience_chance_new) || !CanUseTopic(user)) return TOPIC_NOACTION
if(ambience_chance_new < 0 || ambience_chance_new > 100) return TOPIC_NOACTION
pref.ambience_chance = ambience_chance_new
@@ -40,7 +40,7 @@
var/channel = href_list["change_volume"]
if(!(channel in pref.volume_channels))
pref.volume_channels["[channel]"] = 1
var/value = input(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100))
var/value = tgui_input_number(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0)
if(isnum(value))
value = CLAMP(value, 0, 200)
pref.volume_channels["[channel]"] = (value / 100)
@@ -33,7 +33,7 @@
/datum/category_item/player_setup_item/volume_sliders/media/OnTopic(var/href, var/list/href_list, var/mob/user)
if(href_list["change_media_volume"])
if(CanUseTopic(user))
var/value = input(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100))
var/value = tgui_input_number(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100), 100, 0)
if(isnum(value))
value = CLAMP(value, 0, 100)
pref.media_volume = value/100.0
@@ -58,7 +58,7 @@
/datum/category_item/player_setup_item/vore/size/OnTopic(var/href, var/list/href_list, var/mob/user)
if(href_list["size_multiplier"])
var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Set Size") as num|null
var/new_size = tgui_input_number(user, "Choose your character's size, ranging from 25% to 200%", "Set Size", null, 200, 25)
if (!ISINRANGE(new_size,25,200))
pref.size_multiplier = 1
to_chat(user, "<span class='notice'>Invalid size.</span>")
@@ -72,11 +72,11 @@
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["weight"])
var/new_weight = input(user, "Choose your character's relative body weight.\n\
var/new_weight = tgui_input_number(user, "Choose your character's relative body weight.\n\
This measurement should be set relative to a normal 5'10'' person's body and not the actual size of your character.\n\
If you set your weight to 500 because you're a naga or have metal implants then complain that you're a blob I\n\
swear to god I will find you and I will punch you for not reading these directions!\n\
([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference") as num|null
([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference", null, WEIGHT_MAX, WEIGHT_MIN)
if(new_weight)
var/unit_of_measurement = tgui_alert(user, "Is that number in pounds (lb) or kilograms (kg)?", "Confirmation", list("Pounds", "Kilograms"))
if(unit_of_measurement == "Pounds")