Adds TGUI say and TGUI input. (#17471)

* i alone am the honoured one

* THROUGHOUT HEAVEN AND EARTH I ALONE AM THE HONOURED ONE

* hollow point

* nanana

* ssss

* tgsay final touches

* stuff

* tgui inputs

* help

* carpal tunnel syndrome

* ffff

* again and again and again and again

* hehehehe

* dsada

* readd sanitize

* whoops

* dsad

* nah fuck that

* sd

* fix

* ow

* remove prefs for testmerging

* oops

* oops 2

* fix that

* f

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-10-11 23:26:59 +02:00
committed by GitHub
parent 518c843e00
commit 54dc8a0860
185 changed files with 2203 additions and 632 deletions

View File

@@ -341,21 +341,21 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["blood_type"])
var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in valid_bloodtypes
var/new_b_type = tgui_input_list(user, "Choose your character's blood-type:", "Character Preference", valid_bloodtypes)
if(new_b_type && CanUseTopic(user))
pref.b_type = new_b_type
return TOPIC_REFRESH
else if(href_list["show_species"])
// Actual whitelist checks are handled elsewhere, this is just for accessing the preview window.
var/species_choice = input(usr, "Which species would you like to look at?", "Species Selection") as null|anything in playable_species
var/species_choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Selection", playable_species)
if(!species_choice)
return
var/choice
if(length(playable_species[species_choice]) == 1)
choice = playable_species[species_choice][1]
else
choice = input(usr, "Which subspecies would you like to look at?", "Sub-species Selection") as null|anything in playable_species[species_choice]
choice = tgui_input_list(usr, "Which subspecies would you like to look at?", "Sub-species Selection", playable_species[species_choice])
if(!choice)
return
choice = html_decode(choice)
@@ -476,7 +476,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["hair_color"])
if(!has_flag(mob_species, HAS_HAIR_COLOR))
return TOPIC_NOACTION
var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference", rgb(pref.r_hair, pref.g_hair, pref.b_hair)) as color|null
var/new_hair = input(user, "Choose your character's hair colour.", "Character Preference", rgb(pref.r_hair, pref.g_hair, pref.b_hair)) as color|null
if(new_hair && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.r_hair = GetRedPart(new_hair)
pref.g_hair = GetGreenPart(new_hair)
@@ -486,7 +486,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["gradient_color"])
if(!has_flag(mob_species, HAS_HAIR_COLOR))
return TOPIC_NOACTION
var/new_grad = input(user, "Choose your character's secondary hair color:", "Character Preference", rgb(pref.r_grad, pref.g_grad, pref.b_grad)) as color|null
var/new_grad = input(user, "Choose your character's secondary hair color.", "Character Preference", rgb(pref.r_grad, pref.g_grad, pref.b_grad)) as color|null
if(new_grad && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.r_grad = GetRedPart(new_grad)
pref.g_grad = GetGreenPart(new_grad)
@@ -496,7 +496,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["tail_style"])
if(!length(mob_species.selectable_tails))
return
var/new_tail_style = input(user, "Choose your character's tail style:", "Character Preference", pref.tail_style) as null|anything in mob_species.selectable_tails
var/new_tail_style = tgui_input_list(user, "Choose your character's tail style:", "Character Preference", mob_species.selectable_tails, pref.tail_style)
if(new_tail_style && CanUseTopic(user))
pref.tail_style = new_tail_style
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -517,7 +517,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference", pref.h_style) as null|anything in valid_hairstyles
var/new_h_style = tgui_input_list(user, "Choose your character's hair style.", "Character Preference", valid_hairstyles, pref.h_style)
if(new_h_style && CanUseTopic(user))
pref.h_style = new_h_style
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -531,7 +531,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
valid_gradients[gradstyle] = hair_gradient_styles_list[gradstyle]
var/new_g_style = input(user, "Choose a color pattern for your hair:", "Character Preference", pref.g_style) as null|anything in valid_gradients
var/new_g_style = tgui_input_list(user, "Choose a color pattern for your hair.", "Character Preference", valid_gradients, pref.g_style)
if(new_g_style && CanUseTopic(user))
pref.g_style = new_g_style
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -539,7 +539,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["facial_color"])
if(!has_flag(mob_species, HAS_HAIR_COLOR))
return TOPIC_NOACTION
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", rgb(pref.r_facial, pref.g_facial, pref.b_facial)) as color|null
var/new_facial = input(user, "Choose your character's facial-hair colour.", "Character Preference", rgb(pref.r_facial, pref.g_facial, pref.b_facial)) as color|null
if(new_facial && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.r_facial = GetRedPart(new_facial)
pref.g_facial = GetGreenPart(new_facial)
@@ -549,7 +549,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["eye_color"])
if(!has_flag(mob_species, HAS_EYE_COLOR))
return TOPIC_NOACTION
var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", rgb(pref.r_eyes, pref.g_eyes, pref.b_eyes)) as color|null
var/new_eyes = input(user, "Choose your character's eye colour.", "Character Preference", rgb(pref.r_eyes, pref.g_eyes, pref.b_eyes)) as color|null
if(new_eyes && has_flag(mob_species, HAS_EYE_COLOR) && CanUseTopic(user))
pref.r_eyes = GetRedPart(new_eyes)
pref.g_eyes = GetGreenPart(new_eyes)
@@ -559,7 +559,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 30 - 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. (Light 30 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35, 220, 30)
if(new_s_tone && has_flag(mob_species, HAS_SKIN_TONE) && CanUseTopic(user))
pref.s_tone = 35 - max(min( round(new_s_tone), 220),30)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -568,7 +568,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(!has_flag(mob_species, HAS_SKIN_COLOR) && !has_flag(mob_species, HAS_SKIN_PRESET))
return TOPIC_NOACTION
if(has_flag(mob_species, HAS_SKIN_COLOR) && !has_flag(mob_species, HAS_SKIN_PRESET))
var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", rgb(pref.r_skin, pref.g_skin, pref.b_skin)) as color|null
var/new_skin = input(user, "Choose your character's skin colour.", "Character Preference", rgb(pref.r_skin, pref.g_skin, pref.b_skin)) as color|null
if(new_skin && has_flag(mob_species, HAS_SKIN_COLOR) && CanUseTopic(user))
pref.r_skin = GetRedPart(new_skin)
pref.g_skin = GetGreenPart(new_skin)
@@ -576,7 +576,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(has_flag(mob_species, HAS_SKIN_PRESET))
var/new_preset = input(user, "Choose your character's body color preset:", "Character Preference", rgb(pref.r_skin, pref.g_skin, pref.b_skin)) as null|anything in mob_species.character_color_presets
var/new_preset = tgui_input_list(user, "Choose your character's body color preset.", "Character Preference", mob_species.character_color_presets, rgb(pref.r_skin, pref.g_skin, pref.b_skin))
new_preset = mob_species.character_color_presets[new_preset]
pref.r_skin = GetRedPart(new_preset)
pref.g_skin = GetGreenPart(new_preset)
@@ -599,7 +599,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character Preference", pref.f_style) as null|anything in valid_facialhairstyles
var/new_f_style = tgui_input_list(user, "Choose your character's facial-hair style:", "Character Preference", valid_facialhairstyles, pref.f_style)
if(new_f_style && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.f_style = new_f_style
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -618,7 +618,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
alert(user, "This species does not have any body markings available.")
return TOPIC_NOACTION
var/new_marking = input(user, "Choose a body marking:", "Character Preference") as null|anything in usable_markings
var/new_marking = tgui_input_list(user, "Choose a body marking:", "Character Preference", usable_markings)
if(new_marking && CanUseTopic(user))
pref.body_markings[new_marking] = "#000000" //New markings start black
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -656,7 +656,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["limbs"])
var/list/acceptable_organ_input = list("Left Leg","Right Leg","Left Arm","Right Arm","Left Foot","Right Foot","Left Hand","Right Hand")
var/limb_name = input(user, "Which limb do you want to change?") as null|anything in acceptable_organ_input
var/limb_name = tgui_input_list(user, "Which limb do you want to change?", "Limbs", acceptable_organ_input)
if(!limb_name && !CanUseTopic(user)) return TOPIC_NOACTION
var/carries_organs = 0
@@ -704,7 +704,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/list/available_states = mob_species.possible_external_organs_modifications
if(carries_organs)
available_states = list("Normal","Prosthesis")
var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in available_states
var/new_state = tgui_input_list(user, "What state do you wish the limb to be in?", "Limbs", available_states)
if(!new_state && !CanUseTopic(user))
return TOPIC_NOACTION
@@ -733,7 +733,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
usable_manufacturers[company] = M
if(!usable_manufacturers.len)
return
var/choice = input(user, "Which manufacturer do you wish to use for this limb?") as null|anything in usable_manufacturers
var/choice = tgui_input_list(user, "Which manufacturer do you wish to use for this limb?", "Limb Manufacturer", usable_manufacturers)
if(!choice)
return
pref.rlimb_data[limb] = choice
@@ -756,7 +756,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["organs"])
if(!mob_species.alterable_internal_organs.len)
return
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in mob_species.alterable_internal_organs
var/organ_name = tgui_input_list(user, "Which internal function do you want to change?", "Alter Organs", mob_species.alterable_internal_organs)
if(!organ_name)
return
@@ -766,7 +766,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(!altered_organ)
return
var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in altered_organ.possible_modifications
var/new_state = tgui_input_list(user, "What state do you wish the organ to be in?", "Alter Organs", altered_organ.possible_modifications)
qdel(altered_organ)
@@ -788,7 +788,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
usable_manufacturers[company] = M
if(!usable_manufacturers.len)
return
var/choice = input(user, "Which manufacturer do you wish to use for this organ?") as null|anything in usable_manufacturers
var/choice = tgui_input_list(user, "Which manufacturer do you wish to use for this organ?", "Alter Organs", usable_manufacturers)
if(!choice)
return
@@ -814,7 +814,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["trait_add"])
var/list/available_disabilities = pref.disabilities ^ chargen_disabilities_list
var/new_trait = input(user, "Choose a disability:", "Character Preference") as null|anything in available_disabilities
var/new_trait = tgui_input_list(user, "Choose a disability.", "Character Preference", available_disabilities)
if(new_trait && CanUseTopic(user))
pref.disabilities += new_trait
return TOPIC_REFRESH_UPDATE_PREVIEW

