diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm
index 50c0013e260..c8e61d767ed 100644
--- a/code/__DEFINES/preferences.dm
+++ b/code/__DEFINES/preferences.dm
@@ -56,8 +56,9 @@
// Yes I know this being an "enable to disable" is misleading, but it avoids having to tweak all existing pref entries
#define PREFTOGGLE_2_REVERB_DISABLE 1024
#define PREFTOGGLE_2_MC_TABS 2048
+#define PREFTOGGLE_2_DISABLE_TGUI_LISTS 4096
-#define TOGGLES_2_TOTAL 4095 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
+#define TOGGLES_2_TOTAL 8191 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCYUI|PREFTOGGLE_2_ITEMATTACK|PREFTOGGLE_2_WINDOWFLASHING|PREFTOGGLE_2_RUNECHAT|PREFTOGGLE_2_DEATHMESSAGE|PREFTOGGLE_2_SEE_ITEM_OUTLINES)
diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm
index 63e4319117c..d8df7909030 100644
--- a/code/__HELPERS/type2type.dm
+++ b/code/__HELPERS/type2type.dm
@@ -277,6 +277,8 @@ GLOBAL_LIST_INIT(modulo_angle_to_dir, list(NORTH,NORTHEAST,EAST,SOUTHEAST,SOUTH,
return 'icons/mob/screen_operative.dmi'
if("White")
return 'icons/mob/screen_white.dmi'
+ if("Midnight")
+ return 'icons/mob/screen_midnight.dmi'
else
return 'icons/mob/screen_midnight.dmi'
diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm
index 63783a04467..578a10ea732 100644
--- a/code/_onclick/hud/ai.dm
+++ b/code/_onclick/hud/ai.dm
@@ -16,7 +16,7 @@
/obj/screen/ai/camera_list/Click()
var/mob/living/silicon/ai/AI = usr
- var/camera = input(AI, "Choose which camera you want to view", "Cameras") as null|anything in AI.get_camera_list()
+ var/camera = tgui_input_list(AI, "Choose which camera you want to view", "Cameras", AI.get_camera_list())
AI.ai_camera_list(camera)
/obj/screen/ai/camera_track
@@ -26,7 +26,7 @@
/obj/screen/ai/camera_track/Click()
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
- var/target_name = input(AI) as null|anything in AI.trackable_mobs()
+ var/target_name = tgui_input_list(AI, "Choose which camera you want to view", "Cameras", AI.trackable_mobs())
if(target_name)
AI.ai_camera_track(target_name)
diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm
index 3546785a2cf..81819dec6a4 100644
--- a/code/controllers/subsystem/events.dm
+++ b/code/controllers/subsystem/events.dm
@@ -251,7 +251,7 @@ SUBSYSTEM_DEF(events)
var/datum/event_meta/EM = locate(href_list["set_name"])
EM.name = name
else if(href_list["set_type"])
- var/type = input("Select event type.", "Select") as null|anything in allEvents
+ var/type = tgui_input_list(usr, "Select event type.", "Select", allEvents)
if(type)
var/datum/event_meta/EM = locate(href_list["set_type"])
EM.event_type = type
diff --git a/code/controllers/subsystem/non-firing/titlescreen.dm b/code/controllers/subsystem/non-firing/titlescreen.dm
index aae8b40053a..c12dd90526e 100644
--- a/code/controllers/subsystem/non-firing/titlescreen.dm
+++ b/code/controllers/subsystem/non-firing/titlescreen.dm
@@ -40,7 +40,7 @@ SUBSYSTEM_DEF(title)
var/choice
if(user)
- choice = input(user, "Choose new title screen", "Available Screens:") as null|anything in title_screens
+ choice = tgui_input_list(user, "Choose new title screen", "Available Screens:", title_screens)
if(!choice)
return FALSE
else
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index 476696cd160..3191d873d02 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -645,7 +645,7 @@
var/datum/martial_art/M = i
artnames[initial(M.name)] = M
- var/result = input(usr, "Choose the martial art to teach", "JUDO CHOP") as null|anything in artnames
+ var/result = tgui_input_list(usr, "Choose the martial art to teach", "JUDO CHOP", artnames)
if(!usr)
return
if(QDELETED(C))
@@ -677,7 +677,7 @@
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob/living")
return
- var/selected_job = input("Select a job", "Hud Job Selection") as null|anything in GLOB.all_taipan_jobs
+ var/selected_job = tgui_input_list(usr, "Select a job", "Hud Job Selection", GLOB.all_taipan_jobs)
if(!selected_job)
to_chat(usr, "No job selected!")
@@ -916,7 +916,7 @@
if(!valid_id)
to_chat(usr, "A reagent with that ID doesn't exist!")
if("Choose ID")
- chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_options
+ chosen_id = tgui_input_list(usr, "Choose a reagent to add.", "Choose a reagent.", reagent_options)
if(chosen_id)
var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num
if(amount)
@@ -1083,7 +1083,10 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
- var/new_species = input("Please choose a new species.","Species",null) as null|anything in GLOB.all_species
+ var/new_species = tgui_input_list(usr, "Please choose a new species.","Species", GLOB.all_species)
+
+ if(!new_species)
+ return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
@@ -1105,7 +1108,7 @@
to_chat(usr, "This can only be done to instances of type /mob")
return
- var/new_language = input("Please choose a language to add.","Language",null) as null|anything in GLOB.all_languages
+ var/new_language = tgui_input_list(usr, "Please choose a language to add.","Language", GLOB.all_languages)
if(!new_language)
return
@@ -1132,7 +1135,7 @@
to_chat(usr, "This mob knows no languages.")
return
- var/datum/language/rem_language = input("Please choose a language to remove.","Language",null) as null|anything in H.languages
+ var/datum/language/rem_language = tgui_input_list(usr, "Please choose a language to remove.","Language", H.languages)
if(!rem_language)
return
@@ -1218,7 +1221,7 @@
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob")
return
- var/verb = input("Please choose a verb to remove.","Verbs",null) as null|anything in H.verbs
+ var/verb = tgui_input_list(usr, "Please choose a verb to remove.","Verbs", H.verbs)
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -1236,7 +1239,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
- var/new_organ = input("Please choose an organ to add.","Organ",null) as null|anything in subtypesof(/obj/item/organ)-/obj/item/organ
+ var/new_organ = tgui_input_list(usr, "Please choose an organ to add.","Organ", subtypesof(/obj/item/organ)-/obj/item/organ)
if(!new_organ) return
if(!M)
@@ -1258,7 +1261,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
- var/obj/item/organ/internal/rem_organ = input("Please choose an organ to remove.","Organ",null) as null|anything in M.internal_organs
+ var/obj/item/organ/internal/rem_organ = tgui_input_list(usr, "Please choose an organ to remove.", "Organ", M.internal_organs)
if(!M)
to_chat(usr, "Mob doesn't exist anymore")
diff --git a/code/datums/emote/emote_verbs.dm b/code/datums/emote/emote_verbs.dm
index ff950f281e7..421ed81b600 100644
--- a/code/datums/emote/emote_verbs.dm
+++ b/code/datums/emote/emote_verbs.dm
@@ -381,7 +381,7 @@
var/fingers_count = src.dna?.species?.fingers_count
for(var/i = 1, i <= fingers_count, i++)
fingers += i
- var/cnt = input("Руки должны быть свободны", "Показать несколько пальцев", 1) as null|anything in fingers
+ var/cnt = tgui_input_list(src, "Руки должны быть свободны", "Показать несколько пальцев", fingers, default = 1)
if(!cnt)
return
emote("signal-[cnt]")
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index be9958667e9..f6decab8d05 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -849,7 +849,7 @@
return
if(href_list["role_edit"])
- var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in GLOB.joblist
+ var/new_role = tgui_input_list(usr, "Select new role", "Assigned role", GLOB.joblist)
if(!new_role)
return
assigned_role = new_role
@@ -937,7 +937,7 @@
// Кастомная цель//
"custom")
- var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in objective_types
+ var/new_obj_type = tgui_input_list(usr, "Select objective type:", "Objective type", objective_types)
if(!new_obj_type)
return
@@ -1019,7 +1019,7 @@
if("destroy")
var/list/possible_targets = active_ais(1)
if(possible_targets.len)
- var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets
+ var/mob/new_target = tgui_input_list(usr, "Select target:", "Objective target", possible_targets)
new_objective = new /datum/objective/destroy
new_objective.target = new_target.mind
new_objective.owner = src
@@ -1058,7 +1058,7 @@
var/list/roles = scan_objective.available_roles.Copy()
if(alert(usr, "Do you want to pick roles yourself? No will randomise it", "Pick roles", "Yes", "No") == "Yes")
for(var/i in 1 to 3)
- var/role = input("Select role:", "Objective role") as null|anything in roles
+ var/role = tgui_input_list(usr, "Select role:", "Objective role", roles)
if(role)
roles -= role
scan_objective.possible_roles += role
diff --git a/code/datums/spell_targeting/matter_eater_targeting.dm b/code/datums/spell_targeting/matter_eater_targeting.dm
index e4fa8e51e6f..390da08c300 100644
--- a/code/datums/spell_targeting/matter_eater_targeting.dm
+++ b/code/datums/spell_targeting/matter_eater_targeting.dm
@@ -41,7 +41,7 @@
continue
possible_targets += O
- var/atom/movable/target = input("Choose the target of your hunger.", "Targeting") as null|anything in possible_targets
+ var/atom/movable/target = tgui_input_list(user, "Choose the target of your hunger", "Targeting", possible_targets)
if(QDELETED(target))
return
diff --git a/code/datums/spell_targeting/remoteview_targeting.dm b/code/datums/spell_targeting/remoteview_targeting.dm
index 5855f027946..8760a15632e 100644
--- a/code/datums/spell_targeting/remoteview_targeting.dm
+++ b/code/datums/spell_targeting/remoteview_targeting.dm
@@ -17,7 +17,7 @@
if(!length(remoteviewers))
return
- var/mob/target = input("Choose the target to spy on.", "Targeting") as null|anything in remoteviewers
+ var/mob/target = tgui_input_list(user, "Choose the target to spy on", "Targeting", remoteviewers)
if(QDELETED(target))
return
diff --git a/code/datums/spell_targeting/targeted.dm b/code/datums/spell_targeting/targeted.dm
index 2da4ebbe7b7..e37aee76471 100644
--- a/code/datums/spell_targeting/targeted.dm
+++ b/code/datums/spell_targeting/targeted.dm
@@ -26,7 +26,7 @@
else if(max_targets == 1) // Only one target
var/atom/target
if(!random_target)
- target = input("Choose the target for the spell.", "Targeting") as anything in possible_targets
+ target = tgui_input_list(user, "Choose the target for the spell", "Targeting", possible_targets)
//Adds a safety check post-input to make sure those targets are actually in range.
if(target in view_or_range(range, spell_location, selection_type))
targets += target
diff --git a/code/datums/spell_targeting/telepathic.dm b/code/datums/spell_targeting/telepathic.dm
index 4871395c342..c681881614f 100644
--- a/code/datums/spell_targeting/telepathic.dm
+++ b/code/datums/spell_targeting/telepathic.dm
@@ -29,7 +29,7 @@
if(!length(valid_targets))
return
- var/target_name = input("Choose the target to listen to.", "Targeting") as null|anything in valid_targets
+ var/target_name = tgui_input_list(user, "Choose the target to listen to.", "Targeting", valid_targets)
var/mob/living/target = valid_targets[target_name]
if(QDELETED(target))
diff --git a/code/datums/spells/area_teleport.dm b/code/datums/spells/area_teleport.dm
index e8dc1e93a53..49d8dcf4bbb 100644
--- a/code/datums/spells/area_teleport.dm
+++ b/code/datums/spells/area_teleport.dm
@@ -21,7 +21,7 @@
var/A
if(!randomise_selection)
- A = input("Area to teleport to", "Teleport", A) as null|anything in GLOB.teleportlocs
+ A = tgui_input_list(user, "Area to teleport to", "Teleport", GLOB.teleportlocs)
else
A = pick(GLOB.teleportlocs)
diff --git a/code/datums/spells/mimic.dm b/code/datums/spells/mimic.dm
index 79fa65c9ed4..2a6ba9263c1 100644
--- a/code/datums/spells/mimic.dm
+++ b/code/datums/spells/mimic.dm
@@ -101,7 +101,7 @@
forms += "Original Form"
forms += available_forms.Copy()
- var/what = input(user, "Which form do you want to become?", "Mimic") as null|anything in forms
+ var/what = tgui_input_list(user, "Which form do you want to become?", "Mimic", forms)
if(!what)
to_chat(user, span_notice("You decide against changing forms."))
revert_cast(user)
diff --git a/code/datums/spells/shapeshift.dm b/code/datums/spells/shapeshift.dm
index 17ae2311ace..f22e7e19425 100644
--- a/code/datums/spells/shapeshift.dm
+++ b/code/datums/spells/shapeshift.dm
@@ -40,7 +40,7 @@
for(var/path in possible_shapes)
var/mob/living/simple_animal/A = path
animal_list[initial(A.name)] = path
- shapeshift_type = input(M, "Choose Your Animal Form!", "It's Morphing Time!", null) as anything in animal_list
+ shapeshift_type = tgui_input_list(M, "Choose Your Animal Form!", "It's Morphing Time!", animal_list)
if(!shapeshift_type) //If you aren't gonna decide I am!
shapeshift_type = pick(animal_list)
shapeshift_type = animal_list[shapeshift_type]
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 894c395b2c0..893945460d9 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -988,9 +988,9 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
else
tts_seeds = SStts.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, "Choose your preferred voice:", "Character Preference", tts_seeds, tts_seed)
if(!new_tts_seed)
- return null
+ new_tts_seed = tts_seed
if(!silent_target && ismob(src) && src != user)
INVOKE_ASYNC(GLOBAL_PROC, /proc/tts_cast, null, src, tts_test_str, new_tts_seed, FALSE)
if(user)
diff --git a/code/game/gamemodes/clockwork/clockwork_items.dm b/code/game/gamemodes/clockwork/clockwork_items.dm
index f26d2a32d52..bb970d49bce 100644
--- a/code/game/gamemodes/clockwork/clockwork_items.dm
+++ b/code/game/gamemodes/clockwork/clockwork_items.dm
@@ -91,7 +91,7 @@
to_chat(user, "You are not in the right dimension!")
return
- var/selected_altar = input(user, "Pick a credence teleport to...", "Teleporation") as null|anything in possible_altars
+ var/selected_altar = tgui_input_list(user, "Pick a credence teleport to...", "Teleporation", possible_altars)
if(!selected_altar)
return
var/turf/destination = possible_altars[selected_altar]
diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm
index e4c4e3ef793..6746aada31f 100644
--- a/code/game/gamemodes/cult/blood_magic.dm
+++ b/code/game/gamemodes/cult/blood_magic.dm
@@ -51,7 +51,7 @@
possible_spells[cult_name] = J
if(length(spells))
possible_spells += "(REMOVE SPELL)"
- entered_spell_name = input(owner, "Pick a blood spell to prepare...", "Spell Choices") as null|anything in possible_spells
+ entered_spell_name = tgui_input_list(owner, "Pick a blood spell to prepare...", "Spell Choices", possible_spells)
if(entered_spell_name == "(REMOVE SPELL)")
remove_spell()
return
@@ -80,7 +80,7 @@
channeling = FALSE
/datum/action/innate/cult/blood_magic/proc/remove_spell(message = "Pick a spell to remove.")
- var/nullify_spell = input(owner, message, "Current Spells") as null|anything in spells
+ var/nullify_spell = tgui_input_list(owner, message, "Current Spells", spells)
if(nullify_spell)
qdel(nullify_spell)
@@ -488,7 +488,7 @@
return
var/mob/living/L = target
- var/input_rune_key = input(user, "Choose a rune to teleport to.", "Rune to Teleport to") as null|anything in potential_runes //we know what key they picked
+ var/input_rune_key = tgui_input_list(user, "Choose a rune to teleport to.", "Rune to Teleport to", potential_runes) //we know what key they picked
var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to?
if(!src || QDELETED(src) || !user || user.l_hand != src && user.r_hand != src || user.incapacitated() || !actual_selected_rune)
return
@@ -846,7 +846,7 @@
/obj/item/melee/blood_magic/manipulator/attack_self(mob/living/user)
var/list/options = list("Blood Orb (50)", "Blood Recharge (75)", "Blood Spear (150)", "Blood Bolt Barrage (300)")
- var/choice = input(user, "Choose a greater blood rite...", "Greater Blood Rites") as null|anything in options
+ var/choice = tgui_input_list(user, "Choose a greater blood rite...", "Greater Blood Rites", options)
if(!Adjacent(user))
to_chat(user, "Вы не можете использовать это заклинание без самого заклинания!")
return
diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm
index 513d43a9c28..4dcc53f700b 100644
--- a/code/game/gamemodes/cult/ritual.dm
+++ b/code/game/gamemodes/cult/ritual.dm
@@ -110,7 +110,7 @@
if(!length(possible_runes))
return
- var/chosen_rune = input(user, "Choose a rite to scribe.", "Sigils of Power") as null|anything in possible_runes
+ var/chosen_rune = tgui_input_list(user, "Choose a rite to scribe", "Sigils of Power", possible_runes)
if(!chosen_rune)
return
var/obj/effect/rune/rune = possible_runes[chosen_rune]
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index 02f3c47f824..54d0e6c2bdc 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -455,7 +455,7 @@ structure_check() searches for nearby cultist structures required for the invoca
fail_invoke()
return
- var/input_rune_key = input(user, "Choose a rune to teleport to.", "Rune to Teleport to") as null|anything in potential_runes //we know what key they picked
+ var/input_rune_key = tgui_input_list(user, "Choose a rune to teleport to.", "Rune to Teleport to", potential_runes) //we know what key they picked
var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to?
if(!src || !Adjacent(user) || QDELETED(src) || user.incapacitated() || !actual_selected_rune)
fail_invoke()
@@ -575,7 +575,7 @@ structure_check() searches for nearby cultist structures required for the invoca
fail_invoke()
return
if(length(potential_revive_mobs) > 1)
- mob_to_revive = input(user, "Choose a cultist to revive.", "Cultist to Revive") as null|anything in potential_revive_mobs
+ mob_to_revive = tgui_input_list(user, "Choose a cultist to revive", "Cultist to Revive", potential_revive_mobs)
else // If there's only one, no need for a menu
mob_to_revive = potential_revive_mobs[1]
if(!validness_checks(mob_to_revive, user))
@@ -686,7 +686,7 @@ structure_check() searches for nearby cultist structures required for the invoca
for(var/datum/mind/M in SSticker.mode.cult)
if(!(M.current in invokers) && M.current && M.current.stat != DEAD)
cultists[M.current.real_name] = M.current
- var/input = input(user, "Who do you wish to call to [src]?", "Acolytes") as null|anything in cultists
+ var/input = tgui_input_list(user, "Who do you wish to call to [src]?", "Acolytes", cultists)
var/mob/living/cultist_to_summon = cultists[input]
if(!src || QDELETED(src) || !Adjacent(user) || user.incapacitated())
return
diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm
index a9f7d8f2454..4a5e730d357 100644
--- a/code/game/gamemodes/miniantags/borer/borer.dm
+++ b/code/game/gamemodes/miniantags/borer/borer.dm
@@ -324,7 +324,7 @@
if(H.stat != DEAD && Adjacent(H) && !H.has_brain_worms())
choices += H
- var/mob/living/carbon/human/M = input(src,"Who do you wish to infest?") in null|choices
+ var/mob/living/carbon/human/M = tgui_input_list(src,"Who do you wish to infest?", "Infest", choices)
if(!M || !src)
return
@@ -513,7 +513,7 @@
attempting_to_dominate = TRUE
- var/mob/living/carbon/M = input(src,"Who do you wish to dominate?") in null|choices
+ var/mob/living/carbon/M = tgui_input_list(src,"Who do you wish to dominate?", "Dominate", choices)
if(!M)
attempting_to_dominate = FALSE
diff --git a/code/game/gamemodes/miniantags/demons/demon.dm b/code/game/gamemodes/miniantags/demons/demon.dm
index f41f308bb8d..180f31325a5 100644
--- a/code/game/gamemodes/miniantags/demons/demon.dm
+++ b/code/game/gamemodes/miniantags/demons/demon.dm
@@ -68,7 +68,7 @@
to_chat(usr, span_warning("There are no valid targets!"))
return
- var/mob/living/target = input("Choose the target to talk to.", "Targeting") as null|mob in validtargets
+ var/mob/living/target = tgui_input_list(user, "Choose the target to talk to", "Targeting", validtargets)
return target
diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm
index bbf3f75d8ee..019162d024e 100644
--- a/code/game/gamemodes/miniantags/guardian/guardian.dm
+++ b/code/game/gamemodes/miniantags/guardian/guardian.dm
@@ -271,7 +271,7 @@
picked_random_type = pick(possible_guardians)
guardian_type = picked_random_type
else
- guardian_type = input(user, "Выберите тип [mob_name]", "Создание [mob_name] ") as null|anything in possible_guardians
+ guardian_type = tgui_input_list(user, "Выберите тип [mob_name]", "Создание [mob_name] ", possible_guardians)
if(!guardian_type)
to_chat(user, span_warning("Вы решили не использовать [name]."))
used = FALSE
diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm
index 9521f1d4c92..bb69b9dfbe3 100644
--- a/code/game/gamemodes/nuclear/pinpointer.dm
+++ b/code/game/gamemodes/nuclear/pinpointer.dm
@@ -227,7 +227,7 @@
var/name = initial(T.name)
item_names += name
item_paths[name] = initial(T.typepath)
- var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in item_names
+ var/targetitem = tgui_input_list(user, "Select item to search for.", "Select Item", item_names)
if(!targetitem)
return
@@ -447,7 +447,7 @@
user.visible_message("[user]'s pinpointer fails to detect a signal.", "Your pinpointer fails to detect a signal.")
return
- var/A = input(user, "Person to track", "Pinpoint") in names
+ var/A = tgui_input_list(user, "Person to track", "Pinpoint", names)
if(!src || !user || (user.get_active_hand() != src) || user.incapacitated() || !A)
return
@@ -604,7 +604,7 @@
target_names |= thief_name
target_paths[thief_name] = temp_target
- var/choosen_target = input("[input_ask], типа \"[input_type][input_subtype]\"", "[input_tittle]: [input_type][input_subtype]","") as null|anything in target_names
+ var/choosen_target = tgui_input_list(user, "[input_ask], типа \"[input_type][input_subtype]\"", "[input_tittle]: [input_type][input_subtype]", target_names)
if(!choosen_target)
return
@@ -647,7 +647,7 @@
target_names |= thief_name
target_paths[thief_name] = temp_target
- var/choosen_target = input("Выберите интересующую вас цель:", "Режим Выбора Цели","") as null|anything in target_names
+ var/choosen_target = tgui_input_list(user, "Выберите интересующую вас цель:", "Режим Выбора Цели", target_names)
if(!choosen_target)
return
diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm
index 857e6f5351b..a057c9e3385 100644
--- a/code/game/gamemodes/wizard/artefact.dm
+++ b/code/game/gamemodes/wizard/artefact.dm
@@ -708,7 +708,7 @@ GLOBAL_LIST_EMPTY(multiverse)
/obj/item/voodoo/attack_self(mob/user as mob)
if(!target && possible.len)
- target = input(user, "Select your victim!", "Voodoo") as null|anything in possible
+ target = tgui_input_list(user, "Select your victim!", "Voodoo", possible)
return
if(user.zone_selected == BODY_ZONE_CHEST)
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index e11b57a368e..6106b24cebc 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -467,7 +467,7 @@
if(I.GetID())
if(allowed(user))
user.visible_message(span_notice("\the [user] waves [user.p_their()] ID past the [src]'s access protocol scanner."), span_notice("You swipe your ID past the [src]'s access protocol scanner."))
- var/console_choice = input(user, "What do you want to configure the access to?", "Access Modification", "R&D Core") as null|anything in access_types
+ var/console_choice = tgui_input_list(user, "What do you want to configure the access to?", "Access Modification", access_types)
if(!console_choice)
return
switch(console_choice)
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index e5920f21f12..925c02cabe1 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -194,7 +194,7 @@
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
- var/direction = input(user, "Which direction?", "Select direction!") as null|anything in list("North", "East", "South", "West", "Centre")
+ var/direction = tgui_input_list(user, "Which direction?", "Select direction!", list("North", "East", "South", "West", "Centre"))
if(!direction || !Adjacent(user))
return
pixel_x = 0
diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm
index efa8fda4841..19cd3110b46 100644
--- a/code/game/machinery/computer/camera_advanced.dm
+++ b/code/game/machinery/computer/camera_advanced.dm
@@ -208,7 +208,7 @@
playsound(origin, 'sound/machines/terminal_prompt.ogg', 25, 0)
- var/camera = input("Choose which camera you want to view", "Cameras") as null|anything in T
+ var/camera = tgui_input_list(target, "Choose which camera you want to view", "Cameras", T)
var/obj/machinery/camera/final = T[camera]
playsound(origin, "terminal_type", 25, 0)
if(final)
diff --git a/code/game/machinery/computer/depot.dm b/code/game/machinery/computer/depot.dm
index 2aaab2b18bf..c37b9370947 100644
--- a/code/game/machinery/computer/depot.dm
+++ b/code/game/machinery/computer/depot.dm
@@ -473,7 +473,7 @@
else
areaindex[tmpname] = 1
L[tmpname] = R
- var/desc = input("Please select a location to lock in.", "Syndicate Teleporter") in L
+ var/desc = tgui_input_list(usr, "Please select a location to lock in.", "Syndicate Teleporter", L)
if(usr == last_opener && world.time >= last_opened_time + timeout)
return FALSE
return(L[desc])
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 464f10d9554..9b15bb63787 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -298,7 +298,7 @@ to destroy them and players will be able to make replacements.
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
- var/choice = input(user, "Choose a new brand", "Select an Item") as null|anything in vending_names_paths
+ var/choice = tgui_input_list(user, "Choose a new brand", "Select an Item", vending_names_paths)
if(!choice)
return
set_type(choice)
@@ -574,7 +574,7 @@ to destroy them and players will be able to make replacements.
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
- var/choice = input(user, "Circuit Setting", "What would you change the board setting to?") as null|anything in fridge_names_paths
+ var/choice = tgui_input_list(user, "Circuit Setting", "What would you change the board setting to?", fridge_names_paths)
if(!choice)
return
set_type(user, choice)
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 988b253c302..b3377f2a613 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -217,7 +217,7 @@ GLOBAL_LIST_EMPTY(holopads)
callnames -= get_area(src)
var/list/sorted_callnames = sortAtom(callnames)
dialling_input = TRUE
- var/result = input(usr, "Choose an area to call", "Holocall") as null|anything in sorted_callnames
+ var/result = tgui_input_list(usr, "Choose an area to call", "Holocall", sorted_callnames)
dialling_input = FALSE
if(QDELETED(usr) || !result || outgoing_call)
return
diff --git a/code/game/machinery/tcomms/core.dm b/code/game/machinery/tcomms/core.dm
index 49b3fce94c7..dd4dfc20237 100644
--- a/code/game/machinery/tcomms/core.dm
+++ b/code/game/machinery/tcomms/core.dm
@@ -252,7 +252,7 @@
// Job Format
if("nttc_job_indicator_type")
- var/card_style = input(usr, "Pick a job card format.", "Job Card Format") as null|anything in nttc.job_card_styles
+ var/card_style = tgui_input_list(usr, "Pick a job card format", "Job Card Format", nttc.job_card_styles)
if(!card_style)
return
nttc.job_indicator_type = card_style
@@ -261,7 +261,7 @@
// Language Settings
if("nttc_setting_language")
- var/new_language = input(usr, "Pick a language to convert messages to.", "Language Conversion") as null|anything in nttc.valid_languages
+ var/new_language = tgui_input_list(usr, "Pick a language to convert messages to", "Language Conversion", nttc.valid_languages)
if(!new_language)
return
if(new_language == "--DISABLE--")
diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm
index 79adc97fa32..be78d808e08 100644
--- a/code/game/machinery/wishgranter.dm
+++ b/code/game/machinery/wishgranter.dm
@@ -70,7 +70,7 @@
if(types.len == 1)
wish = pick(types)
else
- wish = input("You want to become...", "Wish") as null|anything in types
+ wish = tgui_input_list(user, "You want to become...", "Wish", types)
if(!wish || user.stat == DEAD || (get_dist(src, user) > 4)) // Another check after the input to check if someone already used it, closed it, or if they're dead, or if they ran off.
return
diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm
index deeb4b8ac0c..e5609f04b45 100644
--- a/code/game/objects/items/cardboard_cutouts.dm
+++ b/code/game/objects/items/cardboard_cutouts.dm
@@ -80,7 +80,7 @@
if(pushed_over)
to_chat(user, "Right [src] first!")
return
- var/new_appearance = input(user, "Choose a new appearance for [src].", "26th Century Deception") as null|anything in possible_appearances
+ var/new_appearance = tgui_input_list(user, "Choose a new appearance for [src]", "26th Century Deception", possible_appearances)
if(!Adjacent(usr))
user.visible_message("You need to be closer!")
return
diff --git a/code/game/objects/items/devices/airlock_painter.dm b/code/game/objects/items/devices/airlock_painter.dm
index 35979fde479..cefdd2695e4 100644
--- a/code/game/objects/items/devices/airlock_painter.dm
+++ b/code/game/objects/items/devices/airlock_painter.dm
@@ -38,7 +38,7 @@
return TRUE
/obj/item/airlock_painter/attack_self(mob/user)
- paint_setting = input(user, "Please select a paintjob for this airlock.") as null|anything in available_paint_jobs
+ paint_setting = tgui_input_list(user, "Please select a paintjob for this airlock", "Airlock painter", available_paint_jobs)
if(!paint_setting)
return
to_chat(user, "The [paint_setting] paint setting has been selected.")
diff --git a/code/game/objects/items/devices/enginepicker.dm b/code/game/objects/items/devices/enginepicker.dm
index 0fd3a591560..c41dbeef86f 100644
--- a/code/game/objects/items/devices/enginepicker.dm
+++ b/code/game/objects/items/devices/enginepicker.dm
@@ -28,8 +28,7 @@
return
locatebeacons()
- var/default = null
- var/E = input("Select the station's Engine:", "[src]", default) as null|anything in list_enginebeacons
+ var/E = tgui_input_list(user, "Select the station's Engine:", "[src]", list_enginebeacons)
if(E)
processchoice(E, user)
else
@@ -51,8 +50,7 @@
var/turf/T = get_turf(choice)
if(choice.enginetype.len > 1) //If the beacon has multiple engine types
- var/default = null
- var/E = input("You have selected a combined beacon, which option would you prefer?", "[src]", default) as null|anything in choice.enginetype
+ var/E = tgui_input_list(user, "You have selected a combined beacon, which option would you prefer?", "[src]", choice.enginetype)
if(E)
engtype = E
issuccessful = TRUE
diff --git a/code/game/objects/items/devices/pipe_painter.dm b/code/game/objects/items/devices/pipe_painter.dm
index 5fb3f3dc597..57746677b8e 100644
--- a/code/game/objects/items/devices/pipe_painter.dm
+++ b/code/game/objects/items/devices/pipe_painter.dm
@@ -33,7 +33,10 @@
/obj/item/pipe_painter/attack_self(mob/user as mob)
- mode = input("Which colour do you want to use?", name, mode) in modes
+ var/new_paint_setting = tgui_input_list(user, "Which color do you want to use?", "Pick color", modes)
+ if(!new_paint_setting)
+ return
+ mode = new_paint_setting
/obj/item/pipe_painter/examine(mob/user)
. = ..()
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 2acb0aeec7b..cfd9dcdf352 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -24,7 +24,7 @@
name = "robot [initial(name)]"
/obj/item/robot_parts/attack_self(mob/user)
- var/choice = input(user, "Select the company appearance for this limb.", "Limb Company Selection") as null|anything in GLOB.selectable_robolimbs
+ var/choice = tgui_input_list(user, "Select the company appearance for this limb", "Limb Company Selection", GLOB.selectable_robolimbs)
if(!choice)
return
if(loc != user)
diff --git a/code/game/objects/items/weapons/scissors.dm b/code/game/objects/items/weapons/scissors.dm
index 3af41b22c0c..b4208c9ec2b 100644
--- a/code/game/objects/items/weapons/scissors.dm
+++ b/code/game/objects/items/weapons/scissors.dm
@@ -31,9 +31,9 @@
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/C = H.get_organ(BODY_ZONE_HEAD)
//facial hair
- var/f_new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in H.generate_valid_facial_hairstyles()
+ var/f_new_style = tgui_input_list(user, "Select a facial hair style", "Grooming", H.generate_valid_facial_hairstyles())
//handle normal hair
- var/h_new_style = input(user, "Select a hair style", "Grooming") as null|anything in H.generate_valid_hairstyles()
+ var/h_new_style = tgui_input_list(user, "Select a hair style", "Grooming", H.generate_valid_hairstyles())
user.visible_message("[user] starts cutting [M]'s hair!", "You start cutting [M]'s hair!") //arguments for this are: 1. what others see 2. what the user sees. --Fixed grammar, (TGameCo)
playsound(loc, 'sound/goonstation/misc/scissor.ogg', 100, 1)
if(do_after(user, 50 * toolspeed * gettoolspeedmod(user), target = H)) //this is the part that adds a delay. delay is in deciseconds. --Made it 5 seconds, because hair isn't cut in one second in real life, and I want at least a little bit longer time, (TGameCo)
diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm
index a0f0f66ccb5..5bf4a0cce3c 100644
--- a/code/game/objects/items/weapons/scrolls.dm
+++ b/code/game/objects/items/weapons/scrolls.dm
@@ -47,7 +47,7 @@
var/A
- A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in GLOB.teleportlocs
+ A = tgui_input_list(user, "Area to jump to", "BOOYEA", GLOB.teleportlocs)
if(!A)
return
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 2b131c61675..f07c412fd44 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -774,7 +774,7 @@
to_chat(user, "You can't modify [src] with items still inside!")
return
var/list/designs = list(NODESIGN, NANOTRASEN, SYNDI, HEART, SMILE)
- var/switchDesign = input("Select a Design:", "Paper Sack Design", designs[1]) as null|anything in designs
+ var/switchDesign = tgui_input_list(user, "Select a Design:", "Paper Sack Design", designs)
if(!switchDesign)
return
if(get_dist(usr, src) > 1 && !usr.incapacitated())
diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm
index db3266d75b1..579510fe494 100644
--- a/code/game/objects/items/weapons/teleportation.dm
+++ b/code/game/objects/items/weapons/teleportation.dm
@@ -131,7 +131,7 @@ Frequency:
turfs += T
if(turfs.len)
L["None (Dangerous)"] = pick(turfs)
- var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") as null|anything in L
+ var/t1 = tgui_input_list(user, "Please select a teleporter to lock in on.", "Hand Teleporter", L)
if(!t1 || (!user.is_in_active_hand(src) || user.stat || user.restrained()))
return
if(active_portals >= 3)
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index ee0a7f61ee3..c71ec0075d7 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -124,7 +124,7 @@
req_access = list(ACCESS_SYNDICATE)
/obj/structure/sign/barsign/proc/pick_sign()
- var/picked_name = input("Available Signage", "Bar Sign") as null|anything in barsigns
+ var/picked_name = tgui_input_list(usr, "Available Signage", "Bar Sign", barsigns)
if(!picked_name)
return
set_sign(picked_name)
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index 8b727d0cf67..448e51d9949 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -83,10 +83,10 @@
if(can.capped)
to_chat(user, span_warning("You need to toggle cap off before repainting."))
return
- var/decalselection = input("Please select a decal") as null|anything in list("Atmospherics", "Bartender", "Barber", "Blueshield", "Brig Physician", "Captain",
+ var/decalselection = tgui_input_list(user, "Please select a decal", "Paint box", list("Atmospherics", "Bartender", "Barber", "Blueshield", "Brig Physician", "Captain",
"Cargo", "Chief Engineer", "Chaplain", "Chef", "Chemist", "Civilian", "Clown", "CMO", "Coroner", "Detective", "Engineering", "Genetics", "HOP",
"HOS", "Hydroponics", "Internal Affairs Agent", "Janitor", "Magistrate", "Mechanic", "Medical", "Mime", "Mining", "NT Representative", "Paramedic", "Pod Pilot",
- "Prisoner", "Research Director", "Security", "Syndicate", "Therapist", "Virology", "Warden", "Xenobiology")
+ "Prisoner", "Research Director", "Security", "Syndicate", "Therapist", "Virology", "Warden", "Xenobiology"))
if(!decalselection)
return
if(user.incapacitated())
diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm
index 5a96e2149c4..5fcd58bb734 100644
--- a/code/game/objects/structures/dresser.dm
+++ b/code/game/objects/structures/dresser.dm
@@ -12,7 +12,7 @@
if(ishuman(user) && anchored)
var/mob/living/carbon/human/H = user
- var/choice = input(user, "Underwear, Undershirt, or Socks?", "Changing") as null|anything in list("Underwear","Undershirt","Socks")
+ var/choice = tgui_input_list(user, "Underwear, Undershirt, or Socks?", "Changing", list("Underwear","Undershirt","Socks"))
if(!Adjacent(user))
return
@@ -24,7 +24,7 @@
if(!(H.dna.species.name in S.species_allowed))
continue
valid_underwear[underwear] = GLOB.underwear_list[underwear]
- var/new_underwear = input(user, "Choose your underwear:", "Changing") as null|anything in valid_underwear
+ var/new_underwear = tgui_input_list(user, "Choose your underwear:", "Changing", valid_underwear)
if(new_underwear)
var/datum/sprite_accessory/underwear/uwear = GLOB.underwear_list[new_underwear]
if(uwear.allow_change_color)
@@ -39,7 +39,7 @@
if(!(H.dna.species.name in S.species_allowed))
continue
valid_undershirts[undershirt] = GLOB.undershirt_list[undershirt]
- var/new_undershirt = input(user, "Choose your undershirt:", "Changing") as null|anything in valid_undershirts
+ var/new_undershirt = tgui_input_list(user, "Choose your undershirt:", "Changing", valid_undershirts)
if(new_undershirt)
var/datum/sprite_accessory/undershirt/ushirt = GLOB.undershirt_list[new_undershirt]
if(ushirt.allow_change_color)
@@ -54,7 +54,7 @@
if(!(H.dna.species.name in S.species_allowed))
continue
valid_sockstyles[sockstyle] = GLOB.socks_list[sockstyle]
- var/new_socks = input(user, "Choose your socks:", "Changing") as null|anything in valid_sockstyles
+ var/new_socks = tgui_input_list(user, "Choose your socks:", "Changing", valid_sockstyles)
if(new_socks)
H.socks = new_socks
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index f1b9abebe0a..f69dc79ffae 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -123,7 +123,7 @@
return
var/mob/living/carbon/human/H = user
- var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("Name", "Body", "Voice")
+ var/choice = tgui_input_list(user, "Something to change?", "Magical Grooming", list("Name", "Body", "Voice"))
add_fingerprint(user)
@@ -162,7 +162,7 @@
AC.ui_interact(user)
if("Voice")
- var/voice_choice = input(user, "Perhaps...", "Voice effects") as null|anything in list("Comic Sans", "Wingdings", "Swedish", "Староимперский", "Mute")
+ var/voice_choice = tgui_input_list(user, "Perhaps...", "Voice effects", list("Comic Sans", "Wingdings", "Swedish", "Староимперский", "Mute"))
var/voice_mutation
switch(voice_choice)
if("Comic Sans")
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 82934cd6bf5..d0769b4cd0a 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -144,7 +144,7 @@
choices += "Connect"
choices += "Rotate"
- var/response = input(user, "What do you want to do?", "[src]") as null|anything in choices
+ var/response = tgui_input_list(user, "What do you want to do?", "[src]", choices)
if(!Adjacent(user) || !response) //moved away or cancelled
return
switch(response)
@@ -592,7 +592,7 @@
if(can_rotate)
choices += "Rotate"
- var/response = input(user, "What do you want to do?", "[src]") as null|anything in choices
+ var/response = tgui_input_list(user, "What do you want to do?", "[src]", choices)
if(!Adjacent(user) || !response) //moved away or cancelled
return
switch(response)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 8f5720b83ad..b42a8241613 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -563,7 +563,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
btypes += "Human Protector"
btypes += "Sentient Pet"
btypes += "All Access"
- var/blessing = input(usr, "How would you like to bless [M]?", "Its good to be good...", "") as null|anything in btypes
+ var/blessing = tgui_input_list(usr, "How would you like to bless [M]?", "Its good to be good...", btypes)
if(!(blessing in btypes))
return
var/logmsg = null
@@ -703,7 +703,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
ptypes += "Dust"
ptypes += "Shitcurity Goblin"
ptypes += "High RP"
- var/punishment = input("How would you like to smite [M]?", "Its good to be baaaad...", "") as null|anything in ptypes
+ var/punishment = tgui_input_list(usr, "How would you like to smite [M]?", "Its good to be baaaad...", ptypes)
if(!(punishment in ptypes))
return
var/logmsg = null
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index aa794413fb9..f8d6d060fe6 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -2528,7 +2528,7 @@
P = new /obj/item/paper(null)
if(!fax)
var/list/departmentoptions = GLOB.alldepartments + GLOB.hidden_departments + "All Departments"
- destination = input(usr, "To which department?", "Choose a department", "") as null|anything in departmentoptions
+ destination = tgui_input_list(usr, "To which department?", "Choose a department", departmentoptions)
if(!destination)
qdel(P)
return
diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm
index 9b4ca28bceb..6675ece71d7 100644
--- a/code/modules/admin/verbs/adminjump.dm
+++ b/code/modules/admin/verbs/adminjump.dm
@@ -7,22 +7,22 @@
if(!check_rights(R_ADMIN))
return
- var/chosen = input(src, null, "Jump to...") as null|anything in choices
+ var/chosen = tgui_input_list(src, null, "Jump to...", choices)
if(!chosen)
return
var/jumping // Thing to jump to
switch(chosen)
if("Area")
- jumping = input(src, "Area to jump to", "Jump to Area") as null|anything in return_sorted_areas()
+ jumping = tgui_input_list(src, "Area to jump to", "Jump to Area", return_sorted_areas())
if(jumping)
return jumptoarea(jumping)
if("Mob")
- jumping = input(src, "Mob to jump to", "Jump to Mob") as null|anything in GLOB.mob_list
+ jumping = tgui_input_list(src, "Mob to jump to", "Jump to Mob", GLOB.mob_list)
if(jumping)
return jumptomob(jumping)
if("Key")
- jumping = input(src, "Key to jump to", "Jump to Key") as null|anything in sortKey(GLOB.clients)
+ jumping = tgui_input_list(src, "Key to jump to", "Jump to Key", sortKey(GLOB.clients))
if(jumping)
return jumptokey(jumping)
if("Coordinates")
@@ -160,7 +160,7 @@
var/list/keys = list()
for(var/mob/M in GLOB.player_list)
keys += M.client
- var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys)
+ var/selection = tgui_input_list(src, "Please, select a player!", "Admin Jumping", sortKey(keys))
if(!selection)
return
var/mob/M = selection:mob
@@ -183,7 +183,7 @@
if(!check_rights(R_ADMIN))
return
- var/area/A = input(usr, "Pick an area.", "Pick an area") as null|anything in return_sorted_areas()
+ var/area/A = tgui_input_list(usr, "Pick an area.", "Pick an area", return_sorted_areas())
if(!A)
return
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index 77c1edff2ce..3084a636bbf 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -28,7 +28,9 @@
else
targets["(No Mob) - [T]"] = T
var/list/sorted = sortList(targets)
- var/target = input(src,"To whom shall we send a message?","Admin PM",null) in sorted|null
+ var/target = tgui_input_list(src,"To whom shall we send a message?","Admin PM", sorted)
+ if(!target)
+ return
cmd_admin_pm(targets[target],null)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin PM Name") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -50,7 +52,9 @@
else
targets["(No Mob) - [T]"] = T
var/list/sorted = sortList(targets)
- var/target = input(src,"To whom shall we send a message?","Admin PM",null) in sorted|null
+ var/target = tgui_input_list(src, "To whom shall we send a message?", "Admin PM", sorted)
+ if(!target)
+ return
cmd_admin_pm(targets[target],null)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin PM Key") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 449046f62d4..a79c717e441 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -610,7 +610,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
if(initial(O.can_be_admin_equipped))
outfits[initial(O.name)] = path
- var/dresscode = input("Select outfit", "Robust quick dress shop") as null|anything in outfits
+ var/dresscode = tgui_input_list(usr, "Select outfit", "Robust quick dress shop", outfits)
if(isnull(dresscode))
return
@@ -625,7 +625,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
if(initial(O.can_be_admin_equipped))
job_outfits[initial(O.name)] = path
- dresscode = input("Select job equipment", "Robust quick dress shop") as null|anything in job_outfits
+ dresscode = tgui_input_list(usr, "Select job equipment", "Robust quick dress shop", job_outfits)
dresscode = job_outfits[dresscode]
if(isnull(dresscode))
return
@@ -634,7 +634,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
var/list/custom_names = list()
for(var/datum/outfit/D in GLOB.custom_outfits)
custom_names[D.name] = D
- var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in custom_names
+ var/selected_name = tgui_input_list(usr, "Select outfit", "Robust quick dress shop", custom_names)
dresscode = custom_names[selected_name]
if(isnull(dresscode))
return
@@ -828,7 +828,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
names[name] = ruin_landmark
- var/ruinname = input("Select ruin", "Jump to Ruin") as null|anything in names
+ var/ruinname = tgui_input_list(usr, "Select ruin", "Jump to Ruin", names)
var/obj/effect/landmark/ruin/landmark = names[ruinname]
diff --git a/code/modules/antagonists/changeling/changeling_datum.dm b/code/modules/antagonists/changeling/changeling_datum.dm
index 5da2d0f00e9..8deac41e17f 100644
--- a/code/modules/antagonists/changeling/changeling_datum.dm
+++ b/code/modules/antagonists/changeling/changeling_datum.dm
@@ -428,7 +428,7 @@ GLOBAL_LIST_INIT(possible_changeling_IDs, list("Alpha","Beta","Gamma","Delta","E
continue
names[DNA.real_name] = DNA
- var/chosen_name = input(message, title, null) as null|anything in names
+ var/chosen_name = tgui_input_list(owner.current, message, title, names)
if(!chosen_name)
return
diff --git a/code/modules/antagonists/changeling/powers/hivemind.dm b/code/modules/antagonists/changeling/powers/hivemind.dm
index 23ec8fe86b4..4193596a411 100644
--- a/code/modules/antagonists/changeling/powers/hivemind.dm
+++ b/code/modules/antagonists/changeling/powers/hivemind.dm
@@ -113,7 +113,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank)
to_chat(user, span_notice("There's no new DNA to absorb from the air."))
return FALSE
- var/choice = input("Select a DNA absorb from the air: ", "Absorb DNA", null) as null|anything in names
+ var/choice = tgui_input_list(user, "Select a DNA absorb from the air: ", "Absorb DNA", names)
if(!choice)
return FALSE
diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index 87fdc72a36d..a99df981c21 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -528,6 +528,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if(user.client.donator_level > 0)
dat += "Donator Publicity: [(toggles & PREFTOGGLE_DONATOR_PUBLIC) ? "Public" : "Hidden"]
"
dat += "Fancy TGUI: [(toggles2 & PREFTOGGLE_2_FANCYUI) ? "Yes" : "No"]
"
+ dat += "Input Lists: [(toggles2 & PREFTOGGLE_2_DISABLE_TGUI_LISTS) ? "Default" : "TGUI"]
"
dat += "FPS: [clientfps]
"
dat += "Ghost Ears: [(toggles & PREFTOGGLE_CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]
"
dat += "Ghost Radio: [(toggles & PREFTOGGLE_CHAT_GHOSTRADIO) ? "All Chatter" : "Nearest Speakers"]
"
@@ -1297,7 +1298,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
var/datum/job/job = locate(href_list["job"])
if(job)
var/choices = list(job.title) + job.alt_titles
- var/choice = input("Pick a title for [job.title].", "Character Generation", GetPlayerAltTitle(job)) as anything in choices | null
+ var/choice = tgui_input_list(user, "Pick a title for [job.title].", "Character Generation", choices)
if(choice)
SetPlayerAltTitle(job, choice)
SetChoices(user)
@@ -1511,7 +1512,9 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
else //Not using the whitelist? Aliens for everyone!
new_species += GLOB.whitelisted_species
- species = input("Please select a species", "Character Generation", null) in sortTim(new_species, cmp = /proc/cmp_text_asc)
+ species = tgui_input_list(user, "Please select a species", "Character Generation", sortTim(new_species, cmp = /proc/cmp_text_asc))
+ if(!species)
+ return
var/datum/species/NS = GLOB.all_species[species]
if(!istype(NS)) //The species was invalid. Notify the user and fail out.
species = prev_species
@@ -1610,12 +1613,16 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if(!(lang.flags & RESTRICTED))
new_languages += lang.name
- language = input("Please select a secondary language", "Character Generation", null) in sortTim(new_languages, cmp = /proc/cmp_text_asc)
+ language = tgui_input_list(user, "Please select a secondary language", "Character Generation", sortTim(new_languages, cmp = /proc/cmp_text_asc))
+ if(!language)
+ return
if("autohiss_mode")
if(S.autohiss_basic_map)
var/list/autohiss_choice = list("Off" = AUTOHISS_OFF, "Basic" = AUTOHISS_BASIC, "Full" = AUTOHISS_FULL)
- var/new_autohiss_pref = input(user, "Choose your character's auto-accent level:", "Character Preference") as null|anything in autohiss_choice
+ var/new_autohiss_pref = tgui_input_list(user, "Choose your character's auto-accent level:", "Character Preference", autohiss_choice)
+ if(!new_autohiss_pref)
+ return
autohiss_mode = autohiss_choice[new_autohiss_pref]
if("metadata")
@@ -1624,7 +1631,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
metadata = sanitize(copytext_char(new_metadata,1,MAX_MESSAGE_LEN))
if("b_type")
- var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" )
+ var/new_b_type = tgui_input_list(user, "Choose your character's blood-type:", "Character Preference", list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" ))
if(new_b_type)
b_type = new_b_type
@@ -1669,12 +1676,12 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
valid_hairstyles += hairstyle
sortTim(valid_hairstyles, cmp = /proc/cmp_text_asc) //this alphabetizes the list
- var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in valid_hairstyles
+ var/new_h_style = tgui_input_list(user, "Choose your character's hair style:", "Character Preference", valid_hairstyles)
if(new_h_style)
h_style = new_h_style
if("h_grad_style")
- var/result = input(user, "Choose your character's hair gradient style:", "Character Preference") as null|anything in GLOB.hair_gradients_list
+ var/result = tgui_input_list(user, "Choose your character's hair gradient style:", "Character Preference", GLOB.hair_gradients_list)
if(result)
h_grad_style = result
@@ -1714,7 +1721,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
valid_head_accessory_styles += head_accessory_style
sortTim(valid_head_accessory_styles, cmp = /proc/cmp_text_asc)
- var/new_head_accessory_style = input(user, "Choose the style of your character's head accessory:", "Character Preference") as null|anything in valid_head_accessory_styles
+ var/new_head_accessory_style = tgui_input_list(user, "Choose the style of your character's head accessory:", "Character Preference", valid_head_accessory_styles)
if(new_head_accessory_style)
ha_style = new_head_accessory_style
@@ -1723,7 +1730,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
return
if(S.bodyflags & HAS_ALT_HEADS) //Species with alt heads.
var/list/valid_alt_heads = list()
- valid_alt_heads["None"] = GLOB.alt_heads_list["None"] //The only null entry should be the "None" option
for(var/alternate_head in GLOB.alt_heads_list)
var/datum/sprite_accessory/alt_heads/head = GLOB.alt_heads_list[alternate_head]
if(!(species in head.species_allowed))
@@ -1731,7 +1737,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
valid_alt_heads += alternate_head
- var/new_alt_head = input(user, "Choose your character's alternate head style:", "Character Preference") as null|anything in valid_alt_heads
+ var/new_alt_head = tgui_input_list(user, "Choose your character's alternate head style:", "Character Preference", valid_alt_heads)
if(new_alt_head)
alt_head = new_alt_head
if(m_styles["head"])
@@ -1743,7 +1749,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("m_style_head")
if(S.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings.
var/list/valid_markings = list()
- valid_markings["None"] = GLOB.marking_styles_list["None"]
for(var/markingstyle in GLOB.marking_styles_list)
var/datum/sprite_accessory/body_markings/head/M = GLOB.marking_styles_list[markingstyle]
if(!(species in M.species_allowed))
@@ -1772,7 +1777,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
valid_markings += markingstyle
sortTim(valid_markings, cmp = /proc/cmp_text_asc)
- var/new_marking_style = input(user, "Choose the style of your character's head markings:", "Character Preference", m_styles["head"]) as null|anything in valid_markings
+ var/new_marking_style = tgui_input_list(user, "Choose the style of your character's head markings:", "Character Preference", valid_markings)
if(new_marking_style)
m_styles["head"] = new_marking_style
@@ -1786,7 +1791,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("m_style_body")
if(S.bodyflags & HAS_BODY_MARKINGS) //Species with body markings/tattoos.
var/list/valid_markings = list()
- valid_markings["None"] = GLOB.marking_styles_list["None"]
for(var/markingstyle in GLOB.marking_styles_list)
var/datum/sprite_accessory/M = GLOB.marking_styles_list[markingstyle]
if(!(species in M.species_allowed))
@@ -1796,7 +1800,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
valid_markings += markingstyle
sortTim(valid_markings, cmp = /proc/cmp_text_asc)
- var/new_marking_style = input(user, "Choose the style of your character's body markings:", "Character Preference", m_styles["body"]) as null|anything in valid_markings
+ var/new_marking_style = tgui_input_list(user, "Choose the style of your character's body markings:", "Character Preference", valid_markings)
if(new_marking_style)
m_styles["body"] = new_marking_style
@@ -1810,7 +1814,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("m_style_tail")
if(S.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings.
var/list/valid_markings = list()
- valid_markings["None"] = GLOB.marking_styles_list["None"]
for(var/markingstyle in GLOB.marking_styles_list)
var/datum/sprite_accessory/body_markings/tail/M = GLOB.marking_styles_list[markingstyle]
if(M.marking_location != "tail")
@@ -1826,7 +1829,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
valid_markings += markingstyle
sortTim(valid_markings, cmp = /proc/cmp_text_asc)
- var/new_marking_style = input(user, "Choose the style of your character's tail markings:", "Character Preference", m_styles["tail"]) as null|anything in valid_markings
+ var/new_marking_style = tgui_input_list(user, "Choose the style of your character's tail markings:", "Character Preference", valid_markings)
if(new_marking_style)
m_styles["tail"] = new_marking_style
@@ -1839,23 +1842,26 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("body_accessory")
var/list/possible_body_accessories = list()
- for(var/B in GLOB.body_accessory_by_name)
- var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[B]
- if(!istype(accessory))
- possible_body_accessories += "None" //the only null entry should be the "None" option
- continue
- if(species in accessory.allowed_species)
- possible_body_accessories += B
+ if(check_rights(R_ADMIN, 1, user))
+ possible_body_accessories = GLOB.body_accessory_by_name.Copy()
+ else
+ for(var/B in GLOB.body_accessory_by_name)
+ var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[B]
+ if(isnull(accessory)) // None
+ continue
+ if(species in accessory.allowed_species)
+ possible_body_accessories += B
if(S.optional_body_accessory)
- possible_body_accessories.Add("None") //the only null entry should be the "None" option
+ possible_body_accessories += "None" //the only null entry should be the "None" option
else
- possible_body_accessories.Remove("None") // in case an admin is viewing it
- sortTim(possible_body_accessories, cmp = /proc/cmp_text_asc)
- var/new_body_accessory = input(user, "Choose your body accessory:", "Character Preference") as null|anything in possible_body_accessories
+ possible_body_accessories -= "None" // in case an admin is viewing it
+ sortTim(possible_body_accessories, GLOBAL_PROC_REF(cmp_text_asc))
+ var/new_body_accessory = tgui_input_list(user, "Choose your body accessory", "Character Preference", possible_body_accessories)
if(new_body_accessory)
m_styles["tail"] = "None"
body_accessory = (new_body_accessory == "None") ? null : new_body_accessory
+
if("facial")
if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox")) //Species that have facial hair. (No HAS_HAIR_FACIAL flag)
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", f_colour) as color|null
@@ -1899,7 +1905,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if(species in SA.species_allowed) //If the user's head is of a species the facial hair style allows, add it to the list.
valid_facial_hairstyles += facialhairstyle
sortTim(valid_facial_hairstyles, cmp = /proc/cmp_text_asc)
- var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in valid_facial_hairstyles
+ var/new_f_style = tgui_input_list(user, "Choose your character's facial-hair style:", "Character Preference", valid_facial_hairstyles)
if(new_f_style)
f_style = new_f_style
@@ -1915,7 +1921,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
continue
valid_underwear[underwear] = GLOB.underwear_list[underwear]
sortTim(valid_underwear, cmp = /proc/cmp_text_asc)
- var/new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in valid_underwear
+ var/new_underwear = tgui_input_list(user, "Choose your character's underwear:", "Character Preference", valid_underwear)
ShowChoices(user)
if(new_underwear)
underwear = new_underwear
@@ -1937,7 +1943,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
continue
valid_undershirts[undershirt] = GLOB.undershirt_list[undershirt]
sortTim(valid_undershirts, cmp = /proc/cmp_text_asc)
- var/new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in valid_undershirts
+ var/new_undershirt = tgui_input_list(user, "Choose your character's undershirt:", "Character Preference", valid_undershirts)
ShowChoices(user)
if(new_undershirt)
undershirt = new_undershirt
@@ -1959,7 +1965,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
continue
valid_sockstyles[sockstyle] = GLOB.socks_list[sockstyle]
sortTim(valid_sockstyles, cmp = /proc/cmp_text_asc)
- var/new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in valid_sockstyles
+ var/new_socks = tgui_input_list(user, "Choose your character's socks:", "Character Preference", valid_sockstyles)
ShowChoices(user)
if(new_socks)
socks = new_socks
@@ -2000,12 +2006,12 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
ooccolor = new_ooccolor
if("bag")
- var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist
+ var/new_backbag = tgui_input_list(user, "Choose your character's style of bag:", "Character Preference", GLOB.backbaglist)
if(new_backbag)
backbag = new_backbag
if("nt_relation")
- var/new_relation = input(user, "Choose your relation to NT. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference") as null|anything in list("Loyal", "Supportive", "Neutral", "Skeptical", "Opposed")
+ var/new_relation = tgui_input_list(user, "Choose your relation to NT. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference", list("Loyal", "Supportive", "Neutral", "Skeptical", "Opposed"))
if(new_relation)
nanotrasen_relation = new_relation
@@ -2019,7 +2025,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
flavor_text = msg
if("uplink_pref")
- var/new_uplink_pref = input(user, "Choose your preferred uplink location:", "Character Preference") as null|anything in list("pda", "headset")
+ var/new_uplink_pref = tgui_input_list(user, "Choose your preferred uplink location:", "Character Preference", list("pda", "headset"))
if(new_uplink_pref)
uplink_pref = new_uplink_pref
@@ -2036,7 +2042,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
var/valid_limbs = list("Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand")
if(S.bodyflags & ALL_RPARTS)
valid_limbs = list("Torso", "Lower Body", "Head", "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 valid_limbs
+ var/limb_name = tgui_input_list(user, "Which limb do you want to change?", "Limbs and Parts", valid_limbs)
if(!limb_name)
return
@@ -2086,7 +2092,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if(!(S.bodyflags & ALL_RPARTS))
third_limb = BODY_ZONE_R_ARM
- var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in valid_limb_states
+ var/new_state = tgui_input_list(user, "What state do you wish the limb to be in?", "[limb_name]", valid_limb_states)
if(!new_state) return
switch(new_state)
@@ -2119,7 +2125,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
robolimb_companies[R.company] = R //List only main brands that have the parts we're looking for.
R = new() //Re-initialize R.
- choice = input(user, "Which manufacturer do you wish to use for this limb?") as null|anything in robolimb_companies //Choose from a list of companies that offer the part the user wants.
+ choice = tgui_input_list(user, "Which manufacturer do you wish to use for this limb?", "[limb_name] - Prosthesis", robolimb_companies) //Choose from a list of companies that offer the part the user wants.
if(!choice)
return
R.company = choice
@@ -2135,7 +2141,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if(second_limb in L.parts) //If the child limb of the limb the user selected is also present in the model's parts list, state it's been found so the second limb can be set later.
in_model = 1
if(robolimb_models.len > 1) //If there's more than one model in the list that can provide the part the user wants, let them choose.
- subchoice = input(user, "Which model of [choice] [limb_name] do you wish to use?") as null|anything in robolimb_models
+ subchoice = tgui_input_list(user, "Which model of [choice] [limb_name] do you wish to use?", "[limb_name] - Prosthesis - Model", robolimb_models)
if(subchoice)
choice = subchoice
if(limb in list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN))
@@ -2158,7 +2164,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
rlimb_data[second_limb] = choice
organ_data[second_limb] = "cyborg"
if("organs")
- var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Eyes", "Ears", "Heart", "Lungs", "Liver", "Kidneys")
+ var/organ_name = tgui_input_list(user, "Which internal function do you want to change?", "Internal Organs", list("Eyes", "Ears", "Heart", "Lungs", "Liver", "Kidneys"))
if(!organ_name)
return
@@ -2177,7 +2183,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("Kidneys")
organ = INTERNAL_ORGAN_KIDNEYS
- var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in list("Normal", "Cybernetic")
+ var/new_state = tgui_input_list(user, "What state do you wish the organ to be in?", "[organ_name]", list("Normal", "Cybernetic"))
if(!new_state) return
switch(new_state)
@@ -2214,7 +2220,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("gender")
if(!S.has_gender)
- var/newgender = input(user, "Choose Gender:") as null|anything in list("Male", "Female", "Genderless")
+ var/newgender = tgui_input_list(user, "Choose Gender:", "Gender", list("Male", "Female", "Genderless"))
switch(newgender)
if("Male")
gender = MALE
@@ -2232,19 +2238,22 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("hear_adminhelps")
sound ^= SOUND_ADMINHELP
if("ui")
- switch(UI_style)
+ var/new_UI_style = tgui_input_list(user, "Choose your UI style", "UI style", list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative", "White"))
+ if(!new_UI_style)
+ return
+ switch(new_UI_style)
if("Midnight")
- UI_style = "Plasmafire"
+ UI_style = "Midnight"
if("Plasmafire")
- UI_style = "Retro"
+ UI_style = "Plasmafire"
if("Retro")
- UI_style = "Slimecore"
+ UI_style = "Retro"
if("Slimecore")
- UI_style = "Operative"
+ UI_style = "Slimecore"
if("Operative")
+ UI_style = "Operative"
+ if("White")
UI_style = "White"
- else
- UI_style = "Midnight"
if(ishuman(usr)) //mid-round preference changes, for aesthetics
var/mob/living/carbon/human/H = usr
@@ -2256,6 +2265,9 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if("tgui")
toggles2 ^= PREFTOGGLE_2_FANCYUI
+ if("input_lists")
+ toggles2 ^= PREFTOGGLE_2_DISABLE_TGUI_LISTS
+
if("ghost_att_anim")
toggles2 ^= PREFTOGGLE_2_ITEMATTACK
@@ -2269,7 +2281,9 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
"19x15 (Ultrawide)" = "19x15"
)
- var/new_range = input(user, "Select a view range") as anything in viewrange_options
+ var/new_range = tgui_input_list(user, "Select a view range", "Range", viewrange_options)
+ if(!new_range)
+ return
var/actual_new_range = viewrange_options[new_range]
viewrange = actual_new_range
@@ -2401,7 +2415,11 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
"High" = PARALLAX_HIGH,
"Insane" = PARALLAX_INSANE
)
- parallax = parallax_styles[input(user, "Pick a parallax style", "Parallax Style") as null|anything in parallax_styles]
+
+ var/new_parallax = tgui_input_list(user, "Pick a parallax style", "Parallax Style", parallax_styles)
+ if(!new_parallax)
+ return
+ parallax = parallax_styles[new_parallax]
if(parent && parent.mob && parent.mob.hud_used)
parent.mob.hud_used.update_parallax_pref()
if("keybindings")
diff --git a/code/modules/client/preference/preferences_toggles.dm b/code/modules/client/preference/preferences_toggles.dm
index 80a53a6791b..d1fb701ba5b 100644
--- a/code/modules/client/preference/preferences_toggles.dm
+++ b/code/modules/client/preference/preferences_toggles.dm
@@ -230,6 +230,14 @@
to_chat(src, "You will no longer hear musical instruments.")
SSblackbox.record_feedback("tally", "toggle_verbs", 1, "Toggle Instruments") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+/client/verb/toggle_input()
+ set name = "Toggle TGUI Input Lists"
+ set category = "Preferences"
+ set desc = "Switches input lists between the TGUI and the standard one"
+ prefs.toggles2 ^= PREFTOGGLE_2_DISABLE_TGUI_LISTS
+ prefs.save_preferences(src)
+ to_chat(src, "You will [(prefs.toggles2 & PREFTOGGLE_2_DISABLE_TGUI_LISTS) ? "no longer" : "now"] use TGUI Input Lists.")
+
/client/verb/Toggle_disco() //to toggle off the disco machine locally, in case it gets too annoying
set name = "Hear/Silence Dance Machine"
set category = "Preferences"
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index 4c205adb452..1671422134b 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -30,7 +30,7 @@
/datum/action/chameleon_outfit/proc/select_outfit(mob/user)
if(!user || !IsAvailable())
return FALSE
- var/selected = input("Select outfit to change into", "Chameleon Outfit") as null|anything in outfit_options
+ var/selected = tgui_input_list(user, "Select outfit to change into", "Chameleon Outfit", outfit_options)
if(!IsAvailable() || QDELETED(src) || QDELETED(user))
return FALSE
var/outfit_type = outfit_options[selected]
@@ -116,7 +116,7 @@
/datum/action/item_action/chameleon/change/proc/select_look(mob/user)
var/obj/item/picked_item
var/picked_name
- picked_name = input("Select [chameleon_name] to change into", "Chameleon [chameleon_name]", picked_name) as null|anything in chameleon_list
+ picked_name = tgui_input_list(user, "Select [chameleon_name] to change into", "Chameleon [chameleon_name]", chameleon_list)
if(!picked_name)
return
picked_item = chameleon_list[picked_name]
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 5e77dd605fb..ac9f61f4230 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -260,7 +260,9 @@ BLIND // can't see anything
return
var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon")
- var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
+ var/switchMode = tgui_input_list(user, "Select a sensor mode:", "Suit Sensor Mode", modes, modes[sensor_mode+1])
+ if(!switchMode)
+ return
if(get_dist(user, src) > 1)
to_chat(user, "You have moved too far away.")
return
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index dea40becc4a..6f4449bb6b2 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -712,7 +712,7 @@
"mask_flags" = HIDEMASK|HIDENAME
)
- var/choice = input(user, "How would you like to adjust the helmet?", "Adjust Helmet") as null|anything in options
+ var/choice = tgui_input_list(user, "How would you like to adjust the helmet?", "Adjust Helmet", options)
if(choice && choice != state && !user.incapacitated() && Adjacent(user))
var/list/new_state = options[choice]
@@ -779,7 +779,7 @@
options["lime"] ="shazjacket_lime"
options["army green"] ="shazjacket_army"
- var/choice = input(user, "What color do you wish your jacket to be?", "Change color") as null|anything in options
+ var/choice = tgui_input_list(user, "What color do you wish your jacket to be?", "Change color", options)
if(choice && !user.stat && in_range(user, src))
if(suit_adjusted)
@@ -1257,15 +1257,15 @@
var/list/plush_colors = list("red fox plushie" = "redfox", "black fox plushie" = "blackfox", "marble fox plushie" = "marblefox", "blue fox plushie" = "bluefox", "orange fox plushie" = "orangefox",
"coffee fox plushie" = "coffeefox", "pink fox plushie" = "pinkfox", "purple fox plushie" = "purplefox", "crimson fox plushie" = "crimsonfox")
-/obj/item/toy/plushie/fluff/fox/proc/change_color()
+/obj/item/toy/plushie/fluff/fox/proc/change_color(mob/user)
if(prompting_change)
return
prompting_change = TRUE
- var/plushie_color = input("Select a color", "[src]") as null|anything in plush_colors
+ var/plushie_color = tgui_input_list(user, "Select a color", "[src]", plush_colors)
prompting_change = FALSE
if(!plushie_color)
return
- if(!Adjacent(usr))
+ if(!Adjacent(user))
return
name = plushie_color
icon_state = plush_colors[plushie_color]
@@ -1274,7 +1274,7 @@
var/datum/action/A = X
A.UpdateButtonIcon()
-/obj/item/toy/plushie/fluff/fox/ui_action_click()
+/obj/item/toy/plushie/fluff/fox/ui_action_click(mob/user)
change_color()
@@ -1436,7 +1436,7 @@
options["Syndicate"] = "syndie_witch"
options["Nanotrasen"] ="nt_witch"
- var/choice = input(user, "To what form do you wish to Shapeshift this hat?", "Shapeshift Hat") as null|anything in options
+ var/choice = tgui_input_list(user, "To what form do you wish to Shapeshift this hat?", "Shapeshift Hat", options)
if(choice && !user.stat && in_range(user, src))
icon_state = options[choice]
diff --git a/code/modules/fish/fishtank.dm b/code/modules/fish/fishtank.dm
index 7687686e661..3b2fca703bf 100644
--- a/code/modules/fish/fishtank.dm
+++ b/code/modules/fish/fishtank.dm
@@ -334,7 +334,7 @@
var/datum/fish/fish_type = key
var/count = length(fish_types[key])
fish_types_input += list("[initial(fish_type.fish_name)][count > 1 ? " (x[count])" : ""]" = fish_types[key])
- var/caught_fish = input("Select a fish to catch.", "Fishing") as null|anything in fish_types_input //Select a fish from the tank
+ var/caught_fish = tgui_input_list(user, "Select a fish to catch.", "Fishing", fish_types_input) //Select a fish from the tank
if(fish_count <= 0)
to_chat(user, "There are no fish in [src] to catch!")
return
diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
index ce40ea54e9d..3de68fcce0c 100644
--- a/code/modules/food_and_drinks/drinks/bottler/bottler.dm
+++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
@@ -391,7 +391,7 @@
if(href_list["process"])
var/list/choices = list("Glass Bottle" = 1, "Plastic Bottle" = 2, "Metal Can" = 3)
- var/selection = input("Select a container for your beverage.", "Container") as null|anything in choices
+ var/selection = tgui_input_list(usr, "Select a container for your beverage", "Container", choices)
if(!selection)
return
else
diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm
index c3c9ee94ecb..2fadcb70465 100644
--- a/code/modules/games/cards.dm
+++ b/code/modules/games/cards.dm
@@ -148,7 +148,7 @@
players += player
//players -= usr
- var/mob/living/M = input("Who do you wish to deal a card to?") as null|anything in players
+ var/mob/living/M = input(usr, "Who do you wish to deal a card to?", "Deal Card", players)
if(!usr || !src || !M) return
deal_at(usr, M, 1)
@@ -175,7 +175,7 @@
var/dcard = input("How many card(s) do you wish to deal? You may deal up to [maxcards] cards.") as num
if(dcard > maxcards)
return
- var/mob/living/M = input("Who do you wish to deal [dcard] card(s)?") as null|anything in players
+ var/mob/living/M = tgui_input_list(usr, "Who do you wish to deal [dcard] card(s)?", "Deal Card", players)
if(!usr || !src || !M || !Adjacent(usr))
return
@@ -354,7 +354,9 @@
var/pickablecards = list()
for(var/datum/playingcard/P in cards)
pickablecards[P.name] = P
- var/pickedcard = input("Which card do you want to remove from the hand?") as null|anything in pickablecards
+ var/pickedcard = tgui_input_list(user, "Which card do you want to remove from the hand?", "Remove Card", pickablecards)
+ if(!pickedcard)
+ return
if(QDELETED(src))
return
@@ -391,7 +393,10 @@
var/list/to_discard = list()
for(var/datum/playingcard/P in cards)
to_discard[P.name] = P
- var/discarding = input("Which card do you wish to put down?") as null|anything in to_discard
+ var/discarding = tgui_input_list(user, "Which card do you wish to put down?", "Discard", to_discard)
+
+ if(!discarding)
+ continue
if(QDELETED(src))
return
diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm
index eba5c3038a8..21e763dd185 100644
--- a/code/modules/hydroponics/beekeeping/beebox.dm
+++ b/code/modules/hydroponics/beekeeping/beebox.dm
@@ -228,7 +228,7 @@
if(bees)
visible_message("[user] disturbs the bees!")
else
- var/option = input(user, "What Action do you wish to perform?", "Apiary") as null|anything in list("Remove a Honey Frame","Remove the Queen Bee")
+ var/option = tgui_input_list(user, "What Action do you wish to perform?", "Apiary", list("Remove a Honey Frame","Remove the Queen Bee"))
if(!Adjacent(user) || !option)
return
switch(option)
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index fb06e1a7f33..9970f244d6f 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -75,7 +75,7 @@
/obj/structure/bookcase/attack_hand(var/mob/user as mob)
if(contents.len)
- var/obj/item/book/choice = input("Which book would you like to remove from [src]?") as null|anything in contents
+ var/obj/item/book/choice = tgui_input_list(user, "Which book would you like to remove from [src]?", "Bookcase", contents)
if(choice)
if(user.incapacitated() || user.lying || !Adjacent(user))
return
@@ -195,7 +195,7 @@
if(unique)
to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.")
return 1
- var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
+ var/choice = tgui_input_list(user, "What would you like to change?", "Book Edit", list("Title", "Contents", "Author", "Cancel"))
switch(choice)
if("Title")
var/newtitle = reject_bad_text(stripped_input(usr, "Write a new title:"))
diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm
index ec9ae6690ef..761d8560314 100644
--- a/code/modules/mining/equipment/marker_beacons.dm
+++ b/code/modules/mining/equipment/marker_beacons.dm
@@ -60,7 +60,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
if(!istype(user) || ui_status(user, GLOB.physical_state) != STATUS_INTERACTIVE)
return
- var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
+ var/input_color = tgui_input_list(user, "Choose a color.", "Beacon Color", GLOB.marker_beacon_colors)
if(!istype(user) || ui_status(user, GLOB.physical_state) != STATUS_INTERACTIVE)
return
if(input_color)
@@ -135,7 +135,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
..()
if(!istype(user) || ui_status(user, GLOB.physical_state) != STATUS_INTERACTIVE)
return
- var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
+ var/input_color = tgui_input_list(user, "Choose a color.", "Beacon Color", GLOB.marker_beacon_colors)
if(!istype(user) || ui_status(user, GLOB.physical_state) != STATUS_INTERACTIVE)
return
if(input_color)
diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm
index bb2ba5dc222..f880c90c394 100644
--- a/code/modules/mining/fulton.dm
+++ b/code/modules/mining/fulton.dm
@@ -31,7 +31,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
else
var/A
- A = input("Select a beacon to connect to", "Balloon Extraction Pack", A) as null|anything in possible_beacons
+ A = tgui_input_list(user, "Select a beacon to connect to", "Balloon Extraction Pack", possible_beacons)
if(!A)
return
diff --git a/code/modules/mining/lavaland/loot/bubblegum_loot.dm b/code/modules/mining/lavaland/loot/bubblegum_loot.dm
index 16538ba6cc0..d57a8ac3977 100644
--- a/code/modules/mining/lavaland/loot/bubblegum_loot.dm
+++ b/code/modules/mining/lavaland/loot/bubblegum_loot.dm
@@ -46,7 +46,7 @@
return
used = TRUE
- var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in GLOB.player_list
+ var/choice = tgui_input_list(user,"Who do you want dead?","Choose Your Victim", GLOB.player_list)
if(!choice)
used = FALSE
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index ab14c96627e..74acb4926e6 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -262,7 +262,7 @@
/obj/machinery/mineral/equipment_vendor/proc/redeem_voucher(obj/item/mining_voucher/voucher, mob/redeemer)
var/items = list("Explorer's Webbing", "Resonator Kit", "Minebot Kit", "Extraction and Rescue Kit", "Plasma Cutter Kit", "Mining Explosives Kit", "Crusher Kit", "Mining Conscription Kit")
- var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in items
+ var/selection = tgui_input_list(redeemer, "Pick your equipment", "Mining Voucher Redemption", items)
if(!selection || !Adjacent(redeemer) || QDELETED(voucher) || voucher.loc != redeemer)
return
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 9776af07f1f..1035780bf0f 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -388,7 +388,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!isobserver(usr))
to_chat(usr, "Not when you're not dead!")
return
- var/target = input("Area to teleport to", "Teleport to a location") as null|anything in GLOB.ghostteleportlocs
+ var/target = tgui_input_list(usr, "Area to teleport to", "Teleport to a location", GLOB.ghostteleportlocs)
+ if(!target)
+ return
var/area/A = GLOB.ghostteleportlocs[target]
teleport(A)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 27e1ac04430..783db11e0a8 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -691,7 +691,9 @@
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
- var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list(SEC_RECORD_STATUS_NONE, SEC_RECORD_STATUS_ARREST, SEC_RECORD_STATUS_SEARCH, SEC_RECORD_STATUS_MONITOR, SEC_RECORD_STATUS_DEMOTE, SEC_RECORD_STATUS_INCARCERATED, SEC_RECORD_STATUS_PAROLLED, SEC_RECORD_STATUS_RELEASED, "Cancel")
+ var/setcriminal = tgui_input_list(usr, "Specify a new criminal status for this person.", "Security HUD", list(SEC_RECORD_STATUS_NONE, SEC_RECORD_STATUS_ARREST, SEC_RECORD_STATUS_SEARCH, SEC_RECORD_STATUS_MONITOR, SEC_RECORD_STATUS_DEMOTE, SEC_RECORD_STATUS_INCARCERATED, SEC_RECORD_STATUS_PAROLLED, SEC_RECORD_STATUS_RELEASED), R.fields["criminal"])
+ if(!setcriminal)
+ return
var/t1 = copytext(trim(sanitize(input("Enter Reason:", "Security HUD", null, null) as text)), 1, MAX_MESSAGE_LEN)
if(!t1)
t1 = "(none)"
diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm
index 5131079a443..43a5f6df776 100644
--- a/code/modules/mob/living/carbon/human/species/machine.dm
+++ b/code/modules/mob/living/carbon/human/species/machine.dm
@@ -152,7 +152,9 @@
if(Entry[2] == H.ckey) // They're in the list? Custom sprite time, var and icon change required
hair += Entry[3] // Adds custom screen to list
- var/new_style = input(H, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
+ var/new_style = tgui_input_list(H, "Select a monitor display", "Monitor Display", hair, head_organ.h_style)
+ if(!new_style)
+ return
var/new_color = input("Please select hair color.", "Monitor Color", head_organ.hair_colour) as null|color
if(H.incapacitated(TRUE, TRUE, TRUE))
diff --git a/code/modules/mob/living/carbon/human/species/moth.dm b/code/modules/mob/living/carbon/human/species/moth.dm
index c62934ef6dd..02856a2679b 100644
--- a/code/modules/mob/living/carbon/human/species/moth.dm
+++ b/code/modules/mob/living/carbon/human/species/moth.dm
@@ -12,7 +12,6 @@
icobase = 'icons/mob/human_races/r_moth.dmi'
deform = 'icons/mob/human_races/r_moth.dmi'
inherent_factions = list("moth")
- species_traits = list(IS_WHITELISTED)
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT
bodyflags = HAS_HEAD_ACCESSORY | HAS_HEAD_MARKINGS | HAS_BODY_MARKINGS | HAS_WING | HAS_SKIN_COLOR
reagent_tag = PROCESS_ORG
diff --git a/code/modules/mob/living/carbon/human/species/slime.dm b/code/modules/mob/living/carbon/human/species/slime.dm
index a3bfb99abbd..5a52bbb7604 100644
--- a/code/modules/mob/living/carbon/human/species/slime.dm
+++ b/code/modules/mob/living/carbon/human/species/slime.dm
@@ -191,7 +191,7 @@
to_chat(H, "Ваши конечности на месте!")
return
- var/limb_select = input(H, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs
+ var/limb_select = tgui_input_list(H, "Choose a limb to regrow", "Limb Regrowth", missing_limbs)
if(!limb_select) // If the user hit cancel on the popup, return
return
var/chosen_limb = missing_limbs[limb_select]
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index fada6cfa3da..d29e33089e3 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -920,7 +920,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
for(var/i in tempnetwork)
cameralist[i] = i
var/old_network = network
- network = input(U, "Which network would you like to view?") as null|anything in cameralist
+ network = tgui_input_list(U, "Which network would you like to view?", "Jump To Network", cameralist)
if(check_unable())
return
@@ -1005,7 +1005,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["photo"]//Pull names, rank, and id photo.
if(personnel_list.len)
- input = input("Select a crew member:") as null|anything in personnel_list
+ input = tgui_input_list(usr, "Select a crew member", "Change Hologram", personnel_list)
var/icon/character_icon = personnel_list[input]
if(character_icon)
qdel(holo_icon)//Clear old icon so we're not storing it in memory.
@@ -1035,7 +1035,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
"Turkey"
)
- input = input("Please select a hologram:") as null|anything in icon_list
+ input = tgui_input_list(usr, "Please select a hologram", "Change Hologram", icon_list)
if(input)
qdel(holo_icon)
switch(input)
@@ -1090,7 +1090,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(custom_hologram) //insert custom hologram
icon_list.Add("custom")
- input = input("Please select a hologram:") as null|anything in icon_list
+ input = tgui_input_list(usr, "Please select a hologram", "Change Hologram", icon_list)
if(input)
qdel(holo_icon)
switch(input)
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 45aefca10a4..47bf806c56e 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -592,7 +592,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
if(C.installed)
installed_components += V
- var/toggle = input(src, "Which component do you want to toggle?", "Toggle Component") as null|anything in installed_components
+ var/toggle = tgui_input_list(src, "Which component do you want to toggle?", "Toggle Component", installed_components)
if(!toggle)
return
@@ -951,7 +951,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
removable_components += V
if(module)
removable_components += module.custom_removals
- var/remove = input(user, "Which component do you want to pry out?", "Remove Component") as null|anything in removable_components
+ var/remove = tgui_input_list(user, "Which component do you want to pry out?", "Remove Component", removable_components)
if(!remove)
return
if(module && module.handle_custom_removal(remove, user, I))
diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm
index b1abb49d2ef..b7d809d1d0d 100644
--- a/code/modules/mob/living/silicon/robot/robot_items.dm
+++ b/code/modules/mob/living/silicon/robot/robot_items.dm
@@ -8,7 +8,7 @@
/obj/item/pen/multi/robopen/attack_self(mob/user as mob)
- var/choice = input("Would you like to change colour or mode?") as null|anything in list("Colour","Mode")
+ var/choice = tgui_input_list(user, "Would you like to change colour or mode?", name, list("Colour","Mode"))
if(!choice) return
switch(choice)
diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm
index 9c8977afb30..f5d3fe2b8e7 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm
@@ -307,7 +307,7 @@
if(!found_mirror)
to_chat(usr, "You are not close enough to a working mirror to teleport!")
return
- var/input_mirror = input(usr, "Choose a mirror to teleport to.", "Mirror to Teleport to") as null|anything in mirrors_to_use
+ var/input_mirror = tgui_input_list(usr, "Choose a mirror to teleport to", "Mirror to Teleport to", mirrors_to_use)
var/obj/chosen = mirrors_to_use[input_mirror]
if(chosen == null)
return
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index 86c14fa92c0..e9866e19ab4 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -238,7 +238,7 @@ GLOBAL_LIST_EMPTY(fax_blacklist)
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if(F.ussp_restricted)
combineddepartments |= F.department
- destination = input(usr, "To which department?", "Choose a department", "") as null|anything in combineddepartments
+ destination = tgui_input_list(usr, "To which department?", "Choose a department", combineddepartments)
if(!destination)
destination = lastdestination
if("send") // actually send the fax
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 0cf65d020d0..6c6658a0607 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -70,7 +70,7 @@
update_icon()
/obj/item/pen/multi/proc/select_colour(mob/user as mob)
- var/newcolour = input(user, "Which colour would you like to use?", name, colour) as null|anything in colour_choices
+ var/newcolour = tgui_input_list(user, "Which colour would you like to use?", name, colour_choices, colour)
if(newcolour)
colour = newcolour
playsound(loc, 'sound/effects/pop.ogg', 50, 1)
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index a94f8667c08..e96f38ebc59 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -189,7 +189,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
/obj/item/camera/verb/change_size()
set name = "Set Photo Focus"
set category = "Object"
- var/nsize = input("Photo Size","Pick a size of resulting photo.") as null|anything in list(1,3,5,7)
+ var/nsize = tgui_input_list(usr, "Photo Size", "Pick a size of resulting photo.", list(1,3,5,7))
if(nsize)
size = nsize
to_chat(usr, "Camera will now take [size]x[size] photos.")
@@ -518,7 +518,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
return
var/datum/picture/P = null
- P = input("Select image to print:",P) as null|anything in saved_pictures
+ P = tgui_input_list(usr, "Select image to print", "Print image", saved_pictures)
if(P)
printpicture(usr,P)
pictures_left --
@@ -532,7 +532,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
to_chat(usr, "No images saved")
return
var/datum/picture/P = null
- P = input("Select image to delete:",P) as null|anything in saved_pictures
+ P = tgui_input_list(usr, "Select image to delete", "Delete image", saved_pictures)
if(P)
saved_pictures -= P
diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm
index 17cfcacec62..df1dc13cce9 100644
--- a/code/modules/paperwork/silicon_photography.dm
+++ b/code/modules/paperwork/silicon_photography.dm
@@ -47,7 +47,7 @@
return
for(var/datum/picture/t in cam.aipictures)
nametemp += t.fields["name"]
- find = input("Select image (numbered in order taken)") in nametemp
+ find = tgui_input_list(usr, "Select image (numbered in order taken)", "Pick Image", nametemp)
for(var/datum/picture/q in cam.aipictures)
if(q.fields["name"] == find)
diff --git a/code/modules/pda/ai.dm b/code/modules/pda/ai.dm
index a2caa5bad47..9f34fe4b73f 100644
--- a/code/modules/pda/ai.dm
+++ b/code/modules/pda/ai.dm
@@ -25,7 +25,7 @@
to_chat(usr, "Cannot use messenger!")
var/list/plist = M.available_pdas()
if(plist)
- var/c = input(usr, "Please select a PDA") as null|anything in sortList(plist)
+ var/c = tgui_input_list(usr, "Please select a PDA", "Send message", sortList(plist))
if(!c) // if the user hasn't selected a PDA file we can't send a message
return
var/selected = plist[c]
diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm
index 6e556526574..2cfe4af85b6 100644
--- a/code/modules/shuttle/navigation_computer.dm
+++ b/code/modules/shuttle/navigation_computer.dm
@@ -369,7 +369,7 @@
L[S.name] = S
playsound(console, 'sound/machines/terminal_prompt.ogg', 25, 0)
- var/selected = input("Choose location to jump to", "Locations", null) as null|anything in L
+ var/selected = tgui_input_list(target, "Choose location to jump to", "Locations", L)
if(QDELETED(src) || QDELETED(target) || !isliving(target))
return
playsound(src, "terminal_type", 25, 0)
diff --git a/code/modules/spacepods/spacepod.dm b/code/modules/spacepods/spacepod.dm
index ff6737ba46c..cd1eaef4c68 100644
--- a/code/modules/spacepods/spacepod.dm
+++ b/code/modules/spacepods/spacepod.dm
@@ -502,7 +502,7 @@
possible.Add("Secondary Cargo System")
if(equipment_system.lock_system)
possible.Add("Lock System")
- switch(input(user, "Remove which equipment?", null, null) as null|anything in possible)
+ switch(tgui_input_list(user, "Remove which equipment?", "Equipment",possible))
if("Energy Cell")
if(user.get_active_hand() && user.get_inactive_hand())
to_chat(user, "You need an open hand to do that.")
diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm
index fa91005d2b1..10af0eb14f9 100644
--- a/code/modules/surgery/helpers.dm
+++ b/code/modules/surgery/helpers.dm
@@ -58,7 +58,7 @@
procedure.next_step(user, M, I)
else
- var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries
+ var/P = tgui_input_list(user, "Begin which procedure?", "Surgery", available_surgeries)
if(P && user && user.Adjacent(M) && (I in user))
var/datum/surgery/S = available_surgeries[P]
var/datum/surgery/procedure = new S.type
diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm
index 5d939a2f0cb..0091e38592c 100644
--- a/code/modules/surgery/organs_internal.dm
+++ b/code/modules/surgery/organs_internal.dm
@@ -296,7 +296,7 @@
organs -= O
organs[O.name] = O
- I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs
+ I = tgui_input_list(user, "Remove which organ?", "Surgery", organs)
if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool)
I = organs[I]
if(!I)
diff --git a/code/modules/surgery/plastic_surgery.dm b/code/modules/surgery/plastic_surgery.dm
index 130a608a293..3b2a8d271f1 100644
--- a/code/modules/surgery/plastic_surgery.dm
+++ b/code/modules/surgery/plastic_surgery.dm
@@ -59,7 +59,7 @@
for(var/i in 1 to list_size)
names += "Subject [target.gender == MALE ? "I" : "O"]-[pick("A", "B", "C", "D", "E")]-[rand(10000, 99999)]"
names += random_name(target.gender, species_names) //give one normal name in case they want to do regular plastic surgery
- var/chosen_name = input(user, "Choose a new name to assign.", "Plastic Surgery") as null|anything in names
+ var/chosen_name = tgui_input_list(user, "Choose a new name to assign.", "Plastic Surgery", names)
if(!chosen_name)
return
var/oldname = target.real_name
diff --git a/code/modules/surgery/plastic_surgery_robotics.dm b/code/modules/surgery/plastic_surgery_robotics.dm
index bd0195f9f8f..6ff9d57194a 100644
--- a/code/modules/surgery/plastic_surgery_robotics.dm
+++ b/code/modules/surgery/plastic_surgery_robotics.dm
@@ -59,7 +59,7 @@
for(var/i in 1 to list_size)
names += "Subject [target.gender == MALE ? "I" : "O"]-[pick("A", "B", "C", "D", "E")]-[rand(10000, 99999)]"
names += random_name(target.gender, species_names) //give one normal name in case they want to do regular plastic surgery
- var/chosen_name = input(user, "Choose a new name to assign.", "Robotic Name Change") as null|anything in names
+ var/chosen_name = tgui_input_list(user, "Choose a new name to assign.", "Robotic Name Change", names)
if(!chosen_name)
return
var/oldname = target.real_name
diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm
index 43b7fa9f63b..d1f269b801c 100644
--- a/code/modules/surgery/robotics.dm
+++ b/code/modules/surgery/robotics.dm
@@ -417,7 +417,7 @@
organs -= O
organs[O.name] = O
- I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs
+ I = tgui_input_list(user, "Remove which organ?", "Surgery", organs)
if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool)
I = organs[I]
if(!I) return -1
@@ -631,7 +631,7 @@
..()
/datum/surgery_step/robotics/external/customize_appearance/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
- var/chosen_appearance = input(user, "Select the company appearance for this limb.", "Limb Company Selection") as null|anything in GLOB.selectable_robolimbs
+ var/chosen_appearance = tgui_input_list(user, "Select the company appearance for this limb.", "Limb Company Selection", GLOB.selectable_robolimbs)
if(!chosen_appearance)
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
diff --git a/code/modules/telesci/rcs.dm b/code/modules/telesci/rcs.dm
index 5ab0162c4d6..73465309fd2 100644
--- a/code/modules/telesci/rcs.dm
+++ b/code/modules/telesci/rcs.dm
@@ -70,7 +70,7 @@
if(emagged) // Add an 'Unknown' entry at the end if it's emagged
L += "**Unknown**"
- var/select = input("Please select a telepad.", "RCS") in L
+ var/select = tgui_input_list(user, "Please select a telepad.", "RCS", L)
if(select == "**Unknown**") // Randomise the teleport location
pad = random_coords()
else // Else choose the value of the selection
diff --git a/code/modules/tgui/modules/appearance_changer.dm b/code/modules/tgui/modules/appearance_changer.dm
index e630b8e20f8..b5866449021 100644
--- a/code/modules/tgui/modules/appearance_changer.dm
+++ b/code/modules/tgui/modules/appearance_changer.dm
@@ -95,7 +95,7 @@
if("hair_gradient")
if(can_change(APPEARANCE_HAIR) && length(valid_hairstyles))
- var/new_style = input("Please select gradient style.", "Hair Gradient", head_organ.h_grad_style) as null|anything in GLOB.hair_gradients_list
+ var/new_style = tgui_input_list(usr, "Please select gradient style", "Hair Gradient", GLOB.hair_gradients_list, head_organ.h_grad_style)
if(new_style)
owner.change_hair_gradient(style = new_style)
diff --git a/code/modules/tgui/modules/tgui_input_list.dm b/code/modules/tgui/modules/tgui_input_list.dm
new file mode 100644
index 00000000000..c88aa26c7ac
--- /dev/null
+++ b/code/modules/tgui/modules/tgui_input_list.dm
@@ -0,0 +1,138 @@
+/**
+ * Creates a TGUI input list window and returns the user's response.
+ *
+ * This proc should be used to create alerts that the caller will wait for a response from.
+ * Arguments:
+ * * user - The user to show the input box to.
+ * * message - The content of the input box, shown in the body of the TGUI window.
+ * * title - The title of the input box, shown on the top of the TGUI window.
+ * * items - The options that can be chosen by the user, each string is assigned a button on the UI.
+ * * default - If an option is already preselected on the UI. Current values, etc.
+ * * timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout.
+ */
+/proc/tgui_input_list(mob/user, message, title = "Select", list/items, default, timeout = 0, ui_state = GLOB.always_state)
+ if(!user)
+ user = usr
+ if(!length(items))
+ return null
+ if(!istype(user))
+ if(!isclient(user))
+ return
+ var/client/client = user
+ user = client.mob
+
+ /// Client does NOT have tgui_input on: Returns regular input
+ if(user.client?.prefs?.toggles2 & PREFTOGGLE_2_DISABLE_TGUI_LISTS)
+ return input(user, message, title, default) as null|anything in items
+
+ var/datum/tgui_list_input/input = new(user, message, title, items, default, timeout, ui_state)
+ input.ui_interact(user)
+ input.wait()
+ if(input)
+ . = input.choice
+ qdel(input)
+
+/**
+ * # tgui_list_input
+ *
+ * Datum used for instantiating and using a TGUI-controlled list input that prompts the user with
+ * a message and shows a list of selectable options
+ */
+/datum/tgui_list_input
+ /// The title of the TGUI window
+ var/title
+ /// The textual body of the TGUI window
+ var/message
+ /// The list of items (responses) provided on the TGUI window
+ var/list/items
+ /// Buttons (strings specifically) mapped to the actual value (e.g. a mob or a verb)
+ var/list/items_map
+ /// The button that the user has pressed, null if no selection has been made
+ var/choice
+ /// The default button to be selected
+ var/default
+ /// The time at which the tgui_list_input was created, for displaying timeout progress.
+ var/start_time
+ /// The lifespan of the tgui_list_input, after which the window will close and delete itself.
+ var/timeout
+ /// Boolean field describing if the tgui_list_input was closed by the user.
+ var/closed
+ /// The TGUI UI state that will be returned in ui_state(). Default: always_state
+ var/datum/ui_state/state
+
+/datum/tgui_list_input/New(mob/user, message, title, list/items, default, timeout, ui_state)
+ src.title = title
+ src.message = message
+ src.items = list()
+ src.items_map = list()
+ src.default = default
+ src.state = ui_state
+ // Gets rid of illegal characters
+ var/static/regex/whitelistedWords = regex(@{"([^\u0020-\u8000]+)"})
+ for(var/i in items)
+ if(!i)
+ continue
+ var/string_key = whitelistedWords.Replace("[i]", "")
+ src.items += string_key
+ src.items_map[string_key] = i
+
+ if(timeout)
+ src.timeout = timeout
+ start_time = world.time
+ QDEL_IN(src, timeout)
+
+/datum/tgui_list_input/Destroy(force, ...)
+ SStgui.close_uis(src)
+ state = null
+ QDEL_NULL(items)
+ return ..()
+
+/**
+ * Waits for a user's response to the tgui_list_input's prompt before returning. Returns early if
+ * the window was closed by the user.
+ */
+/datum/tgui_list_input/proc/wait()
+ while(!choice && !closed)
+ stoplag(1)
+
+/datum/tgui_list_input/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "ListInput", title, 325, 355, master_ui, state)
+ ui.set_autoupdate(FALSE)
+ ui.open()
+
+/datum/tgui_list_input/ui_close(mob/user)
+ . = ..()
+ closed = TRUE
+
+/datum/tgui_list_input/ui_static_data(mob/user)
+ var/list/data = list()
+ data["init_value"] = default || items[1]
+ data["items"] = items
+ data["message"] = message
+ data["title"] = title
+ return data
+
+/datum/tgui_list_input/ui_data(mob/user)
+ var/list/data = list()
+ if(timeout)
+ data["timeout"] = clamp((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS), 0, 1)
+ return data
+
+/datum/tgui_list_input/ui_act(action, list/params)
+ . = ..()
+ if (.)
+ return
+ switch(action)
+ if("choose")
+ if (!(params["choice"] in items))
+ return
+ src.choice = items_map[params["choice"]]
+ closed = TRUE
+ SStgui.close_uis(src)
+ return TRUE
+ if("cancel")
+ closed = TRUE
+ SStgui.close_uis(src)
+ return TRUE
diff --git a/paradise.dme b/paradise.dme
index c8e0cbe2535..eb071f59225 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -2863,6 +2863,7 @@
#include "code\modules\tgui\modules\law_manager.dm"
#include "code\modules\tgui\modules\power_monitor.dm"
#include "code\modules\tgui\modules\robot_self_diagnosis.dm"
+#include "code\modules\tgui\modules\tgui_input_list.dm"
#include "code\modules\tgui\modules\tts_seeds_explorer.dm"
#include "code\modules\tgui\modules\volume_mixer.dm"
#include "code\modules\tgui\plugins\login.dm"
diff --git a/tgui/packages/tgui/components/Autofocus.js b/tgui/packages/tgui/components/Autofocus.js
new file mode 100644
index 00000000000..726d96717e1
--- /dev/null
+++ b/tgui/packages/tgui/components/Autofocus.js
@@ -0,0 +1,19 @@
+import { Component, createRef } from 'inferno';
+
+export class Autofocus extends Component {
+ ref = createRef();
+
+ componentDidMount() {
+ setTimeout(() => {
+ this.ref.current?.focus();
+ }, 1);
+ }
+
+ render() {
+ return (
+