mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
The One Where I Port Modals
This commit is contained in:
@@ -111,13 +111,13 @@
|
||||
return TOPIC_NOACTION
|
||||
|
||||
else if(href_list["bio_gender"])
|
||||
var/new_gender = input(user, "Choose your character's biological sex:", "Character Preference", pref.biological_gender) as null|anything in get_genders()
|
||||
var/new_gender = tgui_input_list(user, "Choose your character's biological sex:", "Character Preference", get_genders(), pref.biological_gender)
|
||||
if(new_gender && CanUseTopic(user))
|
||||
pref.set_biological_gender(new_gender)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["id_gender"])
|
||||
var/new_gender = input(user, "Choose your character's pronouns:", "Character Preference", pref.identifying_gender) as null|anything in all_genders_define_list
|
||||
var/new_gender = tgui_input_list(user, "Choose your character's pronouns:", "Character Preference", all_genders_define_list, pref.identifying_gender)
|
||||
if(new_gender && CanUseTopic(user))
|
||||
pref.identifying_gender = new_gender
|
||||
return TOPIC_REFRESH
|
||||
@@ -134,7 +134,7 @@
|
||||
var/list/spawnkeys = list()
|
||||
for(var/spawntype in spawntypes)
|
||||
spawnkeys += spawntype
|
||||
var/choice = input(user, "Where would you like to spawn when late-joining?") as null|anything in spawnkeys
|
||||
var/choice = tgui_input_list(user, "Where would you like to spawn when late-joining?", "Late-Join Choice", spawnkeys)
|
||||
if(!choice || !spawntypes[choice] || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
pref.spawnpoint = choice
|
||||
return TOPIC_REFRESH
|
||||
|
||||
@@ -69,8 +69,16 @@
|
||||
return TOPIC_REFRESH
|
||||
else if(href_list["add_language"])
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
<<<<<<< HEAD
|
||||
if(pref.alternate_languages.len >= pref.numlanguage()) //CHOMPEdit
|
||||
alert(user, "You have already selected the maximum number of alternate languages for this species!")
|
||||
||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
if(pref.alternate_languages.len >= S.num_alternate_languages)
|
||||
alert(user, "You have already selected the maximum number of alternate languages for this species!")
|
||||
=======
|
||||
if(pref.alternate_languages.len >= S.num_alternate_languages)
|
||||
tgui_alert_async(user, "You have already selected the maximum number of alternate languages for this species!")
|
||||
>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
else
|
||||
var/list/available_languages = S.secondary_langs.Copy()
|
||||
for(var/L in GLOB.all_languages)
|
||||
@@ -84,10 +92,18 @@
|
||||
available_languages -= pref.alternate_languages
|
||||
|
||||
if(!available_languages.len)
|
||||
alert(user, "There are no additional languages available to select.")
|
||||
tgui_alert_async(user, "There are no additional languages available to select.")
|
||||
else
|
||||
<<<<<<< HEAD
|
||||
var/new_lang = input(user, "Select an additional language", "Character Generation", null) as null|anything in available_languages
|
||||
if(new_lang && pref.alternate_languages.len < pref.numlanguage()) //CHOMPEdit
|
||||
||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
var/new_lang = input(user, "Select an additional language", "Character Generation", null) as null|anything in available_languages
|
||||
if(new_lang && pref.alternate_languages.len < S.num_alternate_languages)
|
||||
=======
|
||||
var/new_lang = tgui_input_list(user, "Select an additional language", "Character Generation", available_languages)
|
||||
if(new_lang && pref.alternate_languages.len < S.num_alternate_languages)
|
||||
>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
pref.alternate_languages |= new_lang
|
||||
return TOPIC_REFRESH
|
||||
|
||||
@@ -95,16 +111,16 @@
|
||||
var/char
|
||||
var/keys[0]
|
||||
do
|
||||
char = input("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 = 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
|
||||
if(char)
|
||||
if(length(char) > 1)
|
||||
alert(user, "Only single characters allowed.", "Error", "Ok")
|
||||
tgui_alert_async(user, "Only single characters allowed.", "Error")
|
||||
else if(char in list(";", ":", "."))
|
||||
alert(user, "Radio character. Rejected.", "Error", "Ok")
|
||||
tgui_alert_async(user, "Radio character. Rejected.", "Error")
|
||||
else if(char in list("!","*","^","-"))
|
||||
alert(user, "Say character. Rejected.", "Error", "Ok")
|
||||
tgui_alert_async(user, "Say character. Rejected.", "Error")
|
||||
else if(contains_az09(char))
|
||||
alert(user, "Non-special character. Rejected.", "Error", "Ok")
|
||||
tgui_alert_async(user, "Non-special character. Rejected.", "Error")
|
||||
else
|
||||
keys.Add(char)
|
||||
while(char && keys.len < 3)
|
||||
|
||||
@@ -653,20 +653,20 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/desc_id = href_list["change_descriptor"]
|
||||
if(pref.body_descriptors[desc_id])
|
||||
var/datum/mob_descriptor/descriptor = mob_species.descriptors[desc_id]
|
||||
var/choice = input("Please select a descriptor.", "Descriptor") as null|anything in descriptor.chargen_value_descriptors
|
||||
var/choice = tgui_input_list(usr, "Please select a descriptor.", "Descriptor", descriptor.chargen_value_descriptors)
|
||||
if(choice && mob_species.descriptors[desc_id]) // Check in case they sneakily changed species.
|
||||
pref.body_descriptors[desc_id] = descriptor.chargen_value_descriptors[choice]
|
||||
return TOPIC_REFRESH
|
||||
|
||||
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/choice = input("Which species would you like to look at?") as null|anything in GLOB.playable_species
|
||||
var/choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Choice", GLOB.playable_species)
|
||||
if(!choice) return
|
||||
pref.species_preview = choice
|
||||
SetSpecies(preference_mob())
|
||||
@@ -765,7 +765,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(href_list["hair_style"])
|
||||
var/list/valid_hairstyles = pref.get_valid_hairstyles()
|
||||
|
||||
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
|
||||
@@ -781,7 +781,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(href_list["grad_style"])
|
||||
var/list/valid_gradients = GLOB.hair_gradients
|
||||
|
||||
var/new_grad_style = input(user, "Choose a color pattern for your hair:", "Character Preference", pref.grad_style) as null|anything in valid_gradients
|
||||
var/new_grad_style = tgui_input_list(user, "Choose a color pattern for your hair:", "Character Preference", valid_gradients, pref.grad_style)
|
||||
if(new_grad_style && CanUseTopic(user))
|
||||
pref.grad_style = new_grad_style
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
@@ -849,7 +849,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(href_list["facial_style"])
|
||||
var/list/valid_facialhairstyles = pref.get_valid_facialhairstyles()
|
||||
|
||||
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
|
||||
@@ -886,7 +886,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(!(pref.species in S.species_allowed))
|
||||
usable_markings -= M
|
||||
*/ //VOREStation Removal End
|
||||
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
|
||||
@@ -916,7 +916,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
if(start != 1)
|
||||
move_locs -= pref.body_markings[start-1]
|
||||
|
||||
var/inject_after = input(user, "Move [M] ahead of...", "Character Preference") as null|anything in move_locs //Move ahead of any marking that isn't the current or previous one.
|
||||
var/inject_after = tgui_input_list(user, "Move [M] ahead of...", "Character Preference", move_locs) //Move ahead of any marking that isn't the current or previous one.
|
||||
var/newpos = pref.body_markings.Find(inject_after)
|
||||
if(newpos)
|
||||
moveElement(pref.body_markings, start, newpos+1)
|
||||
@@ -949,7 +949,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(pref.organ_data[BP_TORSO] == "cyborg")
|
||||
limb_selection_list |= "Head"
|
||||
|
||||
var/organ_tag = input(user, "Which limb do you want to change?") as null|anything in limb_selection_list
|
||||
var/organ_tag = tgui_input_list(user, "Which limb do you want to change?", "Limb Choice", limb_selection_list)
|
||||
|
||||
if(!organ_tag || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
|
||||
@@ -993,7 +993,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
third_limb = BP_GROIN
|
||||
choice_options = list("Normal","Prosthesis")
|
||||
|
||||
var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in choice_options
|
||||
var/new_state = tgui_input_list(user, "What state do you wish the limb to be in?", "State Choice", choice_options)
|
||||
if(!new_state || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
|
||||
switch(new_state)
|
||||
@@ -1036,7 +1036,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?", "Manufacturer Choice", usable_manufacturers)
|
||||
if(!choice)
|
||||
return
|
||||
|
||||
@@ -1064,7 +1064,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
else if(href_list["organs"])
|
||||
|
||||
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes","Larynx", "Lungs", "Liver", "Kidneys", "Spleen", "Intestines", "Stomach", "Brain")
|
||||
var/organ_name = tgui_input_list(user, "Which internal function do you want to change?", "Internal Organ", list("Heart", "Eyes", "Larynx", "Lungs", "Liver", "Kidneys", "Spleen", "Intestines", "Stomach", "Brain"))
|
||||
if(!organ_name) return
|
||||
|
||||
var/organ = null
|
||||
@@ -1110,7 +1110,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
organ_choices += "Assisted"
|
||||
organ_choices += "Mechanical"
|
||||
|
||||
var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in organ_choices
|
||||
var/new_state = tgui_input_list(user, "What state do you wish the organ to be in?", "State Choice", organ_choices)
|
||||
if(!new_state) return
|
||||
|
||||
switch(new_state)
|
||||
@@ -1191,7 +1191,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
//YW Add End
|
||||
|
||||
else if(href_list["ear_style"])
|
||||
var/new_ear_style = input(user, "Select an ear style for this character:", "Character Preference", pref.ear_style) as null|anything in pref.get_available_styles(global.ear_styles_list)
|
||||
var/new_ear_style = tgui_input_list(user, "Select an ear style for this character:", "Character Preference", pref.get_available_styles(global.ear_styles_list), pref.ear_style)
|
||||
if(new_ear_style)
|
||||
pref.ear_style = new_ear_style
|
||||
|
||||
@@ -1225,7 +1225,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["tail_style"])
|
||||
var/new_tail_style = input(user, "Select a tail style for this character:", "Character Preference", pref.tail_style) as null|anything in pref.get_available_styles(global.tail_styles_list)
|
||||
var/new_tail_style = tgui_input_list(user, "Select a tail style for this character:", "Character Preference", pref.get_available_styles(global.tail_styles_list), pref.tail_style)
|
||||
if(new_tail_style)
|
||||
pref.tail_style = new_tail_style
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
@@ -1258,7 +1258,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["wing_style"])
|
||||
var/new_wing_style = input(user, "Select a wing style for this character:", "Character Preference", pref.wing_style) as null|anything in pref.get_available_styles(global.wing_styles_list)
|
||||
var/new_wing_style = tgui_input_list(user, "Select a wing style for this character:", "Character Preference", pref.get_available_styles(global.wing_styles_list), pref.wing_style)
|
||||
if(new_wing_style)
|
||||
pref.wing_style = new_wing_style
|
||||
|
||||
|
||||
@@ -115,13 +115,13 @@
|
||||
|
||||
/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 style of bag:", "Character Preference", backbaglist[pref.backbag]) as null|anything in backbaglist
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag:", "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_pda"])
|
||||
var/new_pdachoice = input(user, "Choose your character's style of PDA:", "Character Preference", pdachoicelist[pref.pdachoice]) as null|anything in pdachoicelist
|
||||
var/new_pdachoice = tgui_input_list(user, "Choose your character's style of PDA:", "Character Preference", pdachoicelist, pdachoicelist[pref.pdachoice])
|
||||
if(!isnull(new_pdachoice) && CanUseTopic(user))
|
||||
pref.pdachoice = pdachoicelist.Find(new_pdachoice)
|
||||
return TOPIC_REFRESH
|
||||
@@ -130,7 +130,7 @@
|
||||
var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[href_list["change_underwear"]]
|
||||
if(!UWC)
|
||||
return
|
||||
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
|
||||
|
||||
@@ -61,13 +61,13 @@
|
||||
|
||||
/datum/category_item/player_setup_item/general/background/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
if(href_list["econ_status"])
|
||||
var/new_class = input(user, "Choose your economic status. This will affect the amount of money you will start with.", "Character Preference", pref.economic_status) as null|anything in ECONOMIC_CLASS
|
||||
var/new_class = tgui_input_list(user, "Choose your economic status. This will affect the amount of money you will start with.", "Character Preference", ECONOMIC_CLASS, pref.economic_status)
|
||||
if(new_class && CanUseTopic(user))
|
||||
pref.economic_status = new_class
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["home_system"])
|
||||
var/choice = input(user, "Please choose a home system.", "Character Preference", pref.home_system) as null|anything in home_system_choices + list("Unset","Other")
|
||||
var/choice = tgui_input_list(user, "Please choose a home system.", "Character Preference", home_system_choices + list("Unset","Other"), pref.home_system)
|
||||
if(!choice || !CanUseTopic(user))
|
||||
return TOPIC_NOACTION
|
||||
if(choice == "Other")
|
||||
@@ -79,7 +79,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["citizenship"])
|
||||
var/choice = input(user, "Please choose your current citizenship.", "Character Preference", pref.citizenship) as null|anything in citizenship_choices + list("None","Other")
|
||||
var/choice = tgui_input_list(user, "Please choose your current citizenship.", "Character Preference", citizenship_choices + list("None","Other"), pref.citizenship)
|
||||
if(!choice || !CanUseTopic(user))
|
||||
return TOPIC_NOACTION
|
||||
if(choice == "Other")
|
||||
@@ -91,7 +91,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["faction"])
|
||||
var/choice = input(user, "Please choose a faction to work for.", "Character Preference", pref.faction) as null|anything in faction_choices + list("None","Other")
|
||||
var/choice = tgui_input_list(user, "Please choose a faction to work for.", "Character Preference", faction_choices + list("None","Other"), pref.faction)
|
||||
if(!choice || !CanUseTopic(user))
|
||||
return TOPIC_NOACTION
|
||||
if(choice == "Other")
|
||||
@@ -103,7 +103,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["religion"])
|
||||
var/choice = input(user, "Please choose a religion.", "Character Preference", pref.religion) as null|anything in religion_choices + list("None","Other")
|
||||
var/choice = tgui_input_list(user, "Please choose a religion.", "Character Preference", religion_choices + list("None","Other"), pref.religion)
|
||||
if(!choice || !CanUseTopic(user))
|
||||
return TOPIC_NOACTION
|
||||
if(choice == "Other")
|
||||
|
||||
Reference in New Issue
Block a user