From 825c2c88660493c410ec5bbf6778af8c0d530032 Mon Sep 17 00:00:00 2001 From: Aylong <69762909+Aylong220@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:38:23 +0200 Subject: [PATCH] Converts Input List to TGUI Input Lists (#23396) * Part 1 * Testing 1 * Revert "Testing 1" This reverts commit fc06554b2850464fc82edc0ef318eb8fba603b0a. * Part 1.1 * Part 2 - UI Style List * Preferences lists * Preferences lists - DONE * More inputs * MOOOOOORE * UI style else * Last ones * Double name fix * Pre-selected Search * Return Pick Darkness * Return Pick Darkness * Missing users * Some review changes * Revert MULE lists * I just hate MERGE CONFLICT label * List window tweaks * I think there it is * why i am stopid * Update tgui.bundle.js --- code/__HELPERS/type2type.dm | 2 + code/_onclick/hud/ai_hud.dm | 4 +- code/datums/components/surgery_initiator.dm | 2 +- .../spell_targeting/matter_eater_targeting.dm | 2 +- .../spell_targeting/remoteview_targeting.dm | 2 +- code/datums/spell_targeting/targeted.dm | 2 +- code/datums/spell_targeting/telepathic.dm | 2 +- code/datums/spells/mimic.dm | 2 +- code/datums/spells/shapeshift.dm | 2 +- code/game/gamemodes/cult/blood_magic.dm | 8 +- code/game/gamemodes/cult/cult_items.dm | 2 +- code/game/gamemodes/cult/ritual.dm | 2 +- code/game/gamemodes/cult/runes.dm | 6 +- .../demons/slaughter demon/slaughter.dm | 2 +- code/game/gamemodes/nuclear/pinpointer.dm | 4 +- .../machinery/computer/atmos_controllers.dm | 4 +- .../game/machinery/computer/buildandrepair.dm | 4 +- .../machinery/computer/camera_advanced.dm | 2 +- .../game/machinery/computer/camera_console.dm | 2 +- code/game/machinery/constructable_frame.dm | 4 +- code/game/machinery/tcomms/tcomms_core.dm | 4 +- code/game/objects/items/cardboard_cutouts.dm | 2 +- code/game/objects/items/collar.dm | 2 +- .../objects/items/devices/enginepicker.dm | 6 +- .../items/devices/painter/airlock_painter.dm | 2 +- .../items/devices/painter/pipe_painter.dm | 5 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/weapons/scissors.dm | 4 +- code/game/objects/items/weapons/scrolls.dm | 2 +- .../objects/items/weapons/storage/boxes.dm | 2 +- .../objects/items/weapons/teleportation.dm | 2 +- .../crates_lockers/closets/cardboardbox.dm | 4 +- code/game/objects/structures/dresser.dm | 8 +- code/game/objects/structures/mirror.dm | 4 +- code/game/objects/structures/watercloset.dm | 4 +- .../changeling/datum_changeling.dm | 2 +- .../antagonists/changeling/powers/hivemind.dm | 2 +- .../client/preference/link_processing.dm | 104 ++++++++++-------- code/modules/clothing/chameleon.dm | 4 +- code/modules/clothing/clothing.dm | 1 - code/modules/customitems/item_defines.dm | 16 +-- code/modules/fish/fishtank.dm | 2 +- .../food_and_drinks/drinks/bottler/bottler.dm | 2 +- code/modules/games/cards.dm | 8 +- code/modules/hydroponics/beekeeping/beebox.dm | 2 +- code/modules/library/book.dm | 2 +- code/modules/library/library_equipment.dm | 2 +- .../mining/equipment/marker_beacons.dm | 4 +- code/modules/mining/fulton.dm | 2 +- .../mining/lavaland/loot/bubblegum_loot.dm | 2 +- code/modules/mining/machine_vending.dm | 2 +- .../mob/dead/observer/observer_base.dm | 3 +- .../mob/living/carbon/human/human_mob.dm | 2 +- .../living/carbon/human/species/machine.dm | 4 +- .../carbon/human/species/slimepeople.dm | 2 +- code/modules/mob/living/silicon/ai/ai_mob.dm | 8 +- .../living/silicon/robot/misc_robot_items.dm | 2 +- .../mob/living/silicon/robot/robot_mob.dm | 4 +- .../hostile/mining/elites/herald.dm | 2 +- code/modules/mob/mob.dm | 2 +- code/modules/mod/mod_control.dm | 2 +- code/modules/paperwork/faxmachine.dm | 2 +- code/modules/paperwork/paper.dm | 4 +- code/modules/paperwork/pen.dm | 2 +- code/modules/paperwork/photography.dm | 6 +- code/modules/paperwork/silicon_photography.dm | 2 +- code/modules/pda/ai_pda.dm | 2 +- code/modules/ruins/ghost_bar.dm | 2 +- code/modules/shuttle/navigation_computer.dm | 2 +- code/modules/surgery/organs_internal.dm | 2 +- code/modules/surgery/plastic_surgery.dm | 2 +- code/modules/surgery/robotics.dm | 6 +- code/modules/telesci/rcs.dm | 2 +- .../tgui/modules/appearance_changer.dm | 2 +- code/modules/tgui/modules/tgui_input_list.dm | 2 +- tgui/packages/tgui/interfaces/ListInput.js | 6 +- tgui/packages/tgui/public/tgui.bundle.js | 2 +- 77 files changed, 181 insertions(+), 166 deletions(-) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 1de9af1b0100..f56e9d9f3611 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -207,6 +207,8 @@ 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_hud.dm b/code/_onclick/hud/ai_hud.dm index 63783a04467d..8579060078bf 100644 --- a/code/_onclick/hud/ai_hud.dm +++ b/code/_onclick/hud/ai_hud.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 a target you want to track", "Tracking", AI.trackable_mobs()) if(target_name) AI.ai_camera_track(target_name) diff --git a/code/datums/components/surgery_initiator.dm b/code/datums/components/surgery_initiator.dm index c6aefce9bf84..e0a5c1bfcc73 100644 --- a/code/datums/components/surgery_initiator.dm +++ b/code/datums/components/surgery_initiator.dm @@ -129,7 +129,7 @@ procedure = S break else - procedure = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries + procedure = tgui_input_list(user, "Begin which procedure?", "Surgery", available_surgeries) if(!procedure) return diff --git a/code/datums/spell_targeting/matter_eater_targeting.dm b/code/datums/spell_targeting/matter_eater_targeting.dm index 9a672576d8f1..a9f33c676768 100644 --- a/code/datums/spell_targeting/matter_eater_targeting.dm +++ b/code/datums/spell_targeting/matter_eater_targeting.dm @@ -40,7 +40,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 f089ba285858..fce68b121810 100644 --- a/code/datums/spell_targeting/remoteview_targeting.dm +++ b/code/datums/spell_targeting/remoteview_targeting.dm @@ -16,7 +16,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 5ff208cf6d4b..2f6871324176 100644 --- a/code/datums/spell_targeting/targeted.dm +++ b/code/datums/spell_targeting/targeted.dm @@ -25,7 +25,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 618f9da80ca7..c6c739fe0f1a 100644 --- a/code/datums/spell_targeting/telepathic.dm +++ b/code/datums/spell_targeting/telepathic.dm @@ -28,7 +28,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/mimic.dm b/code/datums/spells/mimic.dm index 6fe1fbfb1613..4d807f4baaff 100644 --- a/code/datums/spells/mimic.dm +++ b/code/datums/spells/mimic.dm @@ -94,7 +94,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, "You decide against changing forms.") revert_cast(user) diff --git a/code/datums/spells/shapeshift.dm b/code/datums/spells/shapeshift.dm index 289e0e2c5c34..09d1439e951e 100644 --- a/code/datums/spells/shapeshift.dm +++ b/code/datums/spells/shapeshift.dm @@ -27,7 +27,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/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm index f9e0b667e653..41a81a2ae2c2 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,8 +80,8 @@ SSblackbox.record_feedback("tally", "cult_spells_prepared", 1, "[new_spell.name]") 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 +/datum/action/innate/cult/blood_magic/proc/remove_spell() + var/nullify_spell = tgui_input_list(owner, "Pick a spell to remove", "Current Spells", spells) if(nullify_spell) qdel(nullify_spell) @@ -518,7 +518,7 @@ log_game("Teleport spell failed - user in away mission") 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(QDELETED(src) || !user || user.l_hand != src && user.r_hand != src || user.incapacitated() || !actual_selected_rune) return diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 084ff4419573..ee9c00bfb532 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -782,7 +782,7 @@ to_chat(user, "You are not in the right dimension!") return - var/input_rune_key = input(user, "Choose a rune to make a portal to.", "Rune to make a portal 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 make a portal to", "Rune to make a portal 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(QDELETED(R) || QDELETED(actual_selected_rune) || !Adjacent(user) || user.incapacitated()) return diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index cea7205c4125..f9690f5c683a 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -116,7 +116,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 ab65a47fe61f..6de5b7947979 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -489,7 +489,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(QDELETED(src) || QDELETED(actual_selected_rune) ||!Adjacent(user) || user.incapacitated()) fail_invoke() @@ -631,7 +631,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)) @@ -753,7 +753,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(QDELETED(src) || !Adjacent(user) || user.incapacitated()) return diff --git a/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm b/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm index 73f0e1de4989..e0a32fe54689 100644 --- a/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm +++ b/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm @@ -185,7 +185,7 @@ to_chat(usr, "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 /datum/action/innate/demon/whisper/Activate() diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 07b0cc95ee59..5e478757e797 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -220,7 +220,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 @@ -492,7 +492,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 diff --git a/code/game/machinery/computer/atmos_controllers.dm b/code/game/machinery/computer/atmos_controllers.dm index 6ff44df86905..849ae9facf27 100644 --- a/code/game/machinery/computer/atmos_controllers.dm +++ b/code/game/machinery/computer/atmos_controllers.dm @@ -70,7 +70,7 @@ GLOBAL_LIST_EMPTY(gas_sensors) "-SAVE TO BUFFER-" = "multitool" ) - var/temp_answer = input(user, "Select an option to adjust", "Options!", null) as null|anything in options + var/temp_answer = tgui_input_list(user, "Select an option to adjust", "Options!", options) if(!Adjacent(user)) break @@ -191,7 +191,7 @@ GLOBAL_LIST_EMPTY(gas_sensors) to_chat(user, "Successfully added a new sensor/meter with name [new_name]") if("Remove") - var/to_remove = input(user, "Select a sensor/meter to remove", "Sensor/Meter Removal") as null|anything in sensor_name_uid_map + var/to_remove = tgui_input_list(user, "Select a sensor/meter to remove", "Sensor/Meter Removal", sensor_name_uid_map) if(!to_remove) return diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index baf96d4111c8..f799538d9c0d 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -72,7 +72,7 @@ . = 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 monitor_names_paths + var/choice = tgui_input_list(user, "Circuit Setting", "What would you change the board setting to?", monitor_names_paths) if(!choice) return board_name = choice @@ -527,7 +527,7 @@ if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda)) if(allowed(user)) user.visible_message("[user] waves [user.p_their()] ID past [src]'s access protocol scanner.", "You swipe your ID past [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_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index abf956d90336..792ce397af4e 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -202,7 +202,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/camera_console.dm b/code/game/machinery/computer/camera_console.dm index a55fed5f1e40..2bae6d59a0ca 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -185,7 +185,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/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index d35d03c84cda..558c13a5bef1 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -289,7 +289,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 station_vendors + var/choice = tgui_input_list(user, "Choose a new brand", "Select an Item", station_vendors) if(!choice) return set_type(choice) @@ -569,7 +569,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/tcomms/tcomms_core.dm b/code/game/machinery/tcomms/tcomms_core.dm index a072f9dd55c7..a4b85d853382 100644 --- a/code/game/machinery/tcomms/tcomms_core.dm +++ b/code/game/machinery/tcomms/tcomms_core.dm @@ -259,7 +259,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 @@ -268,7 +268,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/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index 069c77dac699..e9c21cd2107a 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -79,7 +79,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/collar.dm b/code/game/objects/items/collar.dm index 6d58c8c2c536..1a1a40a6cb35 100644 --- a/code/game/objects/items/collar.dm +++ b/code/game/objects/items/collar.dm @@ -14,7 +14,7 @@ /obj/item/petcollar/attack_self(mob/user) var/option = "Change Name" if(access_id) - option = input(user, "What do you want to do?", "[src]", option) as null|anything in list("Change Name", "Remove ID") + option = tgui_input_list(user, "What do you want to do?", "[src]", list("Change Name", "Remove ID")) if(QDELETED(src) || !Adjacent(user)) return switch(option) diff --git a/code/game/objects/items/devices/enginepicker.dm b/code/game/objects/items/devices/enginepicker.dm index 215addfe81ed..46cd53485651 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/painter/airlock_painter.dm b/code/game/objects/items/devices/painter/airlock_painter.dm index 28d3863553e7..08fe5ffce164 100644 --- a/code/game/objects/items/devices/painter/airlock_painter.dm +++ b/code/game/objects/items/devices/painter/airlock_painter.dm @@ -23,7 +23,7 @@ "Standard" = /obj/machinery/door/airlock) /datum/painter/airlock/pick_color(mob/user) - var/choice = input(user, "Please select a paintjob.") as null|anything in available_paint_jobs + var/choice = tgui_input_list(user, "Please select a paintjob.", "Airlock painter", available_paint_jobs) if(!choice) return paint_setting = choice diff --git a/code/game/objects/items/devices/painter/pipe_painter.dm b/code/game/objects/items/devices/painter/pipe_painter.dm index 17c383809aac..fb254955d414 100644 --- a/code/game/objects/items/devices/painter/pipe_painter.dm +++ b/code/game/objects/items/devices/painter/pipe_painter.dm @@ -12,7 +12,10 @@ paint_setting = pick(modes) /datum/painter/pipe/pick_color(mob/user) - paint_setting = input("Which color do you want to use?", null, paint_setting) 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 + paint_setting = new_paint_setting /datum/painter/pipe/paint_atom(atom/target, mob/user) if(!istype(target, /obj/machinery/atmospherics/pipe)) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 76b84dc8be67..38d1e025e46b 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -26,7 +26,7 @@ AddComponent(/datum/component/surgery_initiator/limb, forced_surgery = /datum/surgery/attach_robotic_limb) /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 abd1ca581ad6..fc6ccffb4606 100644 --- a/code/game/objects/items/weapons/scissors.dm +++ b/code/game/objects/items/weapons/scissors.dm @@ -32,9 +32,9 @@ to_chat(user, "[M] doesn't have a head!") return //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, 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 df58f7dc30ed..a66919d4e775 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -28,7 +28,7 @@ return var/picked_area - picked_area = input(user, "Area to jump to", "Teleport where?", picked_area) as null|anything in SSmapping.teleportlocs + picked_area = tgui_input_list(user, "Area to jump to", "Teleport where?", SSmapping.teleportlocs) if(!picked_area) return diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 52e11f4a208f..4496647127af 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -780,7 +780,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 0409a6004d3d..231a5586bcb1 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -59,7 +59,7 @@ 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/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index 0888040b8ae8..5ebf91d6272e 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -78,10 +78,10 @@ qdel(src) return if(is_pen(W)) - var/decalselection = input("Please select a decal") as null|anything in list("Atmospherics", "Bartender", "Barber", "Blueshield", "Captain", + var/decalselection = tgui_input_list(user, "Please select a decal", "Paint Box", list("Atmospherics", "Bartender", "Barber", "Blueshield", "Captain", "Cargo", "Chief Engineer", "Chaplain", "Chef", "Chemist", "Assistant", "Clown", "CMO", "Coroner", "Detective", "Engineering", "Genetics", "HOP", "HOS", "Hydroponics", "Internal Affairs Agent", "Janitor", "Magistrate", "Medical", "Mime", "Mining", "NT Representative", "Paramedic", - "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 3775ac87fb0b..5bc31b1d0502 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) H.underwear = new_underwear @@ -35,7 +35,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) H.undershirt = new_undershirt @@ -46,7 +46,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 a11a1de1dc17..eabccdf939a5 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -104,7 +104,7 @@ return var/mob/living/carbon/human/H = user - var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in options + var/choice = tgui_input_list(user, "Something to change?", "Magical Grooming", options) switch(choice) if("Name") @@ -139,7 +139,7 @@ AC.ui_interact(user) if("Voice") - var/voice_choice = input(user, "Perhaps...", "Voice effects") as null|anything in list("Comic Sans", "Wingdings", "Swedish", "Chav", "Mute") + var/voice_choice = tgui_input_list(user, "Perhaps...", "Voice effects", list("Comic Sans", "Wingdings", "Swedish", "Chav", "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 2c42680c6a3d..e6adf57c7626 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -139,7 +139,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) @@ -545,7 +545,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/antagonists/changeling/datum_changeling.dm b/code/modules/antagonists/changeling/datum_changeling.dm index 81a1f9c8e566..173c5d012195 100644 --- a/code/modules/antagonists/changeling/datum_changeling.dm +++ b/code/modules/antagonists/changeling/datum_changeling.dm @@ -347,7 +347,7 @@ 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 0b67742098e9..29079eaa61dd 100644 --- a/code/modules/antagonists/changeling/powers/hivemind.dm +++ b/code/modules/antagonists/changeling/powers/hivemind.dm @@ -50,7 +50,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) to_chat(user, "There's no new DNA to absorb from the air.") return - var/S = input("Select a DNA absorb from the air: ", "Absorb DNA", null) as null|anything in names + var/S = tgui_input_list(user, "Select a DNA absorb from the air", "Absorb DNA", names) if(!S) return diff --git a/code/modules/client/preference/link_processing.dm b/code/modules/client/preference/link_processing.dm index 9793f3de90d6..29463a75ca13 100644 --- a/code/modules/client/preference/link_processing.dm +++ b/code/modules/client/preference/link_processing.dm @@ -29,7 +29,7 @@ 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", active_character.GetPlayerAltTitle(job)) as anything in choices | null + var/choice = tgui_input_list(user, "Pick a title for [job.title]", "Character Generation", choices) if(choice) active_character.SetPlayerAltTitle(job, choice) active_character.SetChoices(user) @@ -223,7 +223,9 @@ if(can_use_species(user, _species)) new_species += _species - active_character.species = input("Please select a species", "Character Generation", null) in sortTim(new_species, GLOBAL_PROC_REF(cmp_text_asc)) + active_character.species = tgui_input_list(user, "Please select a species", "Character Generation", sortList(new_species)) + if(!active_character.species) + return var/datum/species/NS = GLOB.all_species[active_character.species] if(!istype(NS)) //The species was invalid. Notify the user and fail out. active_character.species = prev_species @@ -309,14 +311,17 @@ if(!(lang.flags & RESTRICTED)) new_languages += lang.name - active_character.language = input("Please select a secondary language", "Character Generation", null) in sortTim(new_languages, GLOBAL_PROC_REF(cmp_text_asc)) + active_character.language = tgui_input_list(user, "Please select a secondary language", "Character Generation", sortList(new_languages)) + if(!active_character.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 - if(new_autohiss_pref) - active_character.autohiss_mode = autohiss_choice[new_autohiss_pref] + var/new_autohiss_pref = tgui_input_list(user, "Choose your character's auto-accent level", "Character Preference", autohiss_choice) + if(!new_autohiss_pref) + return + active_character.autohiss_mode = autohiss_choice[new_autohiss_pref] if("metadata") var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , active_character.metadata) as message|null @@ -324,9 +329,10 @@ active_character.metadata = sanitize(copytext(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-" ) - if(new_b_type) - active_character.b_type = new_b_type + 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) + return + active_character.b_type = new_b_type if("hair") if(!(S.bodyflags & BALD)) @@ -369,12 +375,12 @@ valid_hairstyles += hairstyle sortTim(valid_hairstyles, GLOBAL_PROC_REF(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) active_character.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) active_character.h_grad_style = result @@ -414,7 +420,7 @@ valid_head_accessory_styles += head_accessory_style sortTim(valid_head_accessory_styles, GLOBAL_PROC_REF(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) active_character.ha_style = new_head_accessory_style @@ -423,7 +429,6 @@ 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(!(active_character.species in head.species_allowed)) @@ -431,7 +436,7 @@ 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) active_character.alt_head = new_alt_head if(active_character.m_styles["head"]) @@ -443,7 +448,6 @@ 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(!(active_character.species in M.species_allowed)) @@ -472,7 +476,7 @@ valid_markings += markingstyle sortTim(valid_markings, GLOBAL_PROC_REF(cmp_text_asc)) - var/new_marking_style = input(user, "Choose the style of your character's head markings:", "Character Preference", active_character.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) active_character.m_styles["head"] = new_marking_style @@ -486,7 +490,6 @@ 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(!(active_character.species in M.species_allowed)) @@ -496,7 +499,7 @@ valid_markings += markingstyle sortTim(valid_markings, GLOBAL_PROC_REF(cmp_text_asc)) - var/new_marking_style = input(user, "Choose the style of your character's body markings:", "Character Preference", active_character.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) active_character.m_styles["body"] = new_marking_style @@ -510,7 +513,6 @@ 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") @@ -526,7 +528,7 @@ valid_markings += markingstyle sortTim(valid_markings, GLOBAL_PROC_REF(cmp_text_asc)) - var/new_marking_style = input(user, "Choose the style of your character's tail markings:", "Character Preference", active_character.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) active_character.m_styles["tail"] = new_marking_style @@ -553,7 +555,7 @@ else 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 = input(user, "Choose your body accessory:", "Character Preference") as null|anything in possible_body_accessories + var/new_body_accessory = tgui_input_list(user, "Choose your body accessory", "Character Preference", possible_body_accessories) if(new_body_accessory) active_character.m_styles["tail"] = "None" active_character.body_accessory = (new_body_accessory == "None") ? null : new_body_accessory @@ -601,7 +603,7 @@ if(active_character.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, GLOBAL_PROC_REF(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) active_character.f_style = new_f_style @@ -617,7 +619,7 @@ continue valid_underwear[underwear] = GLOB.underwear_list[underwear] sortTim(valid_underwear, GLOBAL_PROC_REF(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) active_character.underwear = new_underwear @@ -633,7 +635,7 @@ continue valid_undershirts[undershirt] = GLOB.undershirt_list[undershirt] sortTim(valid_undershirts, GLOBAL_PROC_REF(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) active_character.undershirt = new_undershirt @@ -650,7 +652,7 @@ continue valid_sockstyles[sockstyle] = GLOB.socks_list[sockstyle] sortTim(valid_sockstyles, GLOBAL_PROC_REF(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) active_character.socks = new_socks @@ -684,22 +686,22 @@ 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) active_character.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) active_character.nanotrasen_relation = new_relation if("physique") - var/new_physique = input(user, "Choose your descriptor for how built your character is on glance.", "Character Preference") as null|anything in GLOB.character_physiques + var/new_physique = tgui_input_list(user, "Choose your descriptor for how built your character is on glance.", "Character Preference", GLOB.character_physiques) if(new_physique) active_character.physique = new_physique if("height") - var/new_height = input(user, "Choose your descriptor for how tall your character is on glance.", "Character Preference") as null|anything in GLOB.character_heights + var/new_height = tgui_input_list(user, "Choose your descriptor for how tall your character is on glance.", "Character Preference", GLOB.character_heights) if(new_height) active_character.height = new_height @@ -716,7 +718,7 @@ 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 var/limb = null @@ -765,7 +767,7 @@ if(!(S.bodyflags & ALL_RPARTS)) third_limb = "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) @@ -798,7 +800,7 @@ 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 @@ -814,7 +816,7 @@ 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("head", "chest", "groin")) @@ -837,7 +839,7 @@ active_character.rlimb_data[second_limb] = choice active_character.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 @@ -856,7 +858,7 @@ if("Kidneys") 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) @@ -880,7 +882,7 @@ else switch(href_list["preference"]) if("cbmode") - var/cb_mode = input(user, "Select a colourblind mode\nNote this will disable special screen effects such as the cursed heart warnings!") as null|anything in list(COLOURBLIND_MODE_NONE, COLOURBLIND_MODE_DEUTER, COLOURBLIND_MODE_PROT, COLOURBLIND_MODE_TRIT) + var/cb_mode = tgui_input_list(user, "Select a colourblind mode\nNote this will disable special screen effects such as the cursed heart warnings!", "Colorblind mode", list(COLOURBLIND_MODE_NONE, COLOURBLIND_MODE_DEUTER, COLOURBLIND_MODE_PROT, COLOURBLIND_MODE_TRIT)) if(cb_mode) colourblind_mode = cb_mode user.update_client_colour(0) @@ -895,7 +897,9 @@ 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, "Who are you?", "Choose Gender", list("Male", "Female", "Genderless")) + if(!newgender) + return switch(newgender) if("Male") active_character.gender = MALE @@ -913,19 +917,22 @@ 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 @@ -951,7 +958,9 @@ "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", "View range", viewrange_options) + if(!new_range) + return var/actual_new_range = viewrange_options[new_range] viewrange = actual_new_range @@ -1085,7 +1094,10 @@ "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() diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 1e31735ae2ea..d6e375b43742 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] @@ -110,7 +110,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 ad263237dc18..22b63fff7cb9 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -314,7 +314,6 @@ 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 - if(!user.Adjacent(src)) 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 c72524f7638e..4cb0098abffb 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -704,7 +704,7 @@ "mask_flags" = HIDEMASK|HIDEFACE ) - 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] @@ -771,7 +771,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) @@ -1249,15 +1249,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] @@ -1266,8 +1266,8 @@ var/datum/action/A = X A.UpdateButtonIcon() -/obj/item/toy/plushie/fluff/fox/ui_action_click() - change_color() +/obj/item/toy/plushie/fluff/fox/ui_action_click(mob/user) + change_color(user) // TheFlagbearer: Willow Walker @@ -1439,7 +1439,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 d2cde90e0220..3b2ac70a4d8b 100644 --- a/code/modules/fish/fishtank.dm +++ b/code/modules/fish/fishtank.dm @@ -319,7 +319,7 @@ var/count = length(fish_types[key]) var/fish_description = "[initial(fish_type.fish_name)][count > 1 ? " (x[count])" : ""]" fish_types_input[fish_description] = fish_type - 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(!caught_fish) return if(!Adjacent(user)) diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm index 55150c6e769f..10f1065f444f 100644 --- a/code/modules/food_and_drinks/drinks/bottler/bottler.dm +++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm @@ -375,7 +375,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 b6a3a29835ec..9a64098491b4 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -174,7 +174,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 = tgui_input_list(usr, "Who do you wish to deal a card to?", "Deal Card", players) if(!usr || !src || !M) return deal_at(usr, M, 1) @@ -195,7 +195,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 @@ -424,7 +424,7 @@ for(var/datum/playingcard/P in cards) pickablecards[P.name] = P if(!pickedcard) - pickedcard = input("Which card do you want to remove from the hand?") as null|anything in pickablecards + pickedcard = tgui_input_list(usr, "Which card do you want to remove from the hand?", "Remove Card", pickablecards) if(!pickedcard) return @@ -461,7 +461,7 @@ 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(usr, "Which card do you wish to put down?", "Discard", to_discard) if(!discarding) continue diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index f1f91d5a8e67..57a5eb504ed5 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -222,7 +222,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/book.dm b/code/modules/library/book.dm index a796ad9773aa..c3583ffa0beb 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -210,7 +210,7 @@ if(protected) //we don't want people touching "special" books, especially ones that use iframes to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.") return - var/choice = input(user, "What would you like to edit?") as null|anything in list("Title", "Edit Current Page", "Author", "Summary", "Add Page", "Remove Page") + var/choice = tgui_input_list(user, "What would you like to edit?", "Book Edit", list("Title", "Edit Current Page", "Author", "Summary", "Add Page", "Remove Page")) switch(choice) if("Title") var/newtitle = reject_bad_text(stripped_input(user, "Write a new title:")) diff --git a/code/modules/library/library_equipment.dm b/code/modules/library/library_equipment.dm index b2ff2ce8493e..42a13d63fde1 100644 --- a/code/modules/library/library_equipment.dm +++ b/code/modules/library/library_equipment.dm @@ -56,7 +56,7 @@ if(!length(contents)) return - var/obj/item/book/choice = input(user, "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) return if(user.incapacitated() || !Adjacent(user)) diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm index bf2709de325f..b9c3b8e5acd8 100644 --- a/code/modules/mining/equipment/marker_beacons.dm +++ b/code/modules/mining/equipment/marker_beacons.dm @@ -61,7 +61,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) @@ -137,7 +137,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 d4eee00156de..50b383571ce4 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 5ce83a191e53..6bd2a3e7ac03 100644 --- a/code/modules/mining/lavaland/loot/bubblegum_loot.dm +++ b/code/modules/mining/lavaland/loot/bubblegum_loot.dm @@ -109,7 +109,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 0616f5e8d72f..8e03c2e1e749 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -242,7 +242,7 @@ /obj/machinery/mineral/equipment_vendor/proc/redeem_voucher(obj/item/mining_voucher/voucher, mob/redeemer) var/items = list("Survival Capsule and Explorer's Webbing", "Resonator Kit", "Minebot Kit", "Extraction and Rescue Kit", "Crusher Kit", "Plasma Cutter", "Jaunter 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_base.dm b/code/modules/mob/dead/observer/observer_base.dm index 91200ba4e13c..e0970661ce3a 100644 --- a/code/modules/mob/dead/observer/observer_base.dm +++ b/code/modules/mob/dead/observer/observer_base.dm @@ -401,7 +401,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!QDELETED(mind.current)) // Could change while they're choosing mind.current.remove_status_effect(STATUS_EFFECT_REVIVABLE) SEND_SIGNAL(mind.current, COMSIG_LIVING_SET_DNR) - /mob/dead/observer/proc/dead_tele() set category = "Ghost" @@ -438,7 +437,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp 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/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm index aa6df58de404..3a9e51f027a5 100644 --- a/code/modules/mob/living/carbon/human/human_mob.dm +++ b/code/modules/mob/living/carbon/human/human_mob.dm @@ -933,7 +933,7 @@ SEC_RECORD_STATUS_RELEASED, ) - var/new_status = input(user, "Set the new criminal status for [perpname].", "Security HUD", found_record.fields["criminal"]) as null|anything in possible_status + var/new_status = tgui_input_list(user, "Set the new criminal status for [perpname]", "Security HUD", possible_status) if(!new_status) return diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 8e1f03b4e640..17e5ec1234cf 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -185,7 +185,9 @@ for(var/style in GLOB.configuration.custom_sprites.ipc_screen_map[H.ckey]) hair += style - 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) + 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)) diff --git a/code/modules/mob/living/carbon/human/species/slimepeople.dm b/code/modules/mob/living/carbon/human/species/slimepeople.dm index 1344e663fba5..4af69cfe0c7b 100644 --- a/code/modules/mob/living/carbon/human/species/slimepeople.dm +++ b/code/modules/mob/living/carbon/human/species/slimepeople.dm @@ -153,7 +153,7 @@ to_chat(H, "You're not missing any limbs!") 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_mob.dm b/code/modules/mob/living/silicon/ai/ai_mob.dm index 7394e6cd6ad2..71ae4ff228d9 100644 --- a/code/modules/mob/living/silicon/ai/ai_mob.dm +++ b/code/modules/mob/living/silicon/ai/ai_mob.dm @@ -931,7 +931,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 @@ -1011,7 +1011,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. @@ -1054,7 +1054,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( "Roller-Monkey" ) - 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) @@ -1141,7 +1141,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/misc_robot_items.dm b/code/modules/mob/living/silicon/robot/misc_robot_items.dm index 2079d157fe36..26d01c2c4806 100644 --- a/code/modules/mob/living/silicon/robot/misc_robot_items.dm +++ b/code/modules/mob/living/silicon/robot/misc_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/silicon/robot/robot_mob.dm b/code/modules/mob/living/silicon/robot/robot_mob.dm index 030afb783e28..a874776febc8 100644 --- a/code/modules/mob/living/silicon/robot/robot_mob.dm +++ b/code/modules/mob/living/silicon/robot/robot_mob.dm @@ -585,7 +585,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( if(!C.is_missing()) 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 @@ -939,7 +939,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 || !Adjacent(user) || !opened) return 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 d2032db0a902..527ad1e96c18 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 @@ -304,7 +304,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/mob/mob.dm b/code/modules/mob/mob.dm index f7a600a1b443..ca5375be9f2c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1188,7 +1188,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ continue if(L.npc_safe(src) && L.stat != DEAD && !L.key) creatures += L - var/picked = input("Please select an NPC to respawn as", "Respawn as NPC") as null|anything in creatures + var/picked = tgui_input_list(usr, "Please select an NPC to respawn as", "Respawn as NPC", creatures) switch(picked) if("Mouse") become_mouse() diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm index 6b29952fef35..29885c2809ad 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -334,7 +334,7 @@ if(!module.removable) continue removable_modules += module - var/obj/item/mod/module/module_to_remove = input(user, "Which module do you want to pry out?", "Module Removal") as null|anything in removable_modules + var/obj/item/mod/module/module_to_remove = tgui_input_list(user, "Which module do you want to pry out?", "Module Removal", removable_modules) if(!module_to_remove?.mod) return FALSE uninstall(module_to_remove) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 1e20806f2f36..afe55915905b 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -227,7 +227,7 @@ GLOBAL_LIST_EMPTY(fax_blacklist) for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if(F.emagged)//we can contact emagged faxes on the station 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/paper.dm b/code/modules/paperwork/paper.dm index 39ae900d6bcf..df08b12638e8 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -344,7 +344,7 @@ var/const/station_text = "\[Station name\]" var/list/menu_list = list() //text items in the menu menu_list.Add(usr.real_name) //the real name of the character, even if it is hidden - if(usr.real_name != usr.name || usr.name != "unknown") //if the player is masked or the name is different a new answer option is added + if(usr.real_name != usr.name) //if the player is masked or the name is different a new answer option is added menu_list.Add("[usr.name]") menu_list.Add(usr.job, //current job num_text, //account number @@ -356,7 +356,7 @@ usr.gender, //current gender usr.dna.species //current species ) - var/input_element = input("Select the text you want to add:", "Select item") as null|anything in menu_list + var/input_element = tgui_input_list(usr, "Select the text you want to add", "Select item", menu_list) switch(input_element) //format selected menu items in pencode and internal data if(sign_text) input_element = "\[sign\]" diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index a5d8a48717e1..44c94fc76bb6 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -69,7 +69,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) 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 d5bb12536212..6092fc9f093a 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -215,7 +215,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor change_size(user) /obj/item/camera/proc/change_size(mob/user) - 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(user, "Photo Size", "Pick a size of resulting photo.", list(1,3,5,7)) if(nsize) size = nsize to_chat(user, "Camera will now take [size]x[size] photos.") @@ -536,7 +536,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor return var/datum/picture/picture - picture = input("Select image to print:", picture) as null|anything in saved_pictures + picture = tgui_input_list(user, "Select image to print", "Print image", saved_pictures) if(picture) printpicture(user, picture) pictures_left -- @@ -549,7 +549,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor to_chat(user, "No images saved") return var/datum/picture/picture - picture = input("Select image to delete:", picture) as null|anything in saved_pictures + picture = tgui_input_list(user, "Select image to delete", "Delete image", saved_pictures) if(picture) saved_pictures -= picture diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm index e5231da3746d..7f2d6106a409 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_pda.dm b/code/modules/pda/ai_pda.dm index caebaa35e917..dc67d5f29089 100644 --- a/code/modules/pda/ai_pda.dm +++ b/code/modules/pda/ai_pda.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/ruins/ghost_bar.dm b/code/modules/ruins/ghost_bar.dm index 9042475276b5..c957eb01dabf 100644 --- a/code/modules/ruins/ghost_bar.dm +++ b/code/modules/ruins/ghost_bar.dm @@ -19,7 +19,7 @@ our_characters_names += saves.real_name our_character_saves += list(saves.real_name = saves) - var/character_name = input("Select a character", "Character selection") as null|anything in our_characters_names + var/character_name = tgui_input_list(user, "Select a character", "Character selection", our_characters_names) if(!character_name) return if(QDELETED(user)) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 9c37adbb8c0a..bc5d0dafa087 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -329,7 +329,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/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index f4a897775589..a0e8fc686dc8 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -307,7 +307,7 @@ organs -= O organs[O.name] = O - var/obj/item/organ/internal/I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs + var/obj/item/organ/internal/I = tgui_input_list(user, "Remove which organ?", "Surgery", organs) if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool) extracting = organs[I] if(!extracting) diff --git a/code/modules/surgery/plastic_surgery.dm b/code/modules/surgery/plastic_surgery.dm index 7200fbf1ec31..1aaa027b0221 100644 --- a/code/modules/surgery/plastic_surgery.dm +++ b/code/modules/surgery/plastic_surgery.dm @@ -68,7 +68,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/robotics.dm b/code/modules/surgery/robotics.dm index def103bbb168..f1eb83d8f2ac 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -472,7 +472,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) @@ -644,7 +644,7 @@ return ..() /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 SURGERY_STEP_INCOMPLETE var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -701,7 +701,7 @@ to_chat(user, "The multitool is out of range! Please try again.") return SURGERY_STEP_INCOMPLETE var/static/list/gender_list = list("Male" = MALE, "Female" = FEMALE, "Genderless" = PLURAL, "Object" = NEUTER) - var/gender_key = input(user, "Choose a gender for this machine.", "Select Gender", target.gender) as null|anything in gender_list + var/gender_key = tgui_input_list(user, "Choose a gender for this machine", "Select Gender", gender_list) if(!gender_key) to_chat(user, "You must choose a gender! Please try again.") return SURGERY_STEP_INCOMPLETE diff --git a/code/modules/telesci/rcs.dm b/code/modules/telesci/rcs.dm index 28475ce55d8c..25825bb8d013 100644 --- a/code/modules/telesci/rcs.dm +++ b/code/modules/telesci/rcs.dm @@ -68,7 +68,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 dd7f90950551..ddf548d2715d 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) 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 index c642ef6bc9d2..f9ede158930c 100644 --- a/code/modules/tgui/modules/tgui_input_list.dm +++ b/code/modules/tgui/modules/tgui_input_list.dm @@ -112,7 +112,7 @@ /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, 330, master_ui, state) + ui = new(user, src, ui_key, "ListInput", title, 325, 355, master_ui, state) ui.set_autoupdate(FALSE) ui.open() diff --git a/tgui/packages/tgui/interfaces/ListInput.js b/tgui/packages/tgui/interfaces/ListInput.js index 6256442fe639..ce11e5c815f9 100644 --- a/tgui/packages/tgui/interfaces/ListInput.js +++ b/tgui/packages/tgui/interfaces/ListInput.js @@ -20,7 +20,7 @@ export const ListInput = (props, context) => { const [showSearchBar, setShowSearchBar] = useLocalState( context, 'search_bar', - false + true ); const [displayedArray, setDisplayedArray] = useLocalState( context, @@ -52,7 +52,7 @@ export const ListInput = (props, context) => { buttons[0] ); return ( - + {timeout !== undefined && } @@ -151,7 +151,7 @@ export const ListInput = (props, context) => { /> } > - + {displayedArray.map((button) => (