Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert input lists to tgui #761

Merged
merged 2 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions modular_ss220/agent_id_tgui/code/agent_id_tgui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,46 +225,46 @@
"Custom",
)

var/department = input(registered_human, "What job would you like to put on this card?\nChoose a department or a custom job title.\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in departments
var/department = tgui_input_list(registered_human, "What job would you like to put on this card?\nChoose a department or a custom job title.\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", departments)
var/new_job = "Civilian"
var/new_rank = "Civilian"

if(department == "Custom")
new_job = sanitize(stripped_input(registered_human,"Choose a custom job title:","Agent Card Occupation", "Civilian", MAX_MESSAGE_LEN))
var/department_icon = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in departments
var/department_icon = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", departments)
switch(department_icon)
if("Engineering")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.engineering_positions
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.engineering_positions)
if("Medical")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.medical_positions
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.medical_positions)
if("Science")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.science_positions
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.science_positions)
if("Security")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.security_positions
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.security_positions)
if("Support")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.support_positions
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.support_positions)
if("Command")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.command_positions
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.command_positions)
if("Special")
new_rank = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in (get_all_solgov_jobs() + get_all_soviet_jobs() + get_all_centcom_jobs())
new_rank = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", (get_all_solgov_jobs() + get_all_soviet_jobs() + get_all_centcom_jobs()))
if("Custom")
new_rank = null
else if(department != "Civilian")
switch(department)
if("Engineering")
new_job = input(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.engineering_positions
new_job = tgui_input_list(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.engineering_positions)
if("Medical")
new_job = input(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.medical_positions
new_job = tgui_input_list(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.medical_positions)
if("Science")
new_job = input(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.science_positions
new_job = tgui_input_list(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.science_positions)
if("Security")
new_job = input(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.security_positions
new_job = tgui_input_list(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.security_positions)
if("Support")
new_job = input(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.support_positions
new_job = tgui_input_list(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.support_positions)
if("Command")
new_job = input(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.command_positions
new_job = tgui_input_list(registered_human, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", GLOB.command_positions)
if("Special")
new_job = input(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in (get_all_solgov_jobs() + get_all_soviet_jobs() + get_all_centcom_jobs())
new_job = tgui_input_list(registered_human, "What job would you like to be shown on this card (for SecHUDs)?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation", (get_all_solgov_jobs() + get_all_soviet_jobs() + get_all_centcom_jobs()))
new_rank = new_job

if(!Adjacent(registered_human))
Expand Down
8 changes: 4 additions & 4 deletions modular_ss220/clothing/code/shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
var/glow_active = FALSE
var/brightness_on = 2

/obj/item/clothing/shoes/black/neon/attack_self(mob/living/user as mob)
var/choice = input(user,"Neon shoes options") in list("Turn glow","Change Color")
/obj/item/clothing/shoes/black/neon/attack_self(mob/living/user)
var/choice = tgui_input_list(user, "Что вы хотите сделать?", "Неоновые кросовки", list("Переключить подсветку", "Сменить цвет"))
switch(choice)
if("Turn glow")
if("Переключить подсветку")
turn_glow()
if("Change color")
if("Сменить цвет")
change_color()

/obj/item/clothing/shoes/black/neon/update_icon_state()
Expand Down
2 changes: 1 addition & 1 deletion modular_ss220/detective_rework/code/swabs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
else if(choices.len == 1)
choice = choices[1]
else
choice = input("Какие доказательства вы ищете?","Сбор доказательств") as null|anything in choices
choice = tgui_input_list(user, "Какие доказательства вы ищете?", "Сбор доказательств", choices)

if(!choice)
inuse = FALSE
Expand Down
4 changes: 2 additions & 2 deletions modular_ss220/maps220/code/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
return

insisting = FALSE
var/wish = input("Вы хотите...","Желание") as null|anything in list("Сила", "Богатство", "Бессмертие", "Покой")
var/wish = tgui_input_list("Вы хотите...", "Желание", list("Силу", "Богатство", "Бессмертие", "Покой"))
if(!wish)
return
charges--
Expand All @@ -46,7 +46,7 @@
var/become_shadow = TRUE
var/list/output = list()
switch(wish)
if("Сила")
if("Силу")
for(var/mutation_type in power_mutations)
var/datum/mutation/mutation = GLOB.dna_mutations[mutation_type]
mutation.activate(human)
Expand Down
4 changes: 2 additions & 2 deletions modular_ss220/objects/code/card_skins.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@
color = color_list[pick(color_list)]

/obj/item/id_skin/colored/attack_self(mob/living)
var/choice = input(usr, "Какой цвет предпочитаете?", "Выбор цвета") as null|anything in list("Выбрать предустановленный", "Выбрать вручную")
var/choice = tgui_input_list(usr, "Какой цвет предпочитаете?", "Выбор цвета", list("Выбрать предустановленный", "Выбрать вручную"))
if(!choice)
return
switch(choice)
if("Выбрать предустановленный")
choice = input(usr, "Выберите цвет", "Выбор цвета") as null|anything in color_list
choice = tgui_input_list(usr, "Выберите цвет", "Выбор цвета", color_list)
var/color_to_set = color_list[choice]
if(!color_to_set)
return
Expand Down
2 changes: 1 addition & 1 deletion modular_ss220/text_to_speech/code/tts_seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
else
tts_seeds = SStts220.get_available_seeds(src)

var/new_tts_seed = input(user || src, "Choose your preferred voice:", "Character Preference", tts_seed) as null|anything in tts_seeds
var/new_tts_seed = tgui_input_list(user || src, "Выберите голос:", "Настройка персонажа", tts_seeds)
if(!new_tts_seed)
return null
if(!silent_target && ismob(src) && src != user)
Expand Down
Loading