View File

@@ -181,43 +181,43 @@
/datum/category_item/player_setup_item/general/equipment/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["change_backpack"])
var/new_backbag = input(user, "Choose your character's bag type:", "Character Preference", backbaglist[pref.backbag]) as null|anything in backbaglist
var/new_backbag = tgui_input_list(user, "Choose your character's bag type.", "Character Preference", backbaglist, backbaglist[pref.backbag])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag = backbaglist.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_backpack_style"])
var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference", backbagstyles[pref.backbag_style]) as null|anything in backbagstyles
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag.", "Character Preference", backbagstyles, backbagstyles[pref.backbag_style])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag_style = backbagstyles.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_backpack_color"])
var/new_backbag = input(user, "Choose your character's color of bag:", "Character Preference", backbagcolors[pref.backbag_color]) as null|anything in backbagcolors
var/new_backbag = tgui_input_list(user, "Choose your character's color of bag.", "Character Preference", backbagcolors, backbagcolors[pref.backbag_color])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag_color = backbagcolors.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_backbag_strap"])
var/new_backbag = input(user, "Choose your character's style of bag strap:", "Character Preference", backbagstrap[pref.backbag_strap]) as null|anything in backbagstrap
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag strap.", "Character Preference", backbagstrap, backbagstrap[pref.backbag_strap])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag_strap = backbagstrap.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_pda"])
var/new_pda = input(user, "Choose your character's PDA type:", "Character Preference", pdalist[pref.pda_choice]) as null|anything in pdalist
var/new_pda = tgui_input_list(user, "Choose your character's PDA type.", "Character Preference", pdalist, pdalist[pref.pda_choice])
if(!isnull(new_pda) && CanUseTopic(user))
pref.pda_choice = pdalist.Find(new_pda)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_headset"])
var/new_headset = input(user, "Choose your character's headset type:", "Character Preference", headsetlist[pref.headset_choice]) as null|anything in headsetlist
var/new_headset = tgui_input_list(user, "Choose your character's headset type.", "Character Preference", headsetlist, headsetlist[pref.headset_choice])
if(!isnull(new_headset) && CanUseTopic(user))
pref.headset_choice = headsetlist.Find(new_headset)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_radio_slot"])
var/new_slot = input(user, "Choose which radio will be spoken into first if multiple slots are occupied.", "Charcter Preference", pref.primary_radio_slot) as null|anything in primary_radio_slot_choice
var/new_slot = tgui_input_list(user, "Choose which radio will be spoken into first if multiple slots are occupied.", "Charcter Preference", primary_radio_slot_choice, pref.primary_radio_slot)
if(!isnull(new_slot) && CanUseTopic(user))
pref.primary_radio_slot = new_slot
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -226,7 +226,7 @@
var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[href_list["change_underwear"]]
if(!UWC)
return TOPIC_NOACTION
var/datum/category_item/underwear/selected_underwear = input(user, "Choose underwear:", "Character Preference", pref.all_underwear[UWC.name]) as null|anything in UWC.items
var/datum/category_item/underwear/selected_underwear = tgui_input_list(user, "Choose underwear:", "Character Preference", UWC.items, pref.all_underwear[UWC.name])
if(selected_underwear && CanUseTopic(user))
pref.all_underwear[UWC.name] = selected_underwear.name
return TOPIC_REFRESH_UPDATE_PREVIEW

View File

@@ -164,7 +164,7 @@
else if (href_list["edit_signature"])
switch (href_list["edit_signature"])
if ("text")
var/new_sign = input(usr, "Please input the new character signature.", "New signature", html2pencode(pref.signature)) as null|text
var/new_sign = tgui_input_text(usr, "Please input the new character signature.", "New Signature", html2pencode(pref.signature))
if (!new_sign)
to_chat(usr, SPAN_NOTICE("Cancelled."))
if (pref.signature)
@@ -178,7 +178,7 @@
return TOPIC_REFRESH
if ("font")
var/new_font = input(usr, "Please select the font to use.", "New font") as null|anything in list("Verdana", "Times New Roman", "Courier New")
var/new_font = tgui_input_list(usr, "Please select the font to use.", "New Font", list("Verdana", "Times New Roman", "Courier New"))
if (!new_font)
to_chat(usr, SPAN_NOTICE("Cancelled."))
if (pref.signfont)

View File

@@ -129,7 +129,7 @@
to_chat(user, SPAN_WARNING("You ran out of points!"))
return
var/new_power = input(user, "Choose a psionic power to add.", "Psionics") as null|anything in available_psionics
var/new_power = tgui_input_list(user, "Choose a psionic power to add.", "Psionics", available_psionics)
if(new_power)
var/singleton/psionic_power/P = GET_SINGLETON(psionic_map[new_power])
if(istype(P))

View File

@@ -3,22 +3,24 @@
sort_order = 1
/datum/category_item/player_setup_item/player_global/ui/load_preferences(var/savefile/S)
S["UI_style"] >> pref.UI_style
S["UI_style_color"] >> pref.UI_style_color
S["UI_style_alpha"] >> pref.UI_style_alpha
S["tgui_fancy"] >> pref.tgui_fancy
S["tgui_lock"] << pref.tgui_lock
S["ooccolor"] >> pref.ooccolor
S["clientfps"] >> pref.clientfps
S["UI_style"] >> pref.UI_style
S["UI_style_color"] >> pref.UI_style_color
S["UI_style_alpha"] >> pref.UI_style_alpha
S["tgui_fancy"] >> pref.tgui_fancy
S["tgui_lock"] >> pref.tgui_lock
S["ooccolor"] >> pref.ooccolor
S["clientfps"] >> pref.clientfps
S["tooltip_style"] >> pref.tooltip_style
/datum/category_item/player_setup_item/player_global/ui/save_preferences(var/savefile/S)
S["UI_style"] << pref.UI_style
S["UI_style_color"] << pref.UI_style_color
S["UI_style_alpha"] << pref.UI_style_alpha
S["tgui_fancy"] << pref.tgui_fancy
S["tgui_lock"] << pref.tgui_lock
S["ooccolor"] << pref.ooccolor
S["clientfps"] << pref.clientfps
S["UI_style"] << pref.UI_style
S["UI_style_color"] << pref.UI_style_color
S["UI_style_alpha"] << pref.UI_style_alpha
S["tgui_fancy"] << pref.tgui_fancy
S["tgui_lock"] << pref.tgui_lock
S["ooccolor"] << pref.ooccolor
S["clientfps"] << pref.clientfps
S["tooltip_style"] << pref.tooltip_style
/datum/category_item/player_setup_item/player_global/ui/gather_load_query()
return list(
@@ -69,13 +71,16 @@
)
/datum/category_item/player_setup_item/player_global/ui/sanitize_preferences()
pref.UI_style = sanitize_inlist(pref.UI_style, all_ui_styles, initial(pref.UI_style))
pref.UI_style = sanitize_inlist(pref.UI_style, all_ui_styles, initial(pref.UI_style))
pref.UI_style_color = sanitize_hexcolor(pref.UI_style_color, initial(pref.UI_style_color))
pref.UI_style_alpha = sanitize_integer(text2num(pref.UI_style_alpha), 0, 255, initial(pref.UI_style_alpha))
pref.clientfps = sanitize_integer(text2num(pref.clientfps), 0, 1000, initial(pref.clientfps))
pref.tgui_fancy = sanitize_bool(pref.tgui_fancy, TRUE)
pref.tgui_lock = sanitize_bool(pref.tgui_lock, FALSE)
pref.ooccolor = sanitize_hexcolor(pref.ooccolor, initial(pref.ooccolor))
pref.tgui_fancy = sanitize_bool(pref.tgui_fancy, TRUE)
pref.tgui_lock = sanitize_bool(pref.tgui_lock, FALSE)
pref.tgui_inputs = sanitize_bool(pref.tgui_inputs, TRUE)
pref.tgui_buttons_large = sanitize_bool(pref.tgui_buttons_large, FALSE)
pref.tgui_inputs_swapped = sanitize_bool(pref.tgui_inputs_swapped, FALSE)
pref.ooccolor = sanitize_hexcolor(pref.ooccolor, initial(pref.ooccolor))
/datum/category_item/player_setup_item/player_global/ui/content(mob/user)
var/list/dat = list()
@@ -87,6 +92,9 @@
dat += "<b>Tooltip Style:</b> <a href='?src=\ref[src];select_tooltip_style=1'><b>[pref.tooltip_style]</b></a><br>"
dat += "<b>TGUI Fancy:</b> <a href='?src=\ref[src];select_tguif=1'><b>[pref.tgui_fancy ? "ON" : "OFF"]</b></a><br>"
dat += "<b>TGUI Lock:</b> <a href='?src=\ref[src];select_tguil=1'><b>[pref.tgui_lock ? "ON" : "OFF"]</b></a><br>"
dat += "<b>TGUI Inputs:</b> <a href='?src=\ref[src];tgui_inputs=1'><b>[pref.tgui_inputs ? "ON" : "OFF"]</b></a><br>"
dat += "<b>TGUI Input Large Buttons:</b> <a href='?src=\ref[src];tgui_inputs_large=1'><b>[pref.tgui_buttons_large ? "ON" : "OFF"]</b></a><br>"
dat += "<b>TGUI Input Swapped Buttons:</b> <a href='?src=\ref[src];tgui_inputs_swapped=1'><b>[pref.tgui_inputs_swapped ? "ON" : "OFF"]</b></a><br>"
dat += "<b>FPS:</b> <a href='?src=\ref[src];select_fps=1'><b>[pref.clientfps]</b></a> - <a href='?src=\ref[src];reset=fps'>reset</a><br>"
if(can_select_ooc_color(user))
dat += "<b>OOC Color:</b> "
@@ -124,6 +132,18 @@
pref.tgui_lock = !pref.tgui_lock
return TOPIC_REFRESH
else if(href_list["tgui_inputs"])
pref.tgui_inputs = !pref.tgui_inputs
return TOPIC_REFRESH
else if(href_list["tgui_inputs_large"])
pref.tgui_buttons_large = !pref.tgui_buttons_large
return TOPIC_REFRESH
else if(href_list["tgui_inputs_swapped"])
pref.tgui_inputs_swapped = !pref.tgui_inputs_swapped
return TOPIC_REFRESH
else if(href_list["select_ooc_color"])
var/new_ooccolor = input(user, "Choose OOC color:", "Global Preference") as color|null
if(new_ooccolor && can_select_ooc_color(user) && CanUseTopic(user))

View File

@@ -142,7 +142,7 @@ Path adjustment
return pick(valid_paths)
/datum/gear_tweak/path/get_metadata(var/user, var/metadata)
return input(user, "Choose a type.", "Character Preference", metadata) as null|anything in valid_paths
return tgui_input_list(user, "Choose a type.", "Character Preference", valid_paths, metadata)
/datum/gear_tweak/path/tweak_gear_data(var/metadata, var/datum/gear_data/gear_data)
if(!(metadata in valid_paths))

View File

@@ -128,7 +128,7 @@
for(var/decl_type in possible_cultures)
var/singleton/origin_item/culture/CL = possible_cultures[decl_type]
options[CL.name] = CL
var/result = input(user, "Choose your character's culture.", "Culture") as null|anything in options
var/result = tgui_input_list(user, "Choose your character's culture.", "Culture", options)
var/singleton/origin_item/culture/chosen_culture = options[result]
if(chosen_culture)
show_window(chosen_culture, "set_culture_data", user)
@@ -141,7 +141,7 @@
for(var/decl_type in origins_list)
var/singleton/origin_item/origin/OR = origins_list[decl_type]
options[OR.name] = OR
var/result = input(user, "Choose your character's origin.", "Origins") as null|anything in options
var/result = tgui_input_list(user, "Choose your character's origin.", "Origins", options)
var/singleton/origin_item/origin/chosen_origin = options[result]
if(chosen_origin)
show_window(chosen_origin, "set_origin_data", user)
@@ -160,14 +160,14 @@
return TOPIC_REFRESH
if(href_list["economic_status"])
var/new_status = input(user, "Choose how wealthy your character is. Note that this applies a multiplier to a value that is also affected by your species and job.", "Character Preference", pref.economic_status) as null|anything in ECONOMIC_POSITIONS
var/new_status = tgui_input_list(user, "Choose how wealthy your character is. Note that this applies a multiplier to a value that is also affected by your species and job.", "Character Preference", ECONOMIC_POSITIONS, pref.economic_status)
if(new_status && CanUseTopic(user))
pref.economic_status = new_status
return TOPIC_REFRESH
if(href_list["citizenship"])
var/singleton/origin_item/origin/our_origin = GET_SINGLETON(text2path(pref.origin))
var/choice = input(user, "Please choose your current citizenship.", "Character Preference", pref.citizenship) as null|anything in our_origin.possible_citizenships
var/choice = tgui_input_list(user, "Please choose your current citizenship.", "Character Preference", our_origin.possible_citizenships, pref.citizenship)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
show_citizenship_menu(user, choice)
@@ -181,7 +181,7 @@
if(href_list["religion"])
var/singleton/origin_item/origin/our_origin = GET_SINGLETON(text2path(pref.origin))
var/choice = input(user, "Please choose a religion.", "Character Preference", pref.religion) as null|anything in our_origin.possible_religions
var/choice = tgui_input_list(user, "Please choose a religion.", "Character Preference", our_origin.possible_religions, pref.religion)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
show_religion_menu(user, choice)
@@ -195,7 +195,7 @@
if(href_list["accent"])
var/singleton/origin_item/origin/our_origin = GET_SINGLETON(text2path(pref.origin))
var/choice = input(user, "Please choose an accent.", "Character Preference", pref.accent) as null|anything in our_origin.possible_accents
var/choice = tgui_input_list(user, "Please choose an accent.", "Character Preference", our_origin.possible_accents, pref.accent)
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
show_accent_menu(user, choice)