From 5aa12b4716568918a4cef4f76881a667c9ae6151 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Tue, 5 Oct 2021 18:10:32 -0300 Subject: [PATCH] There's a bounty for this right? i spent nearly two full days at this --- code/__HELPERS/areas.dm | 2 +- code/__HELPERS/custom_holoforms.dm | 2 +- code/__HELPERS/files.dm | 2 +- code/__HELPERS/text.dm | 6 +- code/__HELPERS/unsorted.dm | 8 +- code/_onclick/hud/ai.dm | 2 +- code/_onclick/hud/movable_screen_objects.dm | 4 +- code/controllers/admin.dm | 2 +- code/controllers/subsystem/mapping.dm | 2 +- code/controllers/subsystem/vote.dm | 4 +- code/datums/action.dm | 4 +- code/datums/browser.dm | 6 +- code/datums/components/material_container.dm | 2 +- code/datums/diseases/advance/advance.dm | 2 +- code/datums/elements/flavor_text.dm | 2 +- code/datums/elements/polychromic.dm | 2 +- code/datums/explosion.dm | 8 +- code/datums/mind.dm | 15 +- code/datums/mutations/actions.dm | 2 +- code/datums/skills/_check_skills.dm | 8 +- code/game/atoms.dm | 18 +- code/game/gamemodes/dynamic/dynamic.dm | 6 +- code/game/gamemodes/gangs/gang.dm | 10 +- code/game/gamemodes/objective.dm | 19 +-- code/game/machinery/PDApainter.dm | 2 +- code/game/machinery/aug_manipulator.dm | 18 +- code/game/machinery/autolathe.dm | 2 +- code/game/machinery/camera/tracking.dm | 2 +- .../machinery/computer/arcade/minesweeper.dm | 6 +- code/game/machinery/computer/atmos_control.dm | 2 +- .../machinery/computer/camera_advanced.dm | 2 +- code/game/machinery/computer/card.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- .../machinery/computer/prisoner/management.dm | 2 +- code/game/machinery/computer/security.dm | 4 +- code/game/machinery/computer/teleporter.dm | 4 +- code/game/machinery/cryopod.dm | 2 +- code/game/machinery/doors/airlock.dm | 4 +- code/game/machinery/hologram.dm | 2 +- code/game/machinery/pipe/construction.dm | 2 +- code/game/machinery/syndicatebomb.dm | 2 +- .../machinery/telecomms/computers/message.dm | 2 +- .../telecomms/machine_interactions.dm | 2 +- code/game/machinery/wishgranter.dm | 2 +- code/game/mecha/equipment/tools/work_tools.dm | 2 +- code/game/mecha/mecha_topic.dm | 2 +- code/game/objects/buckling.dm | 4 +- code/game/objects/items/AI_modules.dm | 4 +- code/game/objects/items/boombox.dm | 2 +- code/game/objects/items/cards_ids.dm | 4 +- .../circuitboards/machine_circuitboards.dm | 6 +- code/game/objects/items/credit_holochip.dm | 2 +- code/game/objects/items/debug_items.dm | 4 +- code/game/objects/items/devices/PDA/PDA.dm | 8 +- code/game/objects/items/devices/PDA/cart.dm | 4 +- .../objects/items/devices/desynchronizer.dm | 2 +- .../items/devices/electrochromatic_kit.dm | 2 +- .../objects/items/devices/pipe_painter.dm | 2 +- .../game/objects/items/devices/polycircuit.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 2 +- code/game/objects/items/devices/scanners.dm | 2 +- code/game/objects/items/dyekit.dm | 2 +- code/game/objects/items/grenades/plastic.dm | 2 +- code/game/objects/items/miscellaneous.dm | 4 +- code/game/objects/items/pinpointer.dm | 2 +- code/game/objects/items/robot/robot_items.dm | 2 +- code/game/objects/items/scrolls.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- code/game/objects/items/storage/dakis.dm | 2 +- code/game/objects/items/teleportation.dm | 2 +- code/game/objects/structures/barsigns.dm | 2 +- .../crates_lockers/closets/genpop.dm | 6 +- code/game/objects/structures/displaycase.dm | 2 +- code/game/objects/structures/dresser.dm | 8 +- .../objects/structures/ghost_role_spawners.dm | 4 +- code/game/objects/structures/mirror.dm | 12 +- code/game/objects/structures/reflector.dm | 2 +- code/game/objects/structures/signs/_signs.dm | 2 +- code/game/objects/structures/spirit_board.dm | 2 +- code/modules/admin/DB_ban/functions.dm | 4 +- code/modules/admin/admin.dm | 10 +- code/modules/admin/admin_investigate.dm | 2 +- code/modules/admin/admin_verbs.dm | 46 +++--- code/modules/admin/callproc/callproc.dm | 8 +- code/modules/admin/create_object.dm | 2 +- code/modules/admin/create_poll.dm | 20 +-- code/modules/admin/permissionedit.dm | 6 +- code/modules/admin/sound_emitter.dm | 6 +- code/modules/admin/sql_message_system.dm | 14 +- code/modules/admin/stickyban.dm | 6 +- code/modules/admin/topic.dm | 78 ++++----- code/modules/admin/verbs/adminhelp.dm | 4 +- code/modules/admin/verbs/adminjump.dm | 6 +- code/modules/admin/verbs/adminpm.dm | 10 +- code/modules/admin/verbs/adminsay.dm | 2 +- code/modules/admin/verbs/borgpanel.dm | 4 +- code/modules/admin/verbs/cinematic.dm | 2 +- code/modules/admin/verbs/deadsay.dm | 2 +- code/modules/admin/verbs/debug.dm | 26 +-- code/modules/admin/verbs/dice.dm | 4 +- code/modules/admin/verbs/fps.dm | 2 +- code/modules/admin/verbs/machine_upgrade.dm | 2 +- code/modules/admin/verbs/manipulate_organs.dm | 8 +- .../admin/verbs/map_template_loadverb.dm | 4 +- code/modules/admin/verbs/mapping.dm | 6 +- code/modules/admin/verbs/maprotation.dm | 2 +- code/modules/admin/verbs/playsound.dm | 6 +- code/modules/admin/verbs/randomverbs.dm | 82 +++++----- code/modules/admin/verbs/secrets.dm | 10 +- code/modules/admin/verbs/shuttlepanel.dm | 4 +- .../admin/view_variables/get_variables.dm | 22 +-- .../view_variables/mass_edit_variables.dm | 2 +- .../admin/view_variables/modify_variables.dm | 4 +- code/modules/admin/view_variables/topic.dm | 2 +- .../admin/view_variables/topic_basic.dm | 2 +- code/modules/antagonists/abductor/abductor.dm | 2 +- code/modules/antagonists/blob/blob/powers.dm | 4 +- .../bloodsucker/datum_bloodsucker.dm | 2 +- code/modules/antagonists/brother/brother.dm | 2 +- .../antagonists/changeling/powers/hivemind.dm | 4 +- .../clockcult/clock_effects/clock_sigils.dm | 2 +- .../clock_effects/spatial_gateway.dm | 2 +- .../clockcult/clock_items/clockwork_slab.dm | 2 +- .../clockcult/clock_mobs/_eminence.dm | 4 +- code/modules/antagonists/cult/blood_magic.dm | 10 +- code/modules/antagonists/cult/cult_items.dm | 2 +- code/modules/antagonists/cult/ritual.dm | 2 +- code/modules/antagonists/cult/runes.dm | 6 +- .../devil/sintouched/sintouched.dm | 2 +- .../eldritch_cult/eldritch_items.dm | 2 +- .../eldritch_cult/eldritch_knowledge.dm | 4 +- .../eldritch_cult/eldritch_magic.dm | 2 +- .../eldritch_cult/eldritch_structures.dm | 2 +- .../nukeop/equipment/borgchameleon.dm | 2 +- .../antagonists/wizard/equipment/artefact.dm | 4 +- code/modules/arousal/arousal.dm | 14 +- code/modules/arousal/genitals.dm | 6 +- code/modules/arousal/toys/dildos.dm | 8 +- code/modules/assembly/doorcontrol.dm | 2 +- .../atmospherics/gasmixtures/gas_mixture.dm | 10 +- .../atmospherics/machinery/airalarm.dm | 2 +- .../components/binary_devices/passive_gate.dm | 2 +- .../components/binary_devices/pump.dm | 2 +- .../components/binary_devices/relief_valve.dm | 4 +- .../components/binary_devices/volume_pump.dm | 2 +- .../machinery/components/components_base.dm | 2 +- .../components/trinary_devices/filter.dm | 2 +- .../components/trinary_devices/mixer.dm | 2 +- .../unary_devices/outlet_injector.dm | 2 +- .../components/unary_devices/relief_valve.dm | 4 +- .../components/unary_devices/thermomachine.dm | 2 +- .../machinery/portable/canister.dm | 6 +- .../awaymissions/bluespaceartillery.dm | 2 +- .../awaymissions/mission_code/wildwest.dm | 2 +- code/modules/buildmode/submodes/advanced.dm | 2 +- code/modules/buildmode/submodes/area_edit.dm | 4 +- code/modules/buildmode/submodes/boom.dm | 10 +- code/modules/buildmode/submodes/fill.dm | 2 +- code/modules/buildmode/submodes/mapgen.dm | 2 +- .../buildmode/submodes/variable_edit.dm | 4 +- .../cargo/blackmarket/blackmarket_uplink.dm | 4 +- code/modules/cargo/centcom_podlauncher.dm | 16 +- code/modules/client/preferences.dm | 154 +++++++++--------- code/modules/client/preferences_toggles.dm | 4 +- code/modules/client/verbs/ooc.dm | 2 +- code/modules/clothing/chameleon.dm | 4 +- code/modules/clothing/under/_under.dm | 2 +- code/modules/economy/paystand.dm | 8 +- code/modules/events/false_alarm.dm | 4 +- code/modules/events/mass_hallucination.dm | 2 +- code/modules/events/wizard/madness.dm | 2 +- .../kitchen_machinery/food_cart.dm | 2 +- .../kitchen_machinery/smartfridge.dm | 2 +- code/modules/food_and_drinks/pizzabox.dm | 2 +- code/modules/holiday/halloween/jacqueen.dm | 6 +- code/modules/hydroponics/grown/towercap.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 2 +- code/modules/hydroponics/seeds.dm | 2 +- code/modules/instruments/songs/editor.dm | 22 +-- .../integrated_electronics/core/assemblies.dm | 6 +- .../integrated_electronics/core/debugger.dm | 4 +- .../integrated_electronics/core/pins.dm | 4 +- .../integrated_electronics/core/printer.dm | 2 +- .../core/special_pins/dir_pin.dm | 4 +- .../core/special_pins/index_pin.dm | 2 +- .../core/special_pins/list_pin.dm | 8 +- .../core/special_pins/number_pin.dm | 2 +- .../integrated_electronics/subtypes/input.dm | 4 +- .../integrated_electronics/subtypes/memory.dm | 6 +- code/modules/language/language_menu.dm | 4 +- code/modules/library/lib_items.dm | 4 +- code/modules/library/lib_machines.dm | 12 +- code/modules/mafia/controller.dm | 4 +- code/modules/mining/abandoned_crates.dm | 2 +- code/modules/mining/aux_base_camera.dm | 2 +- .../mining/equipment/marker_beacons.dm | 4 +- code/modules/mining/fulton.dm | 2 +- .../mining/lavaland/necropolis_chests.dm | 2 +- code/modules/mining/machine_redemption.dm | 4 +- code/modules/mob/dead/dead.dm | 2 +- .../modules/mob/dead/new_player/new_player.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 10 +- code/modules/mob/dead/observer/respawn.dm | 4 +- .../carbon/alien/humanoid/alien_powers.dm | 12 +- code/modules/mob/living/carbon/carbon.dm | 10 +- code/modules/mob/living/carbon/human/human.dm | 10 +- .../human/innate_abilities/customization.dm | 32 ++-- .../living/carbon/human/species_types/ipc.dm | 2 +- .../carbon/human/species_types/jellypeople.dm | 6 +- code/modules/mob/living/silicon/ai/ai.dm | 14 +- code/modules/mob/living/silicon/ai/say.dm | 4 +- .../mob/living/silicon/pai/pai_shell.dm | 6 +- .../mob/living/silicon/pai/software.dm | 4 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 2 +- .../mob/living/simple_animal/bot/floorbot.dm | 4 +- .../mob/living/simple_animal/bot/mulebot.dm | 4 +- .../simple_animal/friendly/drone/verbs.dm | 2 +- .../friendly/drone/visuals_icons.dm | 4 +- .../living/simple_animal/guardian/guardian.dm | 4 +- .../simple_animal/guardian/types/ranged.dm | 2 +- .../mob/living/simple_animal/slime/powers.dm | 2 +- code/modules/mob/mob_transformation_simple.dm | 2 +- code/modules/mob/say.dm | 2 +- code/modules/mob/transform_procs.dm | 4 +- .../computers/item/computer.dm | 2 +- .../file_system/programs/cargoship.dm | 2 +- code/modules/newscaster/newscaster_machine.dm | 2 +- .../suit/ninja_equipment_actions/ninja_net.dm | 2 +- code/modules/paperwork/pen.dm | 4 +- code/modules/photography/camera/camera.dm | 4 +- .../photography/camera/silicon_camera.dm | 2 +- code/modules/plumbing/ducts.dm | 4 +- code/modules/plumbing/plumbers/bottler.dm | 2 +- code/modules/power/cable.dm | 2 +- .../procedural_mapping/mapGenerator.dm | 10 +- code/modules/projectiles/pins.dm | 4 +- code/modules/reagents/chem_wiki_render.dm | 2 +- .../chemistry/machinery/chem_master.dm | 7 +- .../chemistry/machinery/chem_synthesizer.dm | 2 +- code/modules/reagents/reagent_containers.dm | 2 +- .../reagents/reagent_containers/borghypo.dm | 2 +- code/modules/research/destructive_analyzer.dm | 4 +- .../xenobiology/crossbreeding/charged.dm | 2 +- .../crossbreeding/selfsustaining.dm | 2 +- .../xenobiology/crossbreeding/stabilized.dm | 2 +- .../ruins/spaceruin_code/hilbertshotel.dm | 2 +- code/modules/shuttle/assault_pod.dm | 2 +- code/modules/shuttle/navigation_computer.dm | 2 +- .../shuttle/spaceship_navigation_beacon.dm | 2 +- code/modules/smithing/anvil.dm | 2 +- code/modules/spells/spell.dm | 4 +- .../spells/spell_types/area_teleport.dm | 2 +- code/modules/spells/spell_types/devil.dm | 2 +- .../modules/spells/spell_types/devil_boons.dm | 2 +- code/modules/spells/spell_types/shapeshift.dm | 2 +- .../spells/spell_types/voice_of_god.dm | 2 +- code/modules/station_goals/bsa.dm | 2 +- code/modules/surgery/graft_synthtissue.dm | 2 +- code/modules/surgery/helpers.dm | 2 +- code/modules/surgery/organ_manipulation.dm | 2 +- code/modules/surgery/organs/eyes.dm | 2 +- code/modules/surgery/organs/vocal_cords.dm | 10 +- code/modules/surgery/plastic_surgery.dm | 2 +- code/modules/tcg/cards.dm | 8 +- code/modules/vending/_vending.dm | 2 +- code/modules/vore/eating/living.dm | 4 +- code/modules/vore/eating/vorepanel.dm | 34 ++-- .../code/modules/mentor/mentor_memo.dm | 10 +- .../code/modules/mentor/mentorpm.dm | 4 +- 270 files changed, 770 insertions(+), 779 deletions(-) diff --git a/code/__HELPERS/areas.dm b/code/__HELPERS/areas.dm index 84740b2fc3..395cf66758 100644 --- a/code/__HELPERS/areas.dm +++ b/code/__HELPERS/areas.dm @@ -151,7 +151,7 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(/area/engineerin if(!place.requires_power || (place.area_flags & NOTELEPORT) || (place.area_flags & HIDDEN_AREA)) continue // No expanding powerless rooms etc areas[place.name] = place - var/area_choice = input(creator, "Choose an area to expand or make a new area.", "Area Expansion") as null|anything in areas + var/area_choice = tgui_input_list(creator, "Choose an area to expand or make a new area.", "Area Expansion", areas) area_choice = areas[area_choice] if(!area_choice) diff --git a/code/__HELPERS/custom_holoforms.dm b/code/__HELPERS/custom_holoforms.dm index 2733a97e14..b16c3f6c98 100644 --- a/code/__HELPERS/custom_holoforms.dm +++ b/code/__HELPERS/custom_holoforms.dm @@ -60,7 +60,7 @@ S["real_name"] >> name if(name) characters[name] = i - var/chosen_name = input(C, "Which character do you wish to use as your appearance.") as anything in characters + var/chosen_name = tgui_input_list(C, "Which character do you wish to use as your appearance.", "", characters) if(chosen_name) if(C.prefs.last_custom_holoform > world.time - CUSTOM_HOLOFORM_DELAY) to_chat(C.mob, "You are attempting to set your custom holoform too fast!") diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index aad5b4cab1..eac7534827 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -11,7 +11,7 @@ if(path != root) choices.Insert(1,"/") - var/choice = input(src,"Choose a file to access:","Download",null) as null|anything in choices + var/choice = tgui_input_list(src,"Choose a file to access:","Download", choices) switch(choice) if(null) return diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 62703ab2e6..8e2cff6a49 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -93,7 +93,7 @@ // Used to get a properly sanitized input, of max_length // no_trim is self explanatory but it prevents the input from being trimed if you intend to parse newlines or whitespace. /proc/stripped_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE) - var/name = input(user, message, title, default) as text|null + var/name = tgui_input_text(user, message, title, default) if(no_trim) return copytext(html_encode(name), 1, max_length) else @@ -101,7 +101,7 @@ // Used to get a properly sanitized multiline input, of max_length /proc/stripped_multiline_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE) - var/name = input(user, message, title, default) as message|null + var/name = tgui_input_message(user, message, title, default) if(isnull(name)) // Return null if canceled. return null if(no_trim) @@ -113,7 +113,7 @@ * stripped_multiline_input but reflects to the user instead if it's too big and returns null. */ /proc/stripped_multiline_input_or_reflect(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE) - var/name = input(user, message, title, default) as message|null + var/name = tgui_input_message(user, message, title, default) if(isnull(name)) // Return null if canceled. return null if(length(name) > max_length) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9fee97bbb1..daad573c5a 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -249,7 +249,7 @@ Turf and target are separate in case you want to teleport some distance from a t var/list/borgs = active_free_borgs() if(borgs.len) if(user) - . = input(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs[1]) in borgs + . = tgui_input_list(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs) else . = pick(borgs) return . @@ -258,7 +258,7 @@ Turf and target are separate in case you want to teleport some distance from a t var/list/ais = active_ais() if(ais.len) if(user) - . = input(user,"AI signals detected:", "AI Selection", ais[1]) in ais + . = tgui_input_list(user,"AI signals detected:", "AI Selection", ais) else . = pick(ais) return . @@ -1075,7 +1075,7 @@ B --><-- A /proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) if (value == FALSE) //nothing should be calling us with a number, so this is safe - value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text + value = tgui_input_text(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") if (isnull(value)) return value = trim(value) @@ -1089,7 +1089,7 @@ B --><-- A if(matches.len==1) chosen = matches[1] else - chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in matches + chosen = tgui_input_list(usr, "Select a type", "Pick Type", matches) if(!chosen) return chosen = matches[chosen] diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index 17b5a9ed61..7a21a3f338 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -33,7 +33,7 @@ if(..()) return var/mob/living/silicon/ai/AI = usr - var/target_name = input(AI, "Choose who you want to track", "Tracking") as null|anything in AI.trackable_mobs() + var/target_name = tgui_input_list(AI, "Choose who you want to track", "Tracking", AI.trackable_mobs()) AI.ai_camera_track(target_name) /atom/movable/screen/ai/camera_light diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index eeb56d67f5..7d75fd8b5a 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -62,7 +62,7 @@ M.maptext = "Movable" M.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text + var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") if(!screen_l) return @@ -81,7 +81,7 @@ S.maptext = "Snap" S.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text + var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") if(!screen_l) return diff --git a/code/controllers/admin.dm b/code/controllers/admin.dm index 5c767ecb1b..17341a3970 100644 --- a/code/controllers/admin.dm +++ b/code/controllers/admin.dm @@ -80,7 +80,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) controllers["[controller] (controller.type)"] = controller //we use an associated list to ensure clients can't hold references to controllers controller_choices += "[controller] (controller.type)" - var/datum/controller/controller_string = input("Select controller to debug", "Debug Controller") as null|anything in controller_choices + var/datum/controller/controller_string = tgui_input_list(src, "Select controller to debug", "Debug Controller", controller_choices) var/datum/controller/controller = controllers[controller_string] if (!istype(controller)) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index fb8ad4a078..b231546bb7 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -503,7 +503,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) var/away_name var/datum/space_level/away_level - var/answer = input("What kind ? ","Away/VR") as null|anything in list(possible_options + "Custom") + var/answer = tgui_input_list(src, "What kind ? ","Away/VR", list(possible_options + "Custom")) switch(answer) if(null) return diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 1153088a91..4a51e19103 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -505,7 +505,7 @@ SUBSYSTEM_DEF(vote) question = stripped_input(usr,"What is the vote for?") if(!question) return 0 - var/system_string = input(usr,"Which voting type?",GLOB.vote_type_names[1]) in GLOB.vote_type_names + var/system_string = tgui_input_list(usr,"Which voting type?",GLOB.vote_type_names[1], GLOB.vote_type_names) vote_system = GLOB.vote_type_names[system_string] for(var/i=1,i<=10,i++) var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish")) @@ -521,7 +521,7 @@ SUBSYSTEM_DEF(vote) var/bitflag = GLOB.display_vote_settings[A] toggletext = "[toggles & bitflag ? "Show" : "Hide"] [A]" choices[toggletext] = bitflag - var/chosen = input(usr, "Toggle vote display settings. Cancel to finalize.", toggles) as null|anything in choices + var/chosen = tgui_input_list(usr, "Toggle vote display settings. Cancel to finalize.", toggles, choices) if(!chosen) keep_going = FALSE else diff --git a/code/datums/action.dm b/code/datums/action.dm index 1a8ea7a60f..ffc14bffc0 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -564,7 +564,7 @@ var/list/areas = list() for (var/area/a in owner.siliconaccessareas) areas[a.name] = a - var/removeAPC = input("Select an APC to remove:","Remove APC Control",1) as null|anything in areas + var/removeAPC = tgui_input_list("Select an APC to remove:","Remove APC Control", areas) if (!removeAPC) return var/area/area = areas[removeAPC] @@ -586,7 +586,7 @@ var/list/areas = list() for (var/area/a in owner.siliconaccessareas) areas[a.name] = a - var/accessAPC = input("Select an APC to access:","Access APC Interface",1) as null|anything in areas + var/accessAPC = tgui_input_list("Select an APC to access:","Access APC Interface", areas) if (!accessAPC) return var/area/area = areas[accessAPC] diff --git a/code/datums/browser.dm b/code/datums/browser.dm index 2057cbb21a..1663f8b5c6 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -376,13 +376,13 @@ if ("string") settings["mainsettings"][setting]["value"] = stripped_input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]", settings["mainsettings"][setting]["value"]) if ("number") - settings["mainsettings"][setting]["value"] = input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]") as num + settings["mainsettings"][setting]["value"] = tgui_input_num(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]") if ("color") settings["mainsettings"][setting]["value"] = input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]", settings["mainsettings"][setting]["value"]) as color if ("boolean") - settings["mainsettings"][setting]["value"] = input(user, "[settings["mainsettings"][setting]["desc"]]?") in list("Yes","No") + settings["mainsettings"][setting]["value"] = tgui_input_list(user, "[settings["mainsettings"][setting]["desc"]]?", "", list("Yes","No")) if ("ckey") - settings["mainsettings"][setting]["value"] = input(user, "[settings["mainsettings"][setting]["desc"]]?") in list("none") + GLOB.directory + settings["mainsettings"][setting]["value"] = tgui_input_list(user, "[settings["mainsettings"][setting]["desc"]]?", "", list("none") + GLOB.directory) if (settings["mainsettings"][setting]["callback"]) var/datum/callback/callback = settings["mainsettings"][setting]["callback"] settings = callback.Invoke(settings) diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index cc988544b8..05f614842f 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -125,7 +125,7 @@ //try to get ammount to use var/requested_amount if(precise_insertion) - requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null + requested_amount = tgui_input_num(user, "How much do you want to insert?", "Inserting [S.singular_name]s") else requested_amount= S.amount diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 7e3ac29b2d..8496d95442 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -450,7 +450,7 @@ symptoms += SSdisease.list_symptoms.Copy() do if(user) - var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms + var/symptom = tgui_input_list(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom", symptoms) if(isnull(symptom)) return else if(istext(symptom)) diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index 6217665157..d2e1c07eff 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -112,7 +112,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code var/datum/element/flavor_text/F = i choices[F.flavor_name] = F - var/chosen = input(src, "Which flavor text would you like to modify?") as null|anything in choices + var/chosen = tgui_input_list(src, "Which flavor text would you like to modify?", "", choices) if(!chosen) return var/datum/element/flavor_text/F = choices[chosen] diff --git a/code/datums/elements/polychromic.dm b/code/datums/elements/polychromic.dm index 5e888e0609..70de6ca279 100644 --- a/code/datums/elements/polychromic.dm +++ b/code/datums/elements/polychromic.dm @@ -122,7 +122,7 @@ overlays += mutable_appearance(f_icon, overlays_states[i], color = M.color) /datum/element/polychromic/proc/set_color(atom/source, mob/user) - var/choice = input(user,"Polychromic options", "Recolor [source]") as null|anything in overlays_names + var/choice = tgui_input_list(user,"Polychromic options", "Recolor [source]", overlays_names) if(!choice || QDELETED(source) || !user.canUseTopic(source, BE_CLOSE, NO_DEXTERY)) return var/index = overlays_names.Find(choice) diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index a7add7cc3c..63131dc4ff 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -394,7 +394,7 @@ GLOBAL_LIST_EMPTY(explosions) var/heavy = 0 var/light = 0 var/list/choices = list("Small Bomb","Medium Bomb","Big Bomb","Custom Bomb") - var/choice = input("Bomb Size?") in choices + var/choice = tgui_input_list(src, "Bomb Size?", "", choices) switch(choice) if(null) return 0 @@ -411,9 +411,9 @@ GLOBAL_LIST_EMPTY(explosions) heavy = 5 light = 7 if("Custom Bomb") - dev = input("Devastation range (Tiles):") as num - heavy = input("Heavy impact range (Tiles):") as num - light = input("Light impact range (Tiles):") as num + dev = tgui_input_num(src, "Devastation range (Tiles):") + heavy = tgui_input_num(src, "Heavy impact range (Tiles):") + light = tgui_input_num(src, "Light impact range (Tiles):") var/max_range = max(dev, heavy, light) var/x0 = epicenter.x diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 897e2e7d71..10309e67c9 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -419,7 +419,7 @@ A.admin_remove(usr) if (href_list["role_edit"]) - var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs() + var/new_role = tgui_input_list(usr, "Select new role", "Assigned role", get_all_jobs()) if (!new_role) return assigned_role = new_role @@ -432,7 +432,6 @@ else if (href_list["obj_edit"] || href_list["obj_add"]) var/objective_pos //Edited objectives need to keep same order in antag objective list - var/def_value var/datum/antagonist/target_antag var/datum/objective/old_objective //The old objective we're replacing/editing var/datum/objective/new_objective //New objective we're be adding @@ -460,7 +459,7 @@ if(1) target_antag = antag_datums[1] else - var/datum/antagonist/target = input("Which antagonist gets the objective:", "Antagonist", "(new custom antag)") as null|anything in antag_datums + "(new custom antag)" + var/datum/antagonist/target = tgui_input_list(usr, "Which antagonist gets the objective:", "Antagonist", list(antag_datums + "(new custom antag)")) if (QDELETED(target)) return else if(target == "(new custom antag)") @@ -494,11 +493,7 @@ var/datum/objective/X = T choices[initial(X.name)] = T - if(old_objective) - if(old_objective.name in choices) - def_value = old_objective.name - - var/selected_type = input("Select objective type:", "Objective type", def_value) as null|anything in choices + var/selected_type = tgui_input_list(usr, "Select objective type:", "Objective type", choices) selected_type = choices[selected_type] if (!selected_type) return @@ -536,7 +531,7 @@ choices[initial(t.employer)] = C var/datum/antagonist/traitor/T = locate(href_list["target_antag"]) in antag_datums if(T) - var/selected_type = input("Select traitor class:", "Traitor class", T.traitor_kind.employer) as null|anything in choices + var/selected_type = tgui_input_list(usr, "Select traitor class:", "Traitor class", choices) selected_type = choices[selected_type] T.set_traitor_kind(selected_type) @@ -597,7 +592,7 @@ if(check_rights(R_FUN, 0)) var/datum/component/uplink/U = find_syndicate_uplink() if(U) - var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.telecrystals) as null | num + var/crystals = tgui_input_num(usr, "Amount of telecrystals for [key]","Syndicate uplink", U.telecrystals) if(!isnull(crystals)) U.telecrystals = crystals message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].") diff --git a/code/datums/mutations/actions.dm b/code/datums/mutations/actions.dm index 8f7d67abb8..d2656dee97 100644 --- a/code/datums/mutations/actions.dm +++ b/code/datums/mutations/actions.dm @@ -242,7 +242,7 @@ if(!length(possible)) to_chat(user,"Despite your best efforts, there are no scents to be found on [sniffed]...") return - tracking_target = input(user, "Choose a scent to remember.", "Scent Tracking") as null|anything in sortNames(possible) + tracking_target = tgui_input_list(user, "Choose a scent to remember.", "Scent Tracking", sortNames(possible)) if(!tracking_target) if(!old_target) to_chat(user,"You decide against remembering any scents. Instead, you notice your own nose in your peripheral vision. This goes on to remind you of that one time you started breathing manually and couldn't stop. What an awful day that was.") diff --git a/code/datums/skills/_check_skills.dm b/code/datums/skills/_check_skills.dm index 91b36a123f..4d03559c06 100644 --- a/code/datums/skills/_check_skills.dm +++ b/code/datums/skills/_check_skills.dm @@ -21,7 +21,7 @@ ui = SStgui.try_update_ui(user, src, ui) if(!ui) ui = new(user, src, "SkillPanel", "[owner.name]'s Skills") - ui.set_autoupdate(FALSE) + ui.set_autoupdate(FALSE) ui.open() else if(need_static_data_update) update_static_data(user) @@ -57,7 +57,7 @@ if(!check_rights(R_DEBUG)) return var/skill = text2path(params["skill"]) - var/number = input("Please insert the amount of experience/progress you'd like to add/subtract:") as num|null + var/number = tgui_input_num(usr, "Please insert the amount of experience/progress you'd like to add/subtract:") if (number) owner.set_skill_value(skill, owner.get_skill_value(skill, FALSE) + number) return TRUE @@ -65,7 +65,7 @@ if(!check_rights(R_DEBUG)) return var/skill = text2path(params["skill"]) - var/number = input("Please insert the number you want to set the player's exp/progress to:") as num|null + var/number = tgui_input_num(usr, "Please insert the number you want to set the player's exp/progress to:") if (!isnull(number)) owner.set_skill_value(skill, number) return TRUE @@ -73,7 +73,7 @@ if(!check_rights(R_DEBUG)) return var/datum/skill/level/S = GLOB.skill_datums[text2path(params["skill"])] - var/number = input("Please insert a whole number between 0[S.associative ? " ([S.unskilled_tier])" : ""] and [S.max_levels][S.associative ? " ([S.levels[S.max_levels]])" : ""] corresponding to the level you'd like to set the player to.") as num|null + var/number = tgui_input_num(usr, "Please insert a whole number between 0[S.associative ? " ([S.unskilled_tier])" : ""] and [S.max_levels][S.associative ? " ([S.levels[S.max_levels]])" : ""] corresponding to the level you'd like to set the player to.") if (number >= 0 && number <= S.max_levels) owner.set_skill_value(S.type, S.get_skill_level_value(number)) return TRUE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 48213279f1..5e3db3d93c 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -985,14 +985,14 @@ . = ..() if(href_list[VV_HK_ADD_REAGENT] && check_rights(R_VAREDIT)) if(!reagents) - var/amount = input(usr, "Specify the reagent size of [src]", "Set Reagent Size", 50) as num + var/amount = tgui_input_num(usr, "Specify the reagent size of [src]", "Set Reagent Size", 50) if(amount) create_reagents(amount) if(reagents) var/chosen_id = choose_reagent_id(usr) if(chosen_id) - var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", reagents.maximum_volume) as num + var/amount = tgui_input_num(usr, "Choose the amount to add.", "Choose the amount.", reagents.maximum_volume) if(amount) reagents.add_reagent(chosen_id, amount) log_admin("[key_name(usr)] has added [amount] units of [chosen_id] to [src]") @@ -1002,25 +1002,25 @@ if(href_list[VV_HK_TRIGGER_EMP] && check_rights(R_FUN)) usr.client.cmd_admin_emp(src) if(href_list[VV_HK_MODIFY_TRANSFORM] && check_rights(R_VAREDIT)) - var/result = input(usr, "Choose the transformation to apply","Transform Mod") as null|anything in list("Scale","Translate","Rotate") + var/result = tgui_input_list(usr, "Choose the transformation to apply","Transform Mod", list("Scale","Translate","Rotate")) var/matrix/M = transform switch(result) if("Scale") - var/x = input(usr, "Choose x mod","Transform Mod") as null|num - var/y = input(usr, "Choose y mod","Transform Mod") as null|num + var/x = tgui_input_num(usr, "Choose x mod","Transform Mod") + var/y = tgui_input_num(usr, "Choose y mod","Transform Mod") if(!isnull(x) && !isnull(y)) transform = M.Scale(x,y) if("Translate") - var/x = input(usr, "Choose x mod","Transform Mod") as null|num - var/y = input(usr, "Choose y mod","Transform Mod") as null|num + var/x = tgui_input_num(usr, "Choose x mod","Transform Mod") + var/y = tgui_input_num(usr, "Choose y mod","Transform Mod") if(!isnull(x) && !isnull(y)) transform = M.Translate(x,y) if("Rotate") - var/angle = input(usr, "Choose angle to rotate","Transform Mod") as null|num + var/angle = tgui_input_num(usr, "Choose angle to rotate","Transform Mod") if(!isnull(angle)) transform = M.Turn(angle) if(href_list[VV_HK_AUTO_RENAME] && check_rights(R_VAREDIT)) - var/newname = input(usr, "What do you want to rename this to?", "Automatic Rename") as null|text + var/newname = tgui_input_text(usr, "What do you want to rename this to?", "Automatic Rename") if(newname) vv_auto_rename(newname) if(href_list[VV_HK_EDIT_FILTERS] && check_rights(R_VAREDIT)) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 0839f25137..2824c97403 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -191,7 +191,7 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) else if (href_list["classic_secret"]) GLOB.dynamic_classic_secret = !GLOB.dynamic_classic_secret else if (href_list["adjustthreat"]) - var/threatadd = input("Specify how much threat to add (negative to subtract). This can inflate the threat level.", "Adjust Threat", 0) as null|num + var/threatadd = tgui_input_num(usr, "Specify how much threat to add (negative to subtract). This can inflate the threat level.", "Adjust Threat", 0) if(!threatadd) return create_threat(threatadd) @@ -206,13 +206,13 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) else if (href_list["threatlog"]) show_threatlog(usr) else if (href_list["stacking_limit"]) - GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num + GLOB.dynamic_stacking_limit = tgui_input_num(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) else if (href_list["change_storyteller"]) var/list/choices = list() for(var/T in config.storyteller_cache) var/datum/dynamic_storyteller/S = T choices[initial(S.name)] = T - var/selected_storyteller = choices[input("Select storyteller:", "Storyteller", storyteller.name) as null|anything in choices] + var/selected_storyteller = choices[tgui_input_list(usr, "Select storyteller:", "Storyteller", choices)] storyteller = new selected_storyteller storyteller.on_start() message_admins("[key_name(usr)] changed the storyteller to [storyteller].", 1) diff --git a/code/game/gamemodes/gangs/gang.dm b/code/game/gamemodes/gangs/gang.dm index 6efdf2a4aa..d5231e97fe 100644 --- a/code/game/gamemodes/gangs/gang.dm +++ b/code/game/gamemodes/gangs/gang.dm @@ -108,11 +108,11 @@ .["Set domination time left"] = CALLBACK(src, .proc/set_dom_time_left) /datum/antagonist/gang/admin_add(datum/mind/new_owner,mob/admin) - var/new_or_existing = input(admin, "Which gang do you want to be assigned to the user?", "Gangs") as null|anything in list("New","Existing") + var/new_or_existing = tgui_input_list(admin, "Which gang do you want to be assigned to the user?", "Gangs", list("New","Existing")) if(isnull(new_or_existing)) return else if(new_or_existing == "New") - var/newgang = input(admin, "Select a gang, or select random to pick a random one.", "New gang") as null|anything in GLOB.possible_gangs + "Random" + var/newgang = tgui_input_list(admin, "Select a gang, or select random to pick a random one.", "New gang", GLOB.possible_gangs + "Random") if(isnull(newgang)) return else if(newgang == "Random") @@ -125,7 +125,7 @@ if(!GLOB.gangs.len) // no gangs exist to_chat(admin, "No gangs exist, please create a new one instead.") return - var/existinggang = input(admin, "Select a gang, or select random to pick a random one.", "Existing gang") as null|anything in GLOB.gangs + "Random" + var/existinggang = tgui_input_list(admin, "Select a gang, or select random to pick a random one.", "Existing gang", GLOB.gangs + "Random") if(isnull(existinggang)) return else if(existinggang == "Random") @@ -141,7 +141,7 @@ promote() /datum/antagonist/gang/proc/admin_adjust_influence() - var/inf = input("Influence for [gang.name]","Gang influence", gang.influence) as null | num + var/inf = tgui_input_num("Influence for [gang.name]","Gang influence", gang.influence) if(!isnull(inf)) gang.influence = inf message_admins("[key_name_admin(usr)] changed [gang.name]'s influence to [inf].") @@ -158,7 +158,7 @@ /datum/antagonist/gang/proc/set_dom_time_left(mob/admin) if(gang.domination_time == NOT_DOMINATING) return // an admin shouldn't need this - var/seconds = input(admin, "Set the time left for the gang to win, in seconds", "Domination time left") as null|num + var/seconds = tgui_input_num(admin, "Set the time left for the gang to win, in seconds", "Domination time left", (gang.domination_time - world.time) * 0.1) if(seconds && seconds > 0) gang.domination_time = world.time + seconds*10 gang.message_gangtools("Takeover shortened to [gang.domination_time_remaining()] seconds by your Syndicate benefactors.") diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 1c6c444fb4..0dd0e79ef8 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -39,16 +39,11 @@ GLOBAL_LIST_EMPTY(objectives) //Shared by few objective types /datum/objective/proc/admin_simple_target_pick(mob/admin) var/list/possible_targets = list("Free objective") - var/def_value for(var/datum/mind/possible_target in SSticker.minds) if ((possible_target != src) && ishuman(possible_target.current)) possible_targets += possible_target.current - - if(target && target.current) - def_value = target.current - - var/mob/new_target = input(admin,"Select target:", "Objective target", def_value) as null|anything in possible_targets + var/mob/new_target = tgui_input_list(admin,"Select target:", "Objective target", possible_targets) if (!new_target) return @@ -605,12 +600,12 @@ GLOBAL_LIST_EMPTY(possible_items) /datum/objective/steal/admin_edit(mob/admin) var/list/possible_items_all = GLOB.possible_items+"custom" - var/new_target = input(admin,"Select target:", "Objective target", steal_target) as null|anything in possible_items_all + var/new_target = tgui_input_list(admin,"Select target:", "Objective target", possible_items_all) if (!new_target) return if (new_target == "custom") //Can set custom items. - var/custom_path = input(admin,"Search for target item type:","Type") as null|text + var/custom_path = tgui_input_text(admin,"Search for target item type:","Type") if (!custom_path) return var/obj/item/custom_target = pick_closest_path(custom_path, make_types_fancy(subtypesof(/obj/item))) @@ -727,7 +722,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) return checking.researched_nodes.len >= target_amount /datum/objective/download/admin_edit(mob/admin) - var/count = input(admin,"How many nodes ?","Nodes",target_amount) as num|null + var/count = tgui_input_num(admin,"How many nodes ?","Nodes",target_amount) if(count) target_amount = count update_explanation_text() @@ -773,7 +768,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) return captured_amount >= target_amount /datum/objective/capture/admin_edit(mob/admin) - var/count = input(admin,"How many mobs to capture ?","capture",target_amount) as num|null + var/count = tgui_input_num(admin,"How many mobs to capture ?","capture",target_amount) if(count) target_amount = count update_explanation_text() @@ -805,7 +800,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) explanation_text = "Extract [target_amount] compatible genome\s." /datum/objective/absorb/admin_edit(mob/admin) - var/count = input(admin,"How many people to absorb?","absorb",target_amount) as num|null + var/count = tgui_input_num(admin,"How many people to absorb?","absorb",target_amount) if(count) target_amount = count update_explanation_text() @@ -895,7 +890,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) /datum/objective/destroy/admin_edit(mob/admin) var/list/possible_targets = active_ais(1) if(possible_targets.len) - var/mob/new_target = input(admin,"Select target:", "Objective target") as null|anything in possible_targets + var/mob/new_target = tgui_input_list(admin,"Select target:", "Objective target", possible_targets) target = new_target.mind else to_chat(admin, "No active AIs with minds") diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index 82209221ce..809eb3d9af 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -112,7 +112,7 @@ if(!storedpda) to_chat(user, "[src] is empty.") return - var/choice = input(user, "Select the new skin!", "PDA Painting") as null|anything in colorlist + var/choice = tgui_input_list(user, "Select the new skin!", "PDA Painting", colorlist) if(!choice || !storedpda || !in_range(src, user)) return var/list/P = colorlist[choice] diff --git a/code/game/machinery/aug_manipulator.dm b/code/game/machinery/aug_manipulator.dm index e496973d75..2b982f7480 100644 --- a/code/game/machinery/aug_manipulator.dm +++ b/code/game/machinery/aug_manipulator.dm @@ -8,14 +8,14 @@ max_integrity = 200 var/obj/item/bodypart/storedpart var/initial_icon_state - var/static/list/style_list_icons = list("standard" = 'icons/mob/augmentation/augments.dmi', - "engineer" = 'icons/mob/augmentation/augments_engineer.dmi', - "security" = 'icons/mob/augmentation/augments_security.dmi', - "mining" = 'icons/mob/augmentation/augments_mining.dmi', - "Talon" = 'icons/mob/augmentation/cosmetic_prosthetic/talon.dmi', - "Nanotrasen" = 'icons/mob/augmentation/cosmetic_prosthetic/nanotrasen.dmi', - "Hephaesthus" = 'icons/mob/augmentation/cosmetic_prosthetic/hephaestus.dmi', - "Bishop" = 'icons/mob/augmentation/cosmetic_prosthetic/bishop.dmi', + var/static/list/style_list_icons = list("standard" = 'icons/mob/augmentation/augments.dmi', + "engineer" = 'icons/mob/augmentation/augments_engineer.dmi', + "security" = 'icons/mob/augmentation/augments_security.dmi', + "mining" = 'icons/mob/augmentation/augments_mining.dmi', + "Talon" = 'icons/mob/augmentation/cosmetic_prosthetic/talon.dmi', + "Nanotrasen" = 'icons/mob/augmentation/cosmetic_prosthetic/nanotrasen.dmi', + "Hephaesthus" = 'icons/mob/augmentation/cosmetic_prosthetic/hephaestus.dmi', + "Bishop" = 'icons/mob/augmentation/cosmetic_prosthetic/bishop.dmi', "Xion" = 'icons/mob/augmentation/cosmetic_prosthetic/xion.dmi', "Grayson" = 'icons/mob/augmentation/cosmetic_prosthetic/grayson.dmi', "Cybersolutions" = 'icons/mob/augmentation/cosmetic_prosthetic/cybersolutions.dmi', @@ -116,7 +116,7 @@ add_fingerprint(user) if(storedpart) - var/augstyle = input(user, "Select style.", "Augment Custom Fitting") as null|anything in style_list_icons + var/augstyle = tgui_input_list(user, "Select style.", "Augment Custom Fitting", style_list_icons) if(!augstyle) return if(!in_range(src, user)) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 0e7b4aa0fa..c734e2b265 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -184,7 +184,7 @@ if(materials.materials[i] > 0) list_to_show += i - used_material = input("Choose [used_material]", "Custom Material") as null|anything in sortList(list_to_show, /proc/cmp_typepaths_asc) + used_material = tgui_input_list(usr, "Choose [used_material]", "Custom Material", sortList(list_to_show, /proc/cmp_typepaths_asc)) if(!used_material) return //Didn't pick any material, so you can't build shit either. custom_materials[used_material] += amount_needed diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index bf1b84fe5d..8966fc03f1 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -16,7 +16,7 @@ /mob/living/silicon/ai/proc/show_camera_list() var/list/cameras = get_camera_list() - var/camera = input(src, "Choose which camera you want to view", "Cameras") as null|anything in cameras + var/camera = tgui_input_list(src, "Choose which camera you want to view", "Cameras", cameras) switchCamera(cameras[camera]) /datum/trackable diff --git a/code/game/machinery/computer/arcade/minesweeper.dm b/code/game/machinery/computer/arcade/minesweeper.dm index 1027ab1815..c9c5b30794 100644 --- a/code/game/machinery/computer/arcade/minesweeper.dm +++ b/code/game/machinery/computer/arcade/minesweeper.dm @@ -301,12 +301,12 @@ /obj/machinery/computer/arcade/minesweeper/proc/custom_generation(mob/user) playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) //Entered into the menu so ping sound - var/new_rows = input(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") as null|num + var/new_rows = tgui_input_num(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user))) return FALSE new_rows = clamp(new_rows + 1, 4, 20) playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) - var/new_columns = input(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") as null|num + var/new_columns = tgui_input_num(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user))) return FALSE new_columns = clamp(new_columns + 1, 4, 30) @@ -314,7 +314,7 @@ var/grid_area = (new_rows - 1) * (new_columns - 1) var/lower_limit = round(grid_area*0.156) var/upper_limit = round(grid_area*0.85) - var/new_mine_limit = input(user, "How many mines do you want? (Minimum: [lower_limit], Maximum: [upper_limit])", "Minesweeper Mines") as null|num + var/new_mine_limit = tgui_input_num(user, "How many mines do you want? (Minimum: [lower_limit], Maximum: [upper_limit])", "Minesweeper Mines") if(!new_mine_limit || !user.canUseTopic(src, !hasSiliconAccessInArea(user))) return FALSE playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index fa552a4e66..d35505ce7e 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -251,7 +251,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers) IO |= text[1] if(!IO.len) to_chat(user, "No machinery detected.") - var/S = input("Select the device set: ", "Selection", IO[1]) as anything in sortList(IO) + var/S = tgui_input_list(user, "Select the device set: ", "Selection", sortList(IO)) if(src) src.input_tag = "[S]_in" src.output_tag = "[S]_out" diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 9d675bc5dd..0167fd0243 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -269,7 +269,7 @@ T["[netcam.c_tag][netcam.can_use() ? null : " (Deactivated)"]"] = netcam 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(usr, "Choose which camera you want to view", "Cameras", T) var/obj/machinery/camera/final = T[camera] playsound(src, "terminal_type", 25, 0) if(final) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 46d419a8fe..d91c2a2dab 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -447,7 +447,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if (authenticated == 2) var/t1 = href_list["assign_target"] if(t1 == "Custom") - var/newJob = reject_bad_text(input("Enter a custom job assignment.", "Assignment", inserted_modify_id ? inserted_modify_id.assignment : "Unassigned"), MAX_NAME_LEN) + var/newJob = reject_bad_text(tgui_input_text(usr, "Enter a custom job assignment.", "Assignment", inserted_modify_id ? inserted_modify_id.assignment : "Unassigned"), MAX_NAME_LEN) if(newJob) t1 = newJob diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 7f5fafcd80..43f8f71185 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -289,7 +289,7 @@ active1.fields["gender"] = "Male" if("age") if(active1) - var/t1 = input("Please input age:", "Med. records", active1.fields["age"], null) as num + var/t1 = tgui_input_num(usr, "Please input age:", "Med. records", active1.fields["age"]) if(!canUseMedicalRecordsConsole(usr, t1, a1)) return active1.fields["age"] = t1 diff --git a/code/game/machinery/computer/prisoner/management.dm b/code/game/machinery/computer/prisoner/management.dm index 43aa978558..8b34b54b03 100644 --- a/code/game/machinery/computer/prisoner/management.dm +++ b/code/game/machinery/computer/prisoner/management.dm @@ -99,7 +99,7 @@ if("reset") contained_id.points = 0 if("setgoal") - var/num = round(input(usr, "Choose prisoner's goal:", "Input an Integer", null) as num|null) + var/num = round(tgui_input_num(usr, "Choose prisoner's goal:", "Input an Integer", contained_id.goal)) if(num >= 0) num = min(num,1000) //Cap the quota to the equivilent of 10 minutes. contained_id.goal = num diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 681a903bef..5a851ffc66 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -577,13 +577,13 @@ What a mess.*/ active1.fields["gender"] = "Male" if("age") if(istype(active1, /datum/data/record)) - var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num + var/t1 = tgui_input_num(usr, "Please input age:", "Secure. records", active1.fields["age"]) if(!canUseSecurityRecordsConsole(usr, "age", a1)) return active1.fields["age"] = t1 if("species") if(istype(active1, /datum/data/record)) - var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_races + var/t1 = stripped_input("Please input species name", "Secure. records", active1.fields["species"], null) if(!canUseSecurityRecordsConsole(usr, t1, a1)) return active1.fields["species"] = t1 diff --git a/code/game/machinery/computer/teleporter.dm b/code/game/machinery/computer/teleporter.dm index 3e9531097e..0dd64bf3e8 100644 --- a/code/game/machinery/computer/teleporter.dm +++ b/code/game/machinery/computer/teleporter.dm @@ -139,7 +139,7 @@ if(is_eligible(M)) L[avoid_assoc_duplicate_keys(M.real_name, areaindex)] = M - var/desc = input("Please select a location to lock in.", "Locking Computer") as null|anything in L + var/desc = tgui_input_list(user, "Please select a location to lock in.", "Locking Computer", L) if(!user.canUseTopic(src, !hasSiliconAccessInArea(user), NO_DEXTERY)) //check if we are still around return target = L[desc] @@ -167,7 +167,7 @@ if(!L.len) to_chat(user, "No active connected stations located.") return - var/desc = input("Please select a station to lock in.", "Locking Computer") as null|anything in L + var/desc = tgui_input_list(user, "Please select a station to lock in.", "Locking Computer", L) if(!user.canUseTopic(src, !hasSiliconAccessInArea(user), NO_DEXTERY)) //again, check if we are still around return var/obj/machinery/teleport/station/target_station = L[desc] diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 41c60dd18c..9474320894 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -101,7 +101,7 @@ updateUsrDialog() return - var/obj/I = input(user, "Please choose which object to retrieve.","Object recovery",null) as null|anything in stored_packages + var/obj/I = tgui_input_list(user, "Please choose which object to retrieve.","Object recovery", stored_packages) playsound(src, "terminal_type", 25, 0) if(!I) return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 982e40a79b..39749b33fa 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -102,7 +102,7 @@ rad_insulation = RAD_MEDIUM_INSULATION var/static/list/airlock_overlays = list() - + /// sigh var/unelectrify_timerid @@ -1212,7 +1212,7 @@ else optionlist = list("Standard", "Public", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Freezer", "Science", "Virology", "Mining", "Maintenance", "External", "External Maintenance") - var/paintjob = input(user, "Please select a paintjob for this airlock.") in optionlist + var/paintjob = tgui_input_list(user, "Please select a paintjob for this airlock.", "", optionlist) if((!in_range(src, usr) && src.loc != usr) || !W.use_paint(user)) return switch(paintjob) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 853bd73eac..5b2551fa8b 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -264,7 +264,7 @@ GLOBAL_LIST_EMPTY(network_holopads) if(A) LAZYADD(callnames[A], I) callnames -= get_area(src) - var/result = input(usr, "Choose an area to call", "Holocall") as null|anything in sortNames(callnames) + var/result = tgui_input_list(usr, "Choose an area to call", "Holocall", sortNames(callnames)) if(QDELETED(usr) || !result || outgoing_call) return if(usr.loc == loc) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 5b30105409..4d6900983f 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -245,7 +245,7 @@ Buildable meters disposable = FALSE /obj/item/pipe/bluespace/attack_self(mob/user) - var/new_name = input(user, "Enter identifier for bluespace pipe network", "bluespace pipe", bluespace_network_name) as text|null + var/new_name = tgui_input_text(user, "Enter identifier for bluespace pipe network", "bluespace pipe", bluespace_network_name) if(!isnull(new_name)) bluespace_network_name = new_name diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 9bbbbc46bb..54663356c7 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -193,7 +193,7 @@ playsound(loc, 'sound/machines/click.ogg', 30, 1) /obj/machinery/syndicatebomb/proc/settings(mob/user) - var/new_timer = input(user, "Please set the timer.", "Timer", "[timer_set]") as num + var/new_timer = tgui_input_num(user, "Please set the timer.", "Timer", "[timer_set]") if(in_range(src, user) && isliving(user)) //No running off and setting bombs from across the station timer_set = clamp(new_timer, minimum_timer, maximum_timer) loc.visible_message("[icon2html(src, viewers(src))] timer set for [timer_set] seconds.") diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index a674bb6489..50792205c8 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -316,7 +316,7 @@ // Get out list of viable PDAs var/list/obj/item/pda/sendPDAs = get_viewable_pdas() if(GLOB.PDAs && LAZYLEN(GLOB.PDAs) > 0) - customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs) + customrecepient = tgui_input_list(usr, "Select a PDA from the list.", "", sortNames(sendPDAs)) else customrecepient = null return diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 808dc4877b..ab7b31f530 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -177,7 +177,7 @@ links.Remove(T) if("freq") if("add" in params) - var/newfreq = input("Specify a new frequency to filter (GHz). Decimals assigned automatically.", src.name, null) as null|num + var/newfreq = tgui_input_num(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src.name, null) if(!canAccess(usr) || !newfreq || isnull(newfreq)) return diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index 6aeef4b6ac..b2293f2125 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -38,7 +38,7 @@ to_chat(user, "You have a very great feeling about this!") else to_chat(user, "The Wish Granter awaits your wish.") - var/wish = input("You want...","Wish") as null|anything in list("Power","Wealth","The Station To Disappear","To Kill","Nothing") + var/wish = tgui_input_list(user, "You want...","Wish", list("Power","Wealth","The Station To Disappear","To Kill","Nothing")) switch(wish) if("Power") //Gives infinite power in exchange for infinite power going off in your face! if(charges <= 0) diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 1c4586205a..4b36b298b3 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -407,7 +407,7 @@ return if(href_list["cut"]) if(cable && cable.amount) - var/m = round(input(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1) + var/m = round(tgui_input_num(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)), 1) m = min(m, cable.amount) if(m) use_cable(m) diff --git a/code/game/mecha/mecha_topic.dm b/code/game/mecha/mecha_topic.dm index 067cffd319..7c8324eb37 100644 --- a/code/game/mecha/mecha_topic.dm +++ b/code/game/mecha/mecha_topic.dm @@ -246,7 +246,7 @@ output_maintenance_dialog(id_card, usr) if(href_list["set_internal_tank_valve"] && state >=1) - var/new_pressure = input(usr,"Input new output pressure","Pressure setting",internal_tank_valve) as num + var/new_pressure = tgui_input_num(usr,"Input new output pressure","Pressure setting",internal_tank_valve) if(new_pressure) internal_tank_valve = new_pressure to_chat(usr, "The internal pressure valve has been set to [internal_tank_valve]kPa.") diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index afc4312779..a203bd172f 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -18,7 +18,7 @@ if(act_intent == INTENT_HELP || act_intent == INTENT_GRAB) return if(buckled_mobs.len > 1) - var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in buckled_mobs + var/unbuckled = tgui_input_list(user, "Who do you wish to unbuckle?","Unbuckle Who?", buckled_mobs) if(user_unbuckle_mob(unbuckled,user)) return 1 else @@ -161,6 +161,6 @@ else if(length(buckled_mobs) == 1) return user_unbuckle_mob(buckled_mobs[1], user) else - var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in buckled_mobs + var/unbuckled = tgui_input_list(user, "Who do you wish to unbuckle?","Unbuckle Who?", buckled_mobs) return user_unbuckle_mob(unbuckled, user) diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index df482ea0bf..dd123c07e8 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -229,7 +229,7 @@ AI MODULES laws = list("") /obj/item/aiModule/supplied/freeform/attack_self(mob/user) - var/newpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num|null + var/newpos = tgui_input_num(user, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) if(newpos == null) return if(newpos < 15) @@ -264,7 +264,7 @@ AI MODULES var/lawpos = 1 /obj/item/aiModule/remove/attack_self(mob/user) - lawpos = input("Please enter the law you want to delete.", "Law Number", lawpos) as num|null + lawpos = tgui_input_num(user, "Please enter the law you want to delete.", "Law Number", lawpos) if(lawpos == null) return if(lawpos <= 0) diff --git a/code/game/objects/items/boombox.dm b/code/game/objects/items/boombox.dm index 49e2375c1a..e0edeede22 100644 --- a/code/game/objects/items/boombox.dm +++ b/code/game/objects/items/boombox.dm @@ -25,7 +25,7 @@ for(var/datum/track/S in SSjukeboxes.songs) if(istype(S) && (S.song_associated_id in availabletrackids)) tracklist[S.song_name] = S - var/selected = input(user, "Play song", "Track:") as null|anything in tracklist + var/selected = tgui_input_list(user, "Play song", "Track:", tracklist) if(QDELETED(src) || !selected || !istype(tracklist[selected], /datum/track)) return var/jukeboxslottotake = SSjukeboxes.addjukebox(src, tracklist[selected]) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index d6178fa6a1..ad3a6563a5 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -302,7 +302,7 @@ . = FALSE var/datum/bank_account/old_account = registered_account - var/new_bank_id = input(user, "Enter your account ID number.", "Account Reclamation", 111111) as num | null + var/new_bank_id = tgui_input_num(user, "Enter your account ID number.", "Account Reclamation", 111111) if (isnull(new_bank_id)) return @@ -344,7 +344,7 @@ registered_account.bank_card_talk("ERROR: UNABLE TO LOGIN DUE TO SCHEDULED MAINTENANCE. MAINTENANCE IS SCHEDULED TO COMPLETE IN [(registered_account.withdrawDelay - world.time)/10] SECONDS.", TRUE) return - var/amount_to_remove = input(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) as num|null + var/amount_to_remove = tgui_input_num(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) if(!amount_to_remove || amount_to_remove < 0) return diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 6bf6e7d312..1fa1654c62 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -654,7 +654,7 @@ display_vending_names_paths = list() for(var/path in vending_names_paths) display_vending_names_paths[vending_names_paths[path]] = path - var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sortList(display_vending_names_paths) + var/choice = tgui_input_list(user,"Choose a new brand","Select an Item", sortList(display_vending_names_paths)) set_type(display_vending_names_paths[choice]) else return ..() @@ -856,7 +856,7 @@ // /obj/item/circuitboard/machine/medical_kiosk/multitool_act(mob/living/user) // . = ..() -// var/new_cost = input("Set a new cost for using this medical kiosk.","New cost", custom_cost) as num|null +// var/new_cost = tgui_input_num(user, "Set a new cost for using this medical kiosk.","New cost", custom_cost) // if(!new_cost || (loc != user)) // to_chat(user, "You must hold the circuitboard to change its cost!") // return @@ -1050,7 +1050,7 @@ /obj/item/circuitboard/machine/public_nanite_chamber/multitool_act(mob/living/user) . = ..() - var/new_cloud = input("Set the public nanite chamber's Cloud ID (1-100).", "Cloud ID", cloud_id) as num|null + var/new_cloud = tgui_input_num(user, "Set the public nanite chamber's Cloud ID (1-100).", "Cloud ID", cloud_id) if(!new_cloud || (loc != user)) to_chat(user, "You must hold the circuitboard to change its Cloud ID!") return diff --git a/code/game/objects/items/credit_holochip.dm b/code/game/objects/items/credit_holochip.dm index b7f7f5f2d1..b9cf189051 100644 --- a/code/game/objects/items/credit_holochip.dm +++ b/code/game/objects/items/credit_holochip.dm @@ -95,7 +95,7 @@ /obj/item/holochip/AltClick(mob/user) if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return - var/split_amount = round(input(user,"How many credits do you want to extract from the holochip?") as null|num) + var/split_amount = round(tgui_input_num(user,"How many credits do you want to extract from the holochip?")) if(split_amount == null || split_amount <= 0 || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return else diff --git a/code/game/objects/items/debug_items.dm b/code/game/objects/items/debug_items.dm index c7aaab6a26..c354b9ee10 100644 --- a/code/game/objects/items/debug_items.dm +++ b/code/game/objects/items/debug_items.dm @@ -21,9 +21,9 @@ /obj/item/debug/human_spawner/attack_self(mob/user) ..() - var/choice = input("Select a species", "Human Spawner", null) in GLOB.species_list + var/choice = tgui_input_list("Select a species", "Human Spawner", null, GLOB.species_list) selected_species = GLOB.species_list[choice] - + /* Revive this once we purge all the istype checks for tools for tool_behaviour /obj/item/debug/omnitool name = "omnitool" diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 2339e88a76..f19cde7071 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(PDAs) dat += "\n[V]: [output]" to_chat(M, dat) - var/choice = input(M, "Choose the a reskin for [src]","Reskin Object") as null|anything in GLOB.pda_reskins + var/choice = tgui_input_list(M, "Choose the a reskin for [src]","Reskin Object", GLOB.pda_reskins) var/new_icon = GLOB.pda_reskins[choice] if(QDELETED(src) || isnull(new_icon) || new_icon == icon || !M.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return @@ -619,7 +619,7 @@ GLOBAL_LIST_EMPTY(PDAs) playsound(src, 'sound/machines/terminal_select.ogg', 15, 1) if("Drone Phone") - var/alert_s = input(U,"Alert severity level","Ping Drones",null) as null|anything in list("Low","Medium","High","Critical") + var/alert_s = tgui_input_list(U,"Alert severity level","Ping Drones", list("Low","Medium","High","Critical")) var/area/A = get_area(U) if(A && alert_s && !QDELETED(U)) var/msg = "NON-DRONE PING: [U.name]: [alert_s] priority alert in [A.name]!" @@ -1147,7 +1147,7 @@ GLOBAL_LIST_EMPTY(PDAs) plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P - var/c = input(user, "Please select a PDA") as null|anything in sortList(plist) + var/c = tgui_input_list(user, "Please select a PDA", "", sortList(plist)) if (!c) return @@ -1155,7 +1155,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/selected = plist[c] if(aicamera.stored.len) - var/add_photo = input(user,"Do you want to attach a photo?","Photo","No") as null|anything in list("Yes","No") + var/add_photo = tgui_input_list(user,"Do you want to attach a photo?","Photo","No", list("Yes","No")) if(add_photo=="Yes") var/datum/picture/Pic = aicamera.selectpicture(user) aiPDA.picture = Pic diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 4ca0b86bc0..8ac68b9827 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -656,10 +656,10 @@ Code: if("alert") post_status("alert", href_list["alert"]) if("setmsg1") - message1 = reject_bad_text(input("Line 1", "Enter Message Text", message1) as text|null, 40) + message1 = reject_bad_text(tgui_input_text(usr, "Line 1", "Enter Message Text", message1), 40) updateSelfDialog() if("setmsg2") - message2 = reject_bad_text(input("Line 2", "Enter Message Text", message2) as text|null, 40) + message2 = reject_bad_text(tgui_input_text(usr, "Line 2", "Enter Message Text", message2), 40) updateSelfDialog() else post_status(href_list["statdisp"]) diff --git a/code/game/objects/items/devices/desynchronizer.dm b/code/game/objects/items/devices/desynchronizer.dm index 2cb4922f36..2e8b11a64e 100644 --- a/code/game/objects/items/devices/desynchronizer.dm +++ b/code/game/objects/items/devices/desynchronizer.dm @@ -36,7 +36,7 @@ . = ..() if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return - var/new_duration = input(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) as null|num + var/new_duration = tgui_input_num(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) if(new_duration) new_duration = new_duration SECONDS new_duration = clamp(new_duration, 50, max_duration) diff --git a/code/game/objects/items/devices/electrochromatic_kit.dm b/code/game/objects/items/devices/electrochromatic_kit.dm index d582eab00e..244ca03275 100644 --- a/code/game/objects/items/devices/electrochromatic_kit.dm +++ b/code/game/objects/items/devices/electrochromatic_kit.dm @@ -8,7 +8,7 @@ . = ..() if(.) return - var/new_id = input(user, "Set this kit's electrochromatic ID", "Set ID", id) as text|null + var/new_id = tgui_input_text(user, "Set this kit's electrochromatic ID", "Set ID", id) if(isnull(new_id)) return id = new_id diff --git a/code/game/objects/items/devices/pipe_painter.dm b/code/game/objects/items/devices/pipe_painter.dm index a6323cfd7f..573e2f0194 100644 --- a/code/game/objects/items/devices/pipe_painter.dm +++ b/code/game/objects/items/devices/pipe_painter.dm @@ -23,7 +23,7 @@ user.visible_message("[user] paints \the [P] [paint_color].","You paint \the [P] [paint_color].") /obj/item/pipe_painter/attack_self(mob/user) - paint_color = input("Which colour do you want to use?","Pipe painter") in GLOB.pipe_paint_colors + paint_color = tgui_input_list(user, "Which colour do you want to use?","Pipe painter", GLOB.pipe_paint_colors) /obj/item/pipe_painter/examine(mob/user) . = ..() diff --git a/code/game/objects/items/devices/polycircuit.dm b/code/game/objects/items/devices/polycircuit.dm index 17e364c4f3..3a35f7c9f8 100644 --- a/code/game/objects/items/devices/polycircuit.dm +++ b/code/game/objects/items/devices/polycircuit.dm @@ -18,7 +18,7 @@ else if(zero_amount()) return - chosen_circuit = input("What type of circuit would you like to remove?", "Choose a Circuit Type", chosen_circuit) as null|anything in list("airlock","firelock","fire alarm","air alarm","APC") + chosen_circuit = tgui_input_list(user, "What type of circuit would you like to remove?", "Choose a Circuit Type", list("airlock","firelock","fire alarm","air alarm","APC")) if(zero_amount() || !chosen_circuit || !in_range(src,user)) return switch(chosen_circuit) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index e81110425c..c86b9b3951 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -150,7 +150,7 @@ if(tune == "input") var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ) var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ) - tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num + tune = tgui_input_num(usr, "Tune frequency ([min]-[max]):", name, format_frequency(frequency)) if(!isnull(tune) && !..()) if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10) // allow typing 144.7 to get 1447 diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 0bf7b13646..0cb31291ed 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -946,7 +946,7 @@ GENETICS SCANNER for(var/A in buffer) options += get_display_name(A) - var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sortList(options) + var/answer = tgui_input_list(user, "Analyze Potential", "Sequence Analyzer", sortList(options)) if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) var/sequence for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list diff --git a/code/game/objects/items/dyekit.dm b/code/game/objects/items/dyekit.dm index 43a05c7939..eea4bf65e8 100644 --- a/code/game/objects/items/dyekit.dm +++ b/code/game/objects/items/dyekit.dm @@ -23,7 +23,7 @@ return var/mob/living/carbon/human/human_target = target - var/new_grad_style = input(usr, "Choose a color pattern:", "Character Preference") as null|anything in GLOB.hair_gradients_list + var/new_grad_style = tgui_input_list(usr, "Choose a color pattern:", "Character Preference", GLOB.hair_gradients_list) if(!new_grad_style) return diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 23fe128fa8..a30b1c40cf 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -95,7 +95,7 @@ if(nadeassembly) nadeassembly.attack_self(user) return - var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num + var/newtime = tgui_input_num(usr, "Please set the timer.", "Timer", 10) if(user.get_active_held_item() == src) newtime = clamp(newtime, 10, 60000) det_time = newtime diff --git a/code/game/objects/items/miscellaneous.dm b/code/game/objects/items/miscellaneous.dm index 80466832a6..151f5f1c7d 100644 --- a/code/game/objects/items/miscellaneous.dm +++ b/code/game/objects/items/miscellaneous.dm @@ -26,7 +26,7 @@ stored_options = generate_display_names() if(!stored_options.len) return - var/choice = input(M,"Which item would you like to order?","Select an Item") as null|anything in stored_options + var/choice = tgui_input_list(M,"Which item would you like to order?","Select an Item", stored_options) if(!choice || !M.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return @@ -182,7 +182,7 @@ return carrier /obj/item/choice_beacon/pet/spawn_option(atom/choice,mob/living/M) - pet_name = input(M, "What would you like to name the pet? (leave blank for default name)", "Pet Name") + pet_name = tgui_input_text(M, "What would you like to name the pet? (leave blank for default name)", "Pet Name") ..() //choice boxes (they just open in your hand instead of making a pod) diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index 22ffc33516..d3dcbafb70 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -154,7 +154,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(!A || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated()) return diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index cbfdc85f6d..fa72789221 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -997,7 +997,7 @@ to_chat(user, "[target] is firmly secured!") /obj/item/cyborg_clamp/attack_self(mob/user) - var/obj/chosen_cargo = input(user, "Drop what?") as null|anything in cargo + var/obj/chosen_cargo = tgui_input_list(user, "Drop what?", cargo) if(!chosen_cargo) return chosen_cargo.forceMove(get_turf(chosen_cargo)) diff --git a/code/game/objects/items/scrolls.dm b/code/game/objects/items/scrolls.dm index d58f670dc4..095b435c6a 100644 --- a/code/game/objects/items/scrolls.dm +++ b/code/game/objects/items/scrolls.dm @@ -48,7 +48,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(!src || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated() || !A || !uses) return var/area/thearea = GLOB.teleportlocs[A] diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 266d8b7b86..12822aefd0 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -465,7 +465,7 @@ return //get amount from user var/max = get_amount() - var/stackmaterial = round(input(user,"How many sheets do you wish to take out of this stack? (Maximum [max])") as null|num) + var/stackmaterial = round(tgui_input_num(user,"How many sheets do you wish to take out of this stack? (Maximum [max])")) max = get_amount() stackmaterial = min(max, stackmaterial) if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, TRUE, FALSE)) //, !iscyborg(user) diff --git a/code/game/objects/items/storage/dakis.dm b/code/game/objects/items/storage/dakis.dm index 29f12df4c4..b9b175bb04 100644 --- a/code/game/objects/items/storage/dakis.dm +++ b/code/game/objects/items/storage/dakis.dm @@ -24,7 +24,7 @@ var/custom_name if(icon_state == "daki_base") - body_choice = input("Pick a body.") in dakimakura_options + body_choice = tgui_input_list(user, "Pick a body.", "", dakimakura_options) icon_state = "daki_[body_choice]" custom_name = stripped_input(user, "What's her name?") if(length(custom_name) > MAX_NAME_LEN) diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index bc6a40f8c0..a8e94ba001 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -164,7 +164,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.get_active_held_item() != src || user.incapacitated()) return if(active_portal_pairs.len >= max_portal_pairs) diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm index a96d39316e..1f0121db76 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -120,7 +120,7 @@ /obj/structure/sign/barsign/proc/pick_sign(mob/user) - var/picked_name = input(user, "Available Signage", "Bar Sign", name) as null|anything in barsigns + var/picked_name = tgui_input_list(user, "Available Signage", "Bar Sign", barsigns) if(!picked_name) return set_sign(picked_name) diff --git a/code/game/objects/structures/crates_lockers/closets/genpop.dm b/code/game/objects/structures/crates_lockers/closets/genpop.dm index 789d86a67f..99665400e0 100644 --- a/code/game/objects/structures/crates_lockers/closets/genpop.dm +++ b/code/game/objects/structures/crates_lockers/closets/genpop.dm @@ -40,13 +40,13 @@ return TRUE /obj/structure/closet/secure_closet/genpop/proc/handle_edit_sentence(mob/user) - var/prisoner_name = input(user, "Please input the name of the prisoner.", "Prisoner Name", registered_id.registered_name) as text|null + var/prisoner_name = tgui_input_text(user, "Please input the name of the prisoner.", "Prisoner Name", registered_id.registered_name) if(prisoner_name == null | !user.Adjacent(src)) return FALSE - var/sentence_length = input(user, "Please input the length of their sentence in minutes (0 for perma).", "Sentence Length", registered_id.sentence) as num|null + var/sentence_length = tgui_input_num(user, "Please input the length of their sentence in minutes (0 for perma).", "Sentence Length", registered_id.sentence) if(sentence_length == null | !user.Adjacent(src)) return FALSE - var/crimes = input(user, "Please input their crimes.", "Crimes", registered_id.crime) as text|null + var/crimes = tgui_input_text(user, "Please input their crimes.", "Crimes", registered_id.crime) if(crimes == null | !user.Adjacent(src)) return FALSE diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index c32bf81ecf..321bb35cf8 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -470,7 +470,7 @@ playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE) return - var/new_price_input = input(usr,"Set the sale price for this vend-a-tray.","new price",0) as num|null + var/new_price_input = tgui_input_num(usr,"Set the sale price for this vend-a-tray.","new price",sale_price) if(isnull(new_price_input) || (payments_acc != potential_acc.registered_account)) to_chat(usr, "[src] rejects your new price.") return diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm index 9790a0e661..48a6c2f530 100644 --- a/code/game/objects/structures/dresser.dm +++ b/code/game/objects/structures/dresser.dm @@ -37,7 +37,7 @@ if(!(GLOB.socks_list[H.socks]?.has_color)) undergarment_choices -= "Socks Color" - var/choice = input(H, "Underwear, Undershirt, or Socks?", "Changing") as null|anything in undergarment_choices + var/choice = tgui_input_list(H, "Underwear, Undershirt, or Socks?", "Changing", undergarment_choices) if(!H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return var/dye_undie = FALSE @@ -45,21 +45,21 @@ var/dye_socks = FALSE switch(choice) if("Underwear") - var/new_undies = input(H, "Select your underwear", "Changing") as null|anything in GLOB.underwear_list + var/new_undies = tgui_input_list(H, "Select your underwear", "Changing", GLOB.underwear_list) if(new_undies) H.underwear = new_undies H.saved_underwear = new_undies var/datum/sprite_accessory/underwear/bottom/B = GLOB.underwear_list[new_undies] dye_undie = B?.has_color if("Undershirt") - var/new_undershirt = input(H, "Select your undershirt", "Changing") as null|anything in GLOB.undershirt_list + var/new_undershirt = tgui_input_list(H, "Select your undershirt", "Changing", GLOB.undershirt_list) if(new_undershirt) H.undershirt = new_undershirt H.saved_undershirt = new_undershirt var/datum/sprite_accessory/underwear/top/T = GLOB.undershirt_list[new_undershirt] dye_shirt = T?.has_color if("Socks") - var/new_socks = input(H, "Select your socks", "Changing") as null|anything in GLOB.socks_list + var/new_socks = tgui_input_list(H, "Select your socks", "Changing", GLOB.socks_list) if(new_socks) H.socks = new_socks H.saved_socks = new_socks diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index 87ec3d042c..dd421d8074 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -742,7 +742,7 @@ /datum/action/disguise/Trigger() var/mob/living/carbon/human/H = owner if(!currently_disguised) - var/user_object_type = input(H, "Disguising as OBJECT or MOB?") as null|anything in list("OBJECT", "MOB") + var/user_object_type = tgui_input_list(H, "Disguising as OBJECT or MOB?", "", list("OBJECT", "MOB")) if(user_object_type) var/search_term = stripped_input(H, "Enter the search term") if(search_term) @@ -758,7 +758,7 @@ if(!length(filtered_results)) to_chat(H, "Nothing matched your search query!") else - var/disguise_selection = input("Select item to disguise as") as null|anything in filtered_results + var/disguise_selection = tgui_input_list(H, "Select item to disguise as", "", filtered_results) if(disguise_selection) var/atom/disguise_item = disguise_selection var/image/I = image(icon = initial(disguise_item.icon), icon_state = initial(disguise_item.icon_state), loc = H) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index edd1d33bc4..d518401ccb 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -26,7 +26,7 @@ //handle facial hair (if necessary) if(H.gender != FEMALE) - var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list + var/new_style = tgui_input_list(user, "Select a facial hair style", "Grooming", GLOB.facial_hair_styles_list) if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return //no tele-grooming if(new_style) @@ -35,7 +35,7 @@ H.facial_hair_style = "Shaved" //handle normal hair - var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list + var/new_style = tgui_input_list(user, "Select a hair style", "Grooming", GLOB.hair_styles_list) if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return //no tele-grooming if(new_style) @@ -141,7 +141,7 @@ var/mob/living/carbon/human/H = user - var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes") + var/choice = tgui_input_list(user, "Something to change?", "Magical Grooming", list("name", "race", "gender", "hair", "eyes")) if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return @@ -163,7 +163,7 @@ if("race") var/newrace - var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races + var/racechoice = tgui_input_list(H, "What are we again?", "Race change", choosable_races) newrace = GLOB.species_list[racechoice] if(!newrace) @@ -176,7 +176,7 @@ var/list/choices = GLOB.skin_tones if(CONFIG_GET(flag/allow_custom_skintones)) choices += "custom" - var/new_s_tone = input(H, "Choose your skin tone:", "Race change") as null|anything in choices + var/new_s_tone = tgui_input_list(H, "Choose your skin tone:", "Race change", choices) if(new_s_tone) if(new_s_tone == "custom") var/default = H.dna.skin_tone_override || null @@ -249,7 +249,7 @@ H.update_hair() if(BODY_ZONE_PRECISE_EYES) - var/eye_type = input(H, "Choose the eye you want to color", "Eye Color") as null|anything in list("Both Eyes", "Left Eye", "Right Eye") + var/eye_type = tgui_input_list(H, "Choose the eye you want to color", "Eye Color", list("Both Eyes", "Left Eye", "Right Eye")) if(eye_type) var/input_color = H.left_eye_color if(eye_type == "Right Eye") diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm index 8174f6a82e..47f9bd3e5d 100644 --- a/code/game/objects/structures/reflector.dm +++ b/code/game/objects/structures/reflector.dm @@ -159,7 +159,7 @@ if (!can_rotate || admin) to_chat(user, "The rotation is locked!") return FALSE - var/new_angle = input(user, "Input a new angle for primary reflection face.", "Reflector Angle", rotation_angle) as null|num + var/new_angle = tgui_input_num(user, "Input a new angle for primary reflection face.", "Reflector Angle", rotation_angle) if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return if(!isnull(new_angle)) diff --git a/code/game/objects/structures/signs/_signs.dm b/code/game/objects/structures/signs/_signs.dm index 8b82cdba5e..b4ee0a3e55 100644 --- a/code/game/objects/structures/signs/_signs.dm +++ b/code/game/objects/structures/signs/_signs.dm @@ -45,7 +45,7 @@ var/list/sign_types = list("Secure Area", "Biohazard", "High Voltage", "Radiation", "Hard Vacuum Ahead", "Disposal: Leads To Space", "Danger: Fire", "No Smoking", "Medbay", "Science", "Chemistry", \ "Hydroponics", "Xenobiology") var/obj/structure/sign/sign_type - switch(input(user, "Select a sign type.", "Sign Customization") as null|anything in sign_types) + switch(tgui_input_list(user, "Select a sign type.", "Sign Customization", sign_types)) if("Blank") sign_type = /obj/structure/sign/basic if("Secure Area") diff --git a/code/game/objects/structures/spirit_board.dm b/code/game/objects/structures/spirit_board.dm index 1b3093e4e7..7781414583 100644 --- a/code/game/objects/structures/spirit_board.dm +++ b/code/game/objects/structures/spirit_board.dm @@ -31,7 +31,7 @@ virgin = 0 notify_ghosts("Someone has begun playing with a [src.name] in [get_area(src)]!", source = src) - planchette = input("Choose the letter.", "Seance!") as null|anything in list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z") + planchette = tgui_input_list(M, "Choose the letter.", "Seance!", list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")) if(!planchette || !Adjacent(M) || next_use > world.time) return M.log_message("picked a letter on [src], which was \"[planchette]\".") diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index d2efcbb3ac..82fc35466e 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -289,7 +289,7 @@ switch(param) if("reason") if(!value) - value = input("Insert the new reason for [p_key]'s ban", "New Reason", "[reason]", null) as null|text + value = tgui_input_text(usr, "Insert the new reason for [p_key]'s ban", "New Reason", "[reason]", null) if(!value) to_chat(usr, "Cancelled") return @@ -302,7 +302,7 @@ message_admins("[key_name_admin(usr)] has edited a ban for [p_key]'s reason from [reason] to [value]") if("duration") if(!value) - value = input("Insert the new duration (in minutes) for [p_key]'s ban", "New Duration", "[duration]", null) as null|num + value = tgui_input_num(usr, "Insert the new duration (in minutes) for [p_key]'s ban", "New Duration", "[duration]", null) if(!isnum(value) || !value) to_chat(usr, "Cancelled") return diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 70360dffd3..fce8198bd6 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -484,7 +484,7 @@ if(tgui_alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", list("Yes", "No")) != "Yes") return FALSE - var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options + var/result = tgui_input_list(usr, "Select reboot method", "World Reboot", options) if(result) SSblackbox.record_feedback("tally", "admin_verb", 1, "Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! var/init_by = "Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]." @@ -495,7 +495,7 @@ return FALSE SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) if("Regular Restart (with delay)") - var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null + var/delay = tgui_input_num(usr, "What delay should the restart have (in seconds)?", "Restart Delay", 5) if(!delay) return FALSE if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) @@ -534,7 +534,7 @@ if(!check_rights(0)) return - var/message = input("Global message to send:", "Admin Announce", null, null) as message + var/message = tgui_input_message(usr, "Global message to send:", "Admin Announce", null, null) if(message) if(!check_rights(R_SERVER,0)) message = adminscrub(message,500) @@ -549,7 +549,7 @@ if(!check_rights(0)) return - var/new_admin_notice = input(src,"Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):","Set Notice",GLOB.admin_notice) as message|null + var/new_admin_notice = tgui_input_message(src,"Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):","Set Notice",GLOB.admin_notice) if(new_admin_notice == null) return if(new_admin_notice == GLOB.admin_notice) @@ -695,7 +695,7 @@ set desc="Delay the game start" set name="Delay Pre-Game" - var/newtime = input("Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(SSticker.GetTimeLeft()/10)) as num|null + var/newtime = tgui_input_num(usr, "Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(SSticker.GetTimeLeft()/10)) if(SSticker.current_state > GAME_STATE_PREGAME) return tgui_alert(usr, "Too late... The game has already started!") if(newtime) diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 52be445120..23cf7eae87 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -24,7 +24,7 @@ var/list/combined = sortList(logs_present) + sortList(logs_missing) - var/selected = input("Investigate what?", "Investigate") as null|anything in combined + var/selected = tgui_input_list(src, "Investigate what?", "Investigate", combined) if(!(selected in combined) || selected == "---") return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index a4db70076c..10012e510f 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -517,7 +517,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set desc = "Cause an explosion of varying strength at your location." var/list/choices = list("Small Bomb (1, 2, 3, 3)", "Medium Bomb (2, 3, 4, 4)", "Big Bomb (3, 5, 7, 5)", "Maxcap", "Custom Bomb") - var/choice = input("What size explosion would you like to produce? NOTE: You can do all this rapidly and in an IC manner (using cruise missiles!) with the Config/Launch Supplypod verb. WARNING: These ignore the maxcap") as null|anything in choices + var/choice = tgui_input_list(src, "What size explosion would you like to produce? NOTE: You can do all this rapidly and in an IC manner (using cruise missiles!) with the Config/Launch Supplypod verb. WARNING: These ignore the maxcap", choices) var/turf/epicenter = mob.loc switch(choice) @@ -532,16 +532,16 @@ GLOBAL_PROTECT(admin_verbs_hideable) if("Maxcap") explosion(epicenter, GLOB.MAX_EX_DEVESTATION_RANGE, GLOB.MAX_EX_HEAVY_RANGE, GLOB.MAX_EX_LIGHT_RANGE, GLOB.MAX_EX_FLASH_RANGE) if("Custom Bomb") - var/devastation_range = input("Devastation range (in tiles):") as null|num + var/devastation_range = tgui_input_num(src, "Devastation range (in tiles):") if(devastation_range == null) return - var/heavy_impact_range = input("Heavy impact range (in tiles):") as null|num + var/heavy_impact_range = tgui_input_num(src, "Heavy impact range (in tiles):") if(heavy_impact_range == null) return - var/light_impact_range = input("Light impact range (in tiles):") as null|num + var/light_impact_range = tgui_input_num(src, "Light impact range (in tiles):") if(light_impact_range == null) return - var/flash_range = input("Flash range (in tiles):") as null|num + var/flash_range = tgui_input_num(src, "Flash range (in tiles):") if(flash_range == null) return if(devastation_range > GLOB.MAX_EX_DEVESTATION_RANGE || heavy_impact_range > GLOB.MAX_EX_HEAVY_RANGE || light_impact_range > GLOB.MAX_EX_LIGHT_RANGE || flash_range > GLOB.MAX_EX_FLASH_RANGE) @@ -558,29 +558,29 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Drop Wave Explosion" set desc = "Cause an explosive shockwave at your location." - var/power = input(src, "Wave initial power", "Power", 50) as num|null + var/power = tgui_input_num(src, "Wave initial power", "Power", 50) if(isnull(power)) return - var/falloff = input(src, "Wave innate falloff factor", "Falloff", EXPLOSION_DEFAULT_FALLOFF_MULTIPLY) as num|null + var/falloff = tgui_input_num(src, "Wave innate falloff factor", "Falloff", EXPLOSION_DEFAULT_FALLOFF_MULTIPLY) if(isnull(falloff)) return falloff = max(0, falloff) if(falloff > 1) to_chat(src, "Aborting: Falloff cannot be higher tahn 1.") return - var/constant = input(src, "Wave innate falloff constant", "Constant", EXPLOSION_DEFAULT_FALLOFF_SUBTRACT) as num|null + var/constant = tgui_input_num(src, "Wave innate falloff constant", "Constant", EXPLOSION_DEFAULT_FALLOFF_SUBTRACT) if(isnull(constant)) return if(constant < 0) to_chat(src, "Aborting: Falloff constant cannot be less than 0.") return - var/fire = input(src, "Probability per tile of fire?", "Fire Probability", 0) as num|null + var/fire = tgui_input_num(src, "Probability per tile of fire?", "Fire Probability", 0) if(isnull(fire)) return - var/speed = input(src, "Speed in ticks to wait between cycles? 0 for fast as possible", "Wait", 0) as num|null + var/speed = tgui_input_num(src, "Speed in ticks to wait between cycles? 0 for fast as possible", "Wait", 0) if(isnull(speed)) return - var/block_resistance = input(src, "DANGEROUS: Block resistance? USE 1 IF YOU DO NOT KNOW WHAT YOU ARE DOING.", "Block Negation", 1) as num|null + var/block_resistance = tgui_input_num(src, "DANGEROUS: Block resistance? USE 1 IF YOU DO NOT KNOW WHAT YOU ARE DOING.", "Block Negation", 1) if(isnull(block_resistance)) return block_resistance = max(0, block_resistance) @@ -603,7 +603,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Drop DynEx Bomb" set desc = "Cause an explosion of varying strength at your location." - var/ex_power = input("Explosive Power:") as null|num + var/ex_power = tgui_input_num(src, "Explosive Power:") var/turf/epicenter = mob.loc if(ex_power && epicenter) dyn_explosion(epicenter, ex_power) @@ -616,7 +616,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Get DynEx Range" set desc = "Get the estimated range of a bomb, using explosive power." - var/ex_power = input("Explosive Power:") as null|num + var/ex_power = tgui_input_num(src, "Explosive Power:") if (isnull(ex_power)) return var/range = round((2 * ex_power)**GLOB.DYN_EX_SCALE) @@ -627,7 +627,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Get DynEx Power" set desc = "Get the estimated required power of a bomb, to reach a specific range." - var/ex_range = input("Light Explosion Range:") as null|num + var/ex_range = tgui_input_num(src, "Light Explosion Range:") if (isnull(ex_range)) return var/power = (0.5 * ex_range)**(1/GLOB.DYN_EX_SCALE) @@ -638,7 +638,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Set DynEx Scale" set desc = "Set the scale multiplier of dynex explosions. The default is 0.5." - var/ex_scale = input("New DynEx Scale:") as null|num + var/ex_scale = tgui_input_num(src, "New DynEx Scale:") if(!ex_scale) return GLOB.DYN_EX_SCALE = ex_scale @@ -683,10 +683,10 @@ GLOBAL_PROTECT(admin_verbs_hideable) // if(!SStrading_card_game.loaded) // message_admins("The card subsystem is not currently loaded") // return -// var/pack = input("Which pack should we test?", "You fucked it didn't you") as null|anything in sortList(SStrading_card_game.card_packs) -// var/batchCount = input("How many times should we open it?", "Don't worry, I understand") as null|num -// var/batchSize = input("How many cards per batch?", "I hope you remember to check the validation") as null|num -// var/guar = input("Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") as null|num +// var/pack = tgui_input_list(src, "Which pack should we test?", "You fucked it didn't you", sortList(SStrading_card_game.card_packs)) +// var/batchCount = tgui_input_num(src, "How many times should we open it?", "Don't worry, I understand") +// var/batchSize = tgui_input_num(src, "How many cards per batch?", "I hope you remember to check the validation") +// var/guar = tgui_input_num(src, "Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") // checkCardDistribution(pack, batchSize, batchCount, guar) // /client/proc/print_cards() @@ -703,7 +703,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) var/type_length = length_char("/obj/effect/proc_holder/spell") + 2 for(var/A in GLOB.spells) spell_list[copytext_char("[A]", type_length)] = A - var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in sortList(spell_list) + var/obj/effect/proc_holder/spell/S = tgui_input_list(src, "Choose the spell to give to that guy", "ABRAKADABRA", sortList(spell_list)) if(!S) return @@ -724,7 +724,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set desc = "Remove a spell from the selected mob." if(T?.mind) - var/obj/effect/proc_holder/spell/S = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in sortList(T.mind.spell_list) + var/obj/effect/proc_holder/spell/S = tgui_input_list(src, "Choose the spell to remove", "NO ABRAKADABRA", sortList(T.mind.spell_list)) if(S) T.mind.RemoveSpell(S) log_admin("[key_name(usr)] removed the spell [S] from [key_name(T)].") @@ -738,7 +738,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(!istype(T)) to_chat(src, "You can only give a disease to a mob of type /mob/living.", confidential = TRUE) return - var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in sortList(SSdisease.diseases, /proc/cmp_typepaths_asc) + var/datum/disease/D = tgui_input_list(src, "Choose the disease to give to that guy", "ACHOO", sortList(SSdisease.diseases, /proc/cmp_typepaths_asc)) if(!D) return T.ForceContractDisease(new D, FALSE, TRUE) @@ -750,7 +750,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set category = "Admin.Events" set name = "OSay" set desc = "Makes an object say something." - var/message = input(usr, "What do you want the message to be?", "Make Sound") as text | null + var/message = tgui_input_text(usr, "What do you want the message to be?", "Make Sound") if(!message) return O.say(message) diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index 495cbdfd59..83d51e3049 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -26,7 +26,7 @@ target = null targetselected = FALSE - var/procpath = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null + var/procpath = tgui_input_text(src, "Proc path, eg: /proc/fake_blood","Path:", null) if(!procpath) return @@ -136,7 +136,7 @@ GLOBAL_PROTECT(LastAdminCalledProc) if(!check_rights(R_DEBUG)) return - var/procname = input("Proc name, eg: fake_blood","Proc:", null) as text|null + var/procname = tgui_input_text(src, "Proc name, eg: fake_blood","Proc:", null) if(!procname) return if(!hascall(A,procname)) @@ -161,14 +161,14 @@ GLOBAL_PROTECT(LastAdminCalledProc) to_chat(usr, ., confidential = TRUE) /client/proc/get_callproc_args() - var/argnum = input("Number of arguments","Number:",0) as num|null + var/argnum = tgui_input_num(src, "Number of arguments","Number:",0) if(isnull(argnum)) return . = list() var/list/named_args = list() while(argnum--) - var/named_arg = input("Leave blank for positional argument. Positional arguments will be considered as if they were added first.", "Named argument") as text|null + var/named_arg = tgui_input_text(src, "Leave blank for positional argument. Positional arguments will be considered as if they were added first.", "Named argument") var/value = vv_get_value(restricted_classes = list(VV_RESTORE_DEFAULT)) if (!value["class"]) return diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index a0d7e41485..18d9cb658f 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -19,7 +19,7 @@ /obj/item, /obj/item/clothing, /obj/item/stack, /obj/item, /obj/item/reagent_containers, /obj/item/gun) - var/path = input("Select the path of the object you wish to create.", "Path", /obj) in create_object_forms + var/path = tgui_input_list(user, "Select the path of the object you wish to create.", "Path", create_object_forms) var/html_form = create_object_forms[path] if (!html_form) diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index 6124fe9dc6..b43d084005 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -6,7 +6,7 @@ if(!SSdbcore.Connect()) to_chat(src, "Failed to establish database connection.") return - var/polltype = input("Choose poll type.","Poll Type") as null|anything in list("Single Option","Text Reply","Rating","Multiple Choice", "Instant Runoff Voting") + var/polltype = tgui_input_list(src, "Choose poll type.","Poll Type", list("Single Option","Text Reply","Rating","Multiple Choice", "Instant Runoff Voting")) var/choice_amount = 0 switch(polltype) if("Single Option") @@ -17,7 +17,7 @@ polltype = POLLTYPE_RATING if("Multiple Choice") polltype = POLLTYPE_MULTI - choice_amount = input("How many choices should be allowed?","Select choice amount") as num|null + choice_amount = tgui_input_num(src, "How many choices should be allowed?","Select choice amount") switch(choice_amount) if(0) to_chat(src, "Multiple choice poll must have at least one choice allowed.") @@ -31,7 +31,7 @@ else return 0 var/starttime = SQLtime() - var/endtime = input("Set end time for poll as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than starting time for obvious reasons.", "Set end time", SQLtime()) as text + var/endtime = tgui_input_text(src, "Set end time for poll as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than starting time for obvious reasons.", "Set end time", SQLtime()) if(!endtime) return var/datum/db_query/query_validate_time = SSdbcore.NewQuery({" @@ -64,14 +64,14 @@ dontshow = 0 else return - var/question = input("Write your question","Question") as message|null + var/question = tgui_input_message(src, "Write your question","Question") if(!question) return var/list/sql_option_list = list() if(polltype != POLLTYPE_TEXT) var/add_option = 1 while(add_option) - var/option = input("Write your option","Option") as message|null + var/option = tgui_input_message(src, "Write your option","Option") if(!option) return var/default_percentage_calc = 0 @@ -89,22 +89,22 @@ var/descmid = "" var/descmax = "" if(polltype == POLLTYPE_RATING) - minval = input("Set minimum rating value.","Minimum rating") as num|null + minval = tgui_input_num(src, "Set minimum rating value.","Minimum rating") if(minval == null) return - maxval = input("Set maximum rating value.","Maximum rating") as num|null + maxval = tgui_input_num(src, "Set maximum rating value.","Maximum rating") if(minval >= maxval) to_chat(src, "Maximum rating value can't be less than or equal to minimum rating value") continue if(maxval == null) return - descmin = input("Optional: Set description for minimum rating","Minimum rating description") as message|null + descmin = tgui_input_message(src, "Optional: Set description for minimum rating","Minimum rating description") if(descmin == null) return - descmid = input("Optional: Set description for median rating","Median rating description") as message|null + descmid = tgui_input_message(src, "Optional: Set description for median rating","Median rating description") if(descmid == null) return - descmax = input("Optional: Set description for maximum rating","Maximum rating description") as message|null + descmax = tgui_input_message(src, "Optional: Set description for maximum rating","Maximum rating description") if(descmax == null) return sql_option_list += list(list( diff --git a/code/modules/admin/permissionedit.dm b/code/modules/admin/permissionedit.dm index fe45a04673..4676d50df4 100644 --- a/code/modules/admin/permissionedit.dm +++ b/code/modules/admin/permissionedit.dm @@ -208,7 +208,7 @@ if(admin_ckey) . = admin_ckey else - admin_key = input("New admin's key","Admin key") as text|null + admin_key = tgui_input_text(usr, "New admin's key","Admin key") . = ckey(admin_key) if(!.) return FALSE @@ -305,9 +305,9 @@ for(R in GLOB.admin_ranks) if((R.rights & usr.client.holder.rank.can_edit_rights) == R.rights) rank_names[R.name] = R - var/new_rank = input("Please select a rank", "New rank") as null|anything in rank_names + var/new_rank = tgui_input_list(usr, "Please select a rank", "New rank", rank_names) if(new_rank == "*New Rank*") - new_rank = input("Please input a new rank", "New custom rank") as text|null + new_rank = tgui_input_text(usr, "Please input a new rank", "New custom rank") if(!new_rank) return R = rank_names[new_rank] diff --git a/code/modules/admin/sound_emitter.dm b/code/modules/admin/sound_emitter.dm index ad9c995aa1..8d4f189fe0 100644 --- a/code/modules/admin/sound_emitter.dm +++ b/code/modules/admin/sound_emitter.dm @@ -90,7 +90,7 @@ sound_file = new_file to_chat(user, "New sound file set to [sound_file].", confidential = TRUE) if(href_list["edit_volume"]) - var/new_volume = input(user, "Choose a volume.", "Sound Emitter", sound_volume) as null|num + var/new_volume = tgui_input_num(user, "Choose a volume.", "Sound Emitter", sound_volume) if(isnull(new_volume)) return new_volume = clamp(new_volume, 0, 100) @@ -99,7 +99,7 @@ if(href_list["edit_mode"]) var/new_mode var/mode_list = list("Local (normal sound)" = SOUND_EMITTER_LOCAL, "Direct (not affected by environment/location)" = SOUND_EMITTER_DIRECT) - new_mode = input(user, "Choose a new mode.", "Sound Emitter") as null|anything in mode_list + new_mode = tgui_input_list(user, "Choose a new mode.", "Sound Emitter", mode_list) if(!new_mode) return motus_operandi = mode_list[new_mode] @@ -113,7 +113,7 @@ emitter_range = range_list[new_range] to_chat(user, "Range set to [emitter_range].", confidential = TRUE) if(href_list["edit_radius"]) - var/new_radius = input(user, "Choose a radius.", "Sound Emitter", sound_volume) as null|num + var/new_radius = tgui_input_num(user, "Choose a radius.", "Sound Emitter", sound_volume) if(isnull(new_radius)) return new_radius = clamp(new_radius, 0, 127) diff --git a/code/modules/admin/sql_message_system.dm b/code/modules/admin/sql_message_system.dm index 0f24f8364c..a02df755c9 100644 --- a/code/modules/admin/sql_message_system.dm +++ b/code/modules/admin/sql_message_system.dm @@ -6,7 +6,7 @@ return var/target_ckey = ckey(target_key) if(!target_key && (type == "note" || type == "message" || type == "watchlist entry")) - var/new_key = input(usr,"Who would you like to create a [type] for?","Enter a key or ckey",null) as null|text + var/new_key = tgui_input_text(usr,"Who would you like to create a [type] for?","Enter a key or ckey",null) if(!new_key) return var/new_ckey = ckey(new_key) @@ -35,7 +35,7 @@ if(!target_ckey) target_ckey = admin_ckey if(!text) - text = input(usr,"Write your [type]","Create [type]") as null|message + text = tgui_input_message(usr,"Write your [type]","Create [type]") if(!text) return if(!timestamp) @@ -54,7 +54,7 @@ return if(isnull(expiry)) if(tgui_alert(usr, "Set an expiry time? Expired messages are hidden like deleted ones.", "Expiry time?", list("Yes", "No", "Cancel")) == "Yes") - var/expire_time = input("Set expiry time for [type] as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than current time for obvious reasons.", "Set expiry time", SQLtime()) as null|text + var/expire_time = tgui_input_text(usr, "Set expiry time for [type] as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than current time for obvious reasons.", "Set expiry time", SQLtime()) if(!expire_time) return var/datum/db_query/query_validate_expire_time = SSdbcore.NewQuery( @@ -73,7 +73,7 @@ expiry = query_validate_expire_time.item[1] qdel(query_validate_expire_time) if(type == "note" && isnull(note_severity)) - note_severity = input("Set the severity of the note.", "Severity", null, null) as null|anything in list("High", "Medium", "Minor", "None") + note_severity = tgui_input_list(usr, "Set the severity of the note.", "Severity", list("High", "Medium", "Minor", "None")) if(!note_severity) return var/datum/db_query/query_create_message = SSdbcore.NewQuery({" @@ -180,7 +180,7 @@ var/target_key = query_find_edit_message.item[2] var/admin_key = query_find_edit_message.item[3] var/old_text = query_find_edit_message.item[4] - var/new_text = input("Input new [type]", "New [type]", "[old_text]") as null|message + var/new_text = tgui_input_message(usr, "Input new [type]", "New [type]", "[old_text]") if(!new_text) qdel(query_find_edit_message) return @@ -231,7 +231,7 @@ var/admin_key = query_find_edit_expiry_message.item[3] var/old_expiry = query_find_edit_expiry_message.item[4] var/new_expiry - var/expire_time = input("Set expiry time for [type] as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than current time for obvious reasons. Enter -1 to remove expiry time.", "Set expiry time", old_expiry) as null|text + var/expire_time = tgui_input_text(usr, "Set expiry time for [type] as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than current time for obvious reasons. Enter -1 to remove expiry time.", "Set expiry time", old_expiry) if(!expire_time) qdel(query_find_edit_expiry_message) return @@ -303,7 +303,7 @@ old_severity = "NA" var/editor_key = usr.key var/editor_ckey = usr.ckey - var/new_severity = input("Set the severity of the note.", "Severity", null, null) as null|anything in list("high", "medium", "minor", "none") //lowercase for edit log consistency + var/new_severity = tgui_input_list(usr, "Set the severity of the note.", "Severity", list("high", "medium", "minor", "none")) //lowercase for edit log consistency if(!new_severity) qdel(query_find_edit_note_severity) return diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm index 3e0cf768a3..4906f9a97a 100644 --- a/code/modules/admin/stickyban.dm +++ b/code/modules/admin/stickyban.dm @@ -14,7 +14,7 @@ if (data["ckey"]) ckey = ckey(data["ckey"]) else - ckey = input(usr,"Ckey","Ckey","") as text|null + ckey = tgui_input_text(usr,"Ckey","Ckey","") if (!ckey) return ckey = ckey(ckey) @@ -27,7 +27,7 @@ if (data["reason"]) ban["message"] = data["reason"] else - var/reason = input(usr,"Reason","Reason","Ban Evasion") as text|null + var/reason = tgui_input_text(usr,"Reason","Reason","Ban Evasion") if (!reason) return ban["message"] = "[reason]" @@ -138,7 +138,7 @@ to_chat(usr, "Error: No sticky ban for [ckey] found!", confidential = TRUE) return var/oldreason = ban["message"] - var/reason = input(usr,"Reason","Reason","[ban["message"]]") as text|null + var/reason = tgui_input_text(usr,"Reason","Reason","[ban["message"]]") if (!reason || reason == oldreason) return //we have to do this again incase something changed while we waited for input diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 343955bb25..194754dc24 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -130,7 +130,7 @@ message_admins("[key_name_admin(usr)] tried to create a death squad. Unfortunately, there were not enough candidates available.") log_admin("[key_name(usr)] failed to create a death squad.") if("blob") - var/strength = input("Set Blob Resource Gain Rate","Set Resource Rate",1) as num|null + var/strength = tgui_input_num(usr, "Set Blob Resource Gain Rate","Set Resource Rate",1) if(!strength) return message_admins("[key_name(usr)] spawned a blob with base resource gain [strength].") @@ -331,7 +331,7 @@ if(!check_rights(R_SERVER)) return - var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", SSshuttle.emergency.timeLeft() ) as num|null + var/timer = tgui_input_num(usr, "Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", SSshuttle.emergency.timeLeft()) if(!timer) return SSshuttle.emergency.setTimer(timer*10) @@ -374,7 +374,7 @@ if(!check_rights(R_ADMIN)) return - var/timer = input("Enter new maximum time",, CONFIG_GET(number/midround_antag_time_check)) as num|null + var/timer = tgui_input_num(usr, "Enter new maximum time",, CONFIG_GET(number/midround_antag_time_check)) if(!timer) return CONFIG_SET(number/midround_antag_time_check, timer) @@ -385,7 +385,7 @@ if(!check_rights(R_ADMIN)) return - var/ratio = input("Enter new life ratio",, CONFIG_GET(number/midround_antag_life_check) * 100) as num + var/ratio = tgui_input_num(usr, "Enter new life ratio",, CONFIG_GET(number/midround_antag_life_check) * 100) if(!ratio) return CONFIG_SET(number/midround_antag_life_check, ratio / 100) @@ -409,7 +409,7 @@ if(!check_rights(R_SERVER)) return if(!SSticker.delay_end) - SSticker.admin_delay_notice = input(usr, "Enter a reason for delaying the round end", "Round Delay Reason") as null|text + SSticker.admin_delay_notice = tgui_input_text(usr, "Enter a reason for delaying the round end", "Round Delay Reason") if(isnull(SSticker.admin_delay_notice)) return else @@ -550,19 +550,19 @@ var/mins = 0 if(minutes > GLOB.CMinutes) mins = minutes - GLOB.CMinutes - mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null + mins = tgui_input_num(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) if(mins <= 0) to_chat(usr, "[mins] is not a valid duration.") return minutes = GLOB.CMinutes + mins duration = GetExp(minutes) - reason = input(usr,"Please State Reason For Banning [banned_key].","Reason",reason2) as message|null + reason = tgui_input_message(usr,"Please State Reason For Banning [banned_key].","Reason",reason2) if(!reason) return if("No") temp = 0 duration = "Perma" - reason = input(usr,"Please State Reason For Banning [banned_key].","Reason",reason2) as message|null + reason = tgui_input_message(usr,"Please State Reason For Banning [banned_key].","Reason",reason2) if(!reason) return @@ -604,10 +604,10 @@ else switch(tgui_alert(usr, "Appearance ban [M.key]?",,list("Yes","No", "Cancel"))) if("Yes") - var/reason = input(usr,"Please State Reason.","Reason") as message|null + var/reason = tgui_input_message(usr,"Please State Reason.","Reason") if(!reason) return - var/severity = input("Set the severity of the note/ban.", "Severity", null, null) as null|anything in list("High", "Medium", "Minor", "None") + var/severity = tgui_input_list(usr, "Set the severity of the note/ban.", "Severity", list("High", "Medium", "Minor", "None")) if(!severity) return if(!DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, "appearance")) @@ -1027,14 +1027,14 @@ var/severity = null switch(tgui_alert(usr, "Temporary Ban for [M.key]?",,list("Yes","No", "Cancel"))) if("Yes") - var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null + var/mins = tgui_input_num(usr,"How long (in minutes)?","Ban time",1440) if(mins <= 0) to_chat(usr, "[mins] is not a valid duration.") return - var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null + var/reason = tgui_input_message(usr,"Please State Reason For Banning [M.key].","Reason") if(!reason) return - severity = input("Set the severity of the note/ban.", "Severity", null, null) as null|anything in list("High", "Medium", "Minor", "None") + severity = tgui_input_list(usr, "Set the severity of the note/ban.", "Severity", list("High", "Medium", "Minor", "None")) if(!severity) return var/msg @@ -1058,8 +1058,8 @@ href_list["jobban2"] = 1 // lets it fall through and refresh return 1 if("No") - var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null - severity = input("Set the severity of the note/ban.", "Severity", null, null) as null|anything in list("High", "Medium", "Minor", "None") + var/reason = tgui_input_message(usr,"Please State Reason For Banning [M.key].","Reason") + severity = tgui_input_list(usr, "Set the severity of the note/ban.", "Severity", list("High", "Medium", "Minor", "None")) if(!severity) return if(reason) @@ -1303,11 +1303,11 @@ switch(tgui_alert(usr, "Temporary Ban for [M.key]?",,list("Yes","No", "Cancel"))) if("Yes") - var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null + var/mins = tgui_input_num(usr,"How long (in minutes)?","Ban time",1440) if(mins <= 0) to_chat(usr, "[mins] is not a valid duration.") return - var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null + var/reason = tgui_input_message(usr,"Please State Reason For Banning [M.key].","Reason") if(!reason) return if(!DB_ban_record(BANTYPE_TEMP, M, mins, reason)) @@ -1330,7 +1330,7 @@ AH.Resolve() qdel(M.client) if("No") - var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null + var/reason = tgui_input_message(usr,"Please State Reason For Banning [M.key].","Reason") if(!reason) return switch(tgui_alert(usr,"IP ban?",,list("Yes","No","Cancel"))) @@ -1383,7 +1383,7 @@ for (var/rule in subtypesof(/datum/dynamic_ruleset/roundstart)) var/datum/dynamic_ruleset/roundstart/newrule = new rule() roundstart_rules[newrule.name] = newrule - var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in roundstart_rules + var/added_rule = tgui_input_list(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", roundstart_rules) if (added_rule) GLOB.dynamic_forced_roundstart_ruleset += roundstart_rules[added_rule] log_admin("[key_name(usr)] set [added_rule] to be a forced roundstart ruleset.") @@ -1418,7 +1418,7 @@ for(var/T in config.storyteller_cache) var/datum/dynamic_storyteller/S = T choices[initial(S.name)] = T - var/choice = choices[input("Select storyteller:", "Storyteller", "Classic") as null|anything in choices] + var/choice = choices[tgui_input_list(usr, "Select storyteller:", "Storyteller", choices)] if(choice) GLOB.dynamic_forced_storyteller = choice log_admin("[key_name(usr)] forced the storyteller to [GLOB.dynamic_forced_storyteller].") @@ -1444,7 +1444,7 @@ for (var/rule in subtypesof(/datum/dynamic_ruleset/latejoin)) var/datum/dynamic_ruleset/latejoin/newrule = new rule() latejoin_rules[newrule.name] = newrule - var/added_rule = input(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", null) as null|anything in latejoin_rules + var/added_rule = tgui_input_list(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", latejoin_rules) if (added_rule) var/datum/game_mode/dynamic/mode = SSticker.mode mode.forced_latejoin_rule = latejoin_rules[added_rule] @@ -1473,7 +1473,7 @@ for (var/rule in subtypesof(/datum/dynamic_ruleset/midround)) var/datum/dynamic_ruleset/midround/newrule = new rule() midround_rules[newrule.name] = rule - var/added_rule = input(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", null) as null|anything in midround_rules + var/added_rule = tgui_input_list(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", midround_rules) if (added_rule) var/datum/game_mode/dynamic/mode = SSticker.mode log_admin("[key_name(usr)] executed the [added_rule] ruleset.") @@ -1499,7 +1499,7 @@ if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_centre = input(usr,"Change the centre of the dynamic mode threat curve. A negative value will give a more peaceful round ; a positive value, a round with higher threat. Any number is allowed. This is adjusted by dynamic voting.", "Change curve centre", null) as num + var/new_centre = tgui_input_num(usr,"Change the centre of the dynamic mode threat curve. A negative value will give a more peaceful round ; a positive value, a round with higher threat. Any number is allowed. This is adjusted by dynamic voting.", "Change curve centre", null) log_admin("[key_name(usr)] changed the distribution curve center to [new_centre].") message_admins("[key_name(usr)] changed the distribution curve center to [new_centre]", 1) @@ -1514,7 +1514,7 @@ if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_width = input(usr,"Change the width of the dynamic mode threat curve. A higher value will favour extreme rounds ; a lower value, a round closer to the average. Any Number between 0.5 and 4 are allowed.", "Change curve width", null) as num + var/new_width = tgui_input_num(usr,"Change the width of the dynamic mode threat curve. A higher value will favour extreme rounds ; a lower value, a round closer to the average. Any Number between 0.5 and 4 are allowed.", "Change curve width", null) if (new_width < 0.5 || new_width > 4) return tgui_alert(usr, "Only values between 0.5 and +2.5 are allowed.", null, null, null, null) @@ -1530,7 +1530,7 @@ return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_min = input(usr,"Change the minimum delay of latejoin injection in minutes.", "Change latejoin injection delay minimum", null) as num + var/new_min = tgui_input_num(usr,"Change the minimum delay of latejoin injection in minutes.", "Change latejoin injection delay minimum", null) if(new_min <= 0) return tgui_alert(usr, "The minimum can't be zero or lower.", null, null, null, null) if((new_min MINUTES) > GLOB.dynamic_latejoin_delay_max) @@ -1548,7 +1548,7 @@ return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_max = input(usr,"Change the maximum delay of latejoin injection in minutes.", "Change latejoin injection delay maximum", null) as num + var/new_max = tgui_input_num(usr,"Change the maximum delay of latejoin injection in minutes.", "Change latejoin injection delay maximum", null) if(new_max <= 0) return tgui_alert(usr, "The maximum can't be zero or lower.", null, null, null, null) if((new_max MINUTES) < GLOB.dynamic_latejoin_delay_min) @@ -1566,7 +1566,7 @@ return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_min = input(usr,"Change the minimum delay of midround injection in minutes.", "Change midround injection delay minimum", null) as num + var/new_min = tgui_input_num(usr,"Change the minimum delay of midround injection in minutes.", "Change midround injection delay minimum", null) if(new_min <= 0) return tgui_alert(usr, "The minimum can't be zero or lower.", null, null, null, null) if((new_min MINUTES) > GLOB.dynamic_midround_delay_max) @@ -1584,7 +1584,7 @@ return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_max = input(usr,"Change the maximum delay of midround injection in minutes.", "Change midround injection delay maximum", null) as num + var/new_max = tgui_input_num(usr,"Change the maximum delay of midround injection in minutes.", "Change midround injection delay maximum", null) if(new_max <= 0) return tgui_alert(usr, "The maximum can't be zero or lower.", null, null, null, null) if((new_max MINUTES) > GLOB.dynamic_midround_delay_max) @@ -1638,7 +1638,7 @@ if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num + GLOB.dynamic_stacking_limit = tgui_input_num(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) log_admin("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].") message_admins("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].") dynamic_mode_options(usr) @@ -1653,7 +1653,7 @@ if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_value = input(usr, "Enter the high-pop override threshold for dynamic mode.", "High pop override") as num + var/new_value = tgui_input_num(usr, "Enter the high-pop override threshold for dynamic mode.", "High pop override") if (new_value < 0) return tgui_alert(usr, "Only positive values allowed!", null, null, null, null) GLOB.dynamic_high_pop_limit = new_value @@ -1672,7 +1672,7 @@ if(GLOB.master_mode != "dynamic") return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) - var/new_value = input(usr, "Enter the forced threat level for dynamic mode.", "Forced threat level") as num + var/new_value = tgui_input_num(usr, "Enter the forced threat level for dynamic mode.", "Forced threat level") if (new_value > 100) return tgui_alert(usr, "The value must be be under 100.", null, null, null, null) GLOB.dynamic_forced_threat_level = new_value @@ -1757,7 +1757,7 @@ if(!ismob(M)) to_chat(usr, "this can only be used on instances of type /mob.") - var/speech = input("What will [key_name(M)] say?", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins. + var/speech = tgui_input_text("What will [key_name(M)] say?", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins. if(!speech) return M.say(speech, forced = "admin speech") @@ -2143,7 +2143,7 @@ for(var/datum/job/job in SSjob.occupations) if(job.title == Add) var/newtime = null - newtime = input(usr, "How many jebs do you want?", "Add wanted posters", "[newtime]") as num|null + newtime = tgui_input_num(usr, "How many jebs do you want?", "Add wanted posters", "[newtime]") if(!newtime) to_chat(src.owner, "Setting to amount of positions filled for the job") job.total_positions = job.current_positions @@ -2550,7 +2550,7 @@ var/list/available_channels = list() for(var/datum/news/feed_channel/F in GLOB.news_network.network_channels) available_channels += F.channel_name - src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel.", "Network Channel Handler") in available_channels ) + src.admincaster_feed_channel.channel_name = adminscrub(tgui_input_list(usr, "Choose receiving Feed Channel.", "Network Channel Handler", available_channels)) src.access_news_network() else if(href_list["ac_set_new_message"]) @@ -2730,7 +2730,7 @@ else if(href_list["ac_set_signature"]) if(!check_rights(R_ADMIN)) return - src.admin_signature = adminscrub(input(usr, "Provide your desired signature.", "Network Identity Handler", "")) + src.admin_signature = adminscrub(tgui_input_text(usr, "Provide your desired signature.", "Network Identity Handler", "")) src.access_news_network() else if(href_list["ac_del_comment"]) @@ -2812,16 +2812,16 @@ if(!check_rights(R_ADMIN)) return var/list/type_choices = typesof(/datum/station_goal) - var/picked = input("Choose goal type") in type_choices|null + var/picked = tgui_input_list(usr, "Choose goal type", type_choices) if(!picked) return var/datum/station_goal/G = new picked() if(picked == /datum/station_goal) - var/newname = input("Enter goal name:") as text|null + var/newname = tgui_input_text(usr, "Enter goal name:") if(!newname) return G.name = newname - var/description = input("Enter CentCom message contents:") as message|null + var/description = tgui_input_message(usr, "Enter CentCom message contents:") if(!description) return G.report_message = description @@ -2938,7 +2938,7 @@ if(answer == "yes") log_query_debug("[usr.key] | Reported a server hang") if(tgui_alert(usr, "Had you just press any admin buttons?", "Query server hang report", list("Yes", "No")) == "Yes") - var/response = input(usr,"What were you just doing?","Query server hang report") as null|text + var/response = tgui_input_text(usr,"What were you just doing?","Query server hang report") if(response) log_query_debug("[usr.key] | [response]") else if(answer == "no") diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index ec7d4e94cf..46cdc86263 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -441,7 +441,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) usr << browse(dat.Join(), "window=ahelp[id];size=620x480") /datum/admin_help/proc/Retitle() - var/new_title = input(usr, "Enter a title for the ticket", "Rename Ticket", name) as text|null + var/new_title = tgui_input_text(usr, "Enter a title for the ticket", "Rename Ticket", name) if(new_title) name = new_title //not saying the original name cause it could be a long ass message @@ -505,7 +505,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) // Used for methods where input via arg doesn't work /client/proc/get_adminhelp() - var/msg = input(src, "Please describe your problem concisely and an admin will help as soon as they're able.", "Adminhelp contents") as text + var/msg = tgui_input_text(src, "Please describe your problem concisely and an admin will help as soon as they're able.", "Adminhelp contents") adminhelp(msg) /client/verb/adminhelp(msg as text) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 2f89dc82eb..72680eaadc 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -84,7 +84,7 @@ var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) + var/client/selection = tgui_input_list(src, "Please, select a player!", "Admin Jumping", sortKey(keys)) if(!selection) to_chat(src, "No keys found.", confidential = TRUE) return @@ -124,7 +124,7 @@ var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) + var/client/selection = tgui_input_list(src, "Please, select a player!", "Admin Jumping", sortKey(keys)) if(!selection) return var/mob/M = selection.mob @@ -146,7 +146,7 @@ if(!src.holder) to_chat(src, "Only administrators may use this command.", confidential = TRUE) return - var/area/A = input(usr, "Pick an area.", "Pick an area") in GLOB.sortedAreas|null + var/area/A = tgui_input_list(usr, "Pick an area.", "Pick an area", GLOB.sortedAreas) if(A && istype(A)) var/list/turfs = get_area_turfs(A) if(length(turfs) && M.forceMove(pick(turfs))) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 3a708ef182..d3c8a770df 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -30,7 +30,7 @@ targets["[T.mob.real_name](as [T.mob.name]) - [T]"] = T else targets["(No Mob) - [T]"] = T - var/target = input(src,"To whom shall we send a message?","Admin PM",null) as null|anything in sortList(targets) + var/target = tgui_input_list(src,"To whom shall we send a message?","Admin PM", sortList(targets)) cmd_admin_pm(targets[target],null) SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin PM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -54,7 +54,7 @@ if(AH) message_admins("[key_name_admin(src)] has started replying to [key_name_admin(C, 0, 0)]'s admin help.") - var/msg = input(src,"Message:", "Private message to [C.holder?.fakekey ? "an Administrator" : key_name(C, 0, 0)].") as message|null + var/msg = tgui_input_message(src,"Message:", "Private message to [C.holder?.fakekey ? "an Administrator" : key_name(C, 0, 0)].") if (!msg) message_admins("[key_name_admin(src)] has cancelled their reply to [key_name_admin(C, 0, 0)]'s admin help.") return @@ -105,7 +105,7 @@ if(!ircreplyamount) //to prevent people from spamming irc/discord return if(!msg) - msg = input(src,"Message:", "Private message to Administrator") as message|null + msg = tgui_input_message(src,"Message:", "Private message to Administrator") if(!msg) return @@ -116,7 +116,7 @@ else //get message text, limit it's length.and clean/escape html if(!msg) - msg = input(src,"Message:", "Private message to [recipient.holder?.fakekey ? "an Administrator" : key_name(recipient, 0, 0)].") as message|null + msg = tgui_input_message(src,"Message:", "Private message to [recipient.holder?.fakekey ? "an Administrator" : key_name(recipient, 0, 0)].") msg = trim(msg) if(!msg) return @@ -238,7 +238,7 @@ /client/proc/popup_admin_pm(client/recipient, msg) var/sender = src var/sendername = key - var/reply = input(recipient, msg,"Admin PM from-[sendername]", "") as message|null //show message and await a reply + var/reply = tgui_input_message(recipient, msg,"Admin PM from-[sendername]", "") //show message and await a reply if(recipient && reply) if(sender) recipient.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 66653020d4..53370d09d6 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -18,5 +18,5 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Asay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/get_admin_say() - var/msg = input(src, null, "asay \"text\"") as text + var/msg = tgui_input_text(src, null, "asay \"text\"") cmd_admin_say(msg) diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index 4b60ecc0ff..ff6b3938cf 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -7,7 +7,7 @@ return if (!istype(borgo, /mob/living/silicon/robot)) - borgo = input("Select a borg", "Select a borg", null, null) as null|anything in sortNames(GLOB.silicon_mobs) + borgo = tgui_input_list(usr, "Select a borg", "Select a borg", sortNames(GLOB.silicon_mobs)) if (!istype(borgo, /mob/living/silicon/robot)) to_chat(usr, "Borg is required for borgpanel", confidential = TRUE) @@ -83,7 +83,7 @@ return switch (action) if ("set_charge") - var/newcharge = input("New charge (0-[borg.cell.maxcharge]):", borg.name, borg.cell.charge) as num|null + var/newcharge = tgui_input_num(usr, "New charge (0-[borg.cell.maxcharge]):", borg.name, borg.cell.charge) if (newcharge) borg.cell.charge = clamp(newcharge, 0, borg.cell.maxcharge) message_admins("[key_name_admin(user)] set the charge of [ADMIN_LOOKUPFLW(borg)] to [borg.cell.charge].") diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index b23cd0af0b..85a4a5773d 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -6,6 +6,6 @@ if(!SSticker) return - var/datum/cinematic/choice = input(src,"Cinematic","Choose",null) as anything in subtypesof(/datum/cinematic) + var/datum/cinematic/choice = tgui_input_list(src,"Cinematic","Choose", subtypesof(/datum/cinematic)) if(choice) Cinematic(initial(choice.id),world,null) diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 1cddbe9509..42c588056b 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -32,7 +32,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Dsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/get_dead_say() - var/msg = input(src, null, "dsay \"text\"") as text|null + var/msg = tgui_input_text(src, null, "dsay \"text\"") if (isnull(msg)) return diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index ccb58cc540..c4e882cef2 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -87,16 +87,16 @@ for(var/mob/C in GLOB.mob_list) if(C.key) available.Add(C) - var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available + var/mob/choice = tgui_input_list(src, "Choose a player to play the pAI", "Spawn pAI", available) if(!choice) return 0 if(!isobserver(choice)) - var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No") + var/confirm = tgui_input_list(src, "[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", list("Yes", "No")) if(confirm != "Yes") return 0 var/obj/item/paicard/card = new(T) var/mob/living/silicon/pai/pai = new(card) - pai.name = input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text + pai.name = tgui_input_text(choice, "Enter your pAI name:", "pAI Name", "Personal AI") pai.real_name = pai.name choice.transfer_ckey(pai) card.setPersonality(pai) @@ -146,7 +146,7 @@ if(matches.len==0) return - var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in matches + var/hsbitem = tgui_input_list(usr, "Choose an object to delete.", "Delete:", matches) if(hsbitem) hsbitem = matches[hsbitem] var/counter = 0 @@ -238,7 +238,7 @@ if(M.ckey) if(tgui_alert(usr, "This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return - var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sortList(GLOB.clients) + var/client/newkey = tgui_input_list(src, "Pick the player to put in control.", "New player", sortList(GLOB.clients)) var/mob/oldmob = newkey.mob var/delmob = FALSE if((isobserver(oldmob) || tgui_alert(usr, "Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No")) @@ -494,7 +494,7 @@ var/datum/outfit/O = path //not much to initalize here but whatever outfits[initial(O.name)] = path - var/dresscode = input("Select outfit", "Robust quick dress shop") as null|anything in baseoutfits + sortList(outfits) + var/dresscode = tgui_input_list(src, "Select outfit", "Robust quick dress shop", baseoutfits + sortList(outfits)) if (isnull(dresscode)) return @@ -508,7 +508,7 @@ var/datum/outfit/O = path job_outfits[initial(O.name)] = path - dresscode = input("Select job equipment", "Robust quick dress shop") as null|anything in sortList(job_outfits) + dresscode = tgui_input_list(src, "Select job equipment", "Robust quick dress shop", sortList(job_outfits)) dresscode = job_outfits[dresscode] if(isnull(dresscode)) return @@ -520,7 +520,7 @@ var/datum/outfit/O = path plasmaman_outfits[initial(O.name)] = path - dresscode = input("Select plasmeme equipment", "Robust quick dress shop") as null|anything in sortList(plasmaman_outfits) + dresscode = tgui_input_list(src, "Select plasmeme equipment", "Robust quick dress shop", sortList(plasmaman_outfits)) dresscode = plasmaman_outfits[dresscode] if(isnull(dresscode)) return @@ -529,7 +529,7 @@ 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 sortList(custom_names) + var/selected_name = tgui_input_list(src, "Select outfit", "Robust quick dress shop", sortList(custom_names)) dresscode = custom_names[selected_name] if(isnull(dresscode)) return @@ -598,7 +598,7 @@ set name = "Debug Mob Lists" set desc = "For when you just gotta know" - switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients")) + switch(tgui_input_list(src, "Which list?", "", list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))) if("Players") to_chat(usr, jointext(GLOB.player_list,",")) if("Admins") @@ -687,7 +687,7 @@ names[name] = ruin_landmark - var/ruinname = input("Select ruin", "Jump to Ruin") as null|anything in names + var/ruinname = tgui_input_list(src, "Select ruin", "Jump to Ruin", names) var/obj/effect/landmark/ruin/landmark = names[ruinname] @@ -725,7 +725,7 @@ for(var/name in SSmapping.ice_ruins_underground_templates) names[name] = list(SSmapping.ice_ruins_underground_templates[name], ZTRAIT_ICE_RUINS_UNDERGROUND, list(/area/icemoon/underground/unexplored)) - var/ruinname = input("Select ruin", "Spawn Ruin") as null|anything in names + var/ruinname = tgui_input_list(src, "Select ruin", "Spawn Ruin", names) var/data = names[ruinname] if (!data) return @@ -833,7 +833,7 @@ "Total Time" = /proc/cmp_profile_time_dsc, "Call Count" = /proc/cmp_profile_count_dsc ) - var/sort = input(src, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist + var/sort = tgui_input_list(src, "Sort type?", "Sort Type", sortlist) if (!sort) return sort = sortlist[sort] diff --git a/code/modules/admin/verbs/dice.dm b/code/modules/admin/verbs/dice.dm index 567d48362f..25f067c392 100644 --- a/code/modules/admin/verbs/dice.dm +++ b/code/modules/admin/verbs/dice.dm @@ -4,8 +4,8 @@ if(!check_rights(R_FUN)) return - var/sum = input("How many times should we throw?") as num - var/side = input("Select the number of sides.") as num + var/sum = tgui_input_num(src, "How many times should we throw?") + var/side = tgui_input_num(src, "Select the number of sides.") if(!side) side = 6 if(!sum) diff --git a/code/modules/admin/verbs/fps.dm b/code/modules/admin/verbs/fps.dm index d1f2578041..4364840220 100644 --- a/code/modules/admin/verbs/fps.dm +++ b/code/modules/admin/verbs/fps.dm @@ -8,7 +8,7 @@ return var/cfg_fps = CONFIG_GET(number/fps) - var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null) + var/new_fps = round(tgui_input_num(src, "Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps)) if(new_fps <= 0) to_chat(src, "Error: set_server_fps(): Invalid world.fps value. No changes made.") diff --git a/code/modules/admin/verbs/machine_upgrade.dm b/code/modules/admin/verbs/machine_upgrade.dm index 58deff2a24..f5652da846 100644 --- a/code/modules/admin/verbs/machine_upgrade.dm +++ b/code/modules/admin/verbs/machine_upgrade.dm @@ -4,7 +4,7 @@ if (!istype(M)) return - var/new_rating = input("Enter new rating:","Num") as num + var/new_rating = tgui_input_num(usr, "Enter new rating:","Num") if(new_rating && M.component_parts) for(var/obj/item/stock_parts/P in M.component_parts) P.rating = new_rating diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm index b2648735ec..6461778eed 100644 --- a/code/modules/admin/verbs/manipulate_organs.dm +++ b/code/modules/admin/verbs/manipulate_organs.dm @@ -1,7 +1,7 @@ /client/proc/manipulate_organs(mob/living/carbon/C in world) set name = "Manipulate Organs" set category = "Debug" - var/operation = input("Select organ operation.", "Organ Manipulation", "cancel") as null|anything in list("add organ", "add implant", "drop organ/implant", "remove organ/implant", "cancel") + var/operation = tgui_input_list(src, "Select organ operation.", "Organ Manipulation", list("add organ", "add implant", "drop organ/implant", "remove organ/implant", "cancel")) if (!operation) return @@ -12,7 +12,7 @@ var/dat = replacetext("[path]", "/obj/item/organ/", ":") organs[dat] = path - var/obj/item/organ/organ = input("Select organ type:", "Organ Manipulation", null) as null|anything in organs + var/obj/item/organ/organ = tgui_input_list(src, "Select organ type:", "Organ Manipulation", organs) if(!organ) return organ = organs[organ] @@ -26,7 +26,7 @@ var/dat = replacetext("[path]", "/obj/item/implant/", ":") organs[dat] = path - var/obj/item/implant/organ = input("Select implant type:", "Organ Manipulation", null) as null|anything in organs + var/obj/item/implant/organ = tgui_input_list(src, "Select implant type:", "Organ Manipulation", organs) if(!organ) return organ = organs[organ] @@ -44,7 +44,7 @@ var/obj/item/implant/I = X organs["[I.name] ([I.type])"] = I - var/obj/item/organ = input("Select organ/implant:", "Organ Manipulation", null) as null|anything in organs + var/obj/item/organ = tgui_input_list(src, "Select organ/implant:", "Organ Manipulation", organs) if(!organ) return organ = organs[organ] diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index cda19e1201..620667046e 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -4,7 +4,7 @@ var/datum/map_template/template - var/map = input(src, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in SSmapping.map_templates + var/map = tgui_input_list(src, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template", SSmapping.map_templates) if(!map) return template = SSmapping.map_templates[map] @@ -19,7 +19,7 @@ item.plane = ABOVE_LIGHTING_PLANE preview += item var/list/orientations = list("South" = SOUTH, "North" = NORTH, "East" = EAST, "West" = WEST) - var/choice = input(src, "Which orientation? Maps are normally facing SOUTH.", "Template Orientation", "South") as null|anything in orientations + var/choice = tgui_input_list(src, "Which orientation? Maps are normally facing SOUTH.", "Template Orientation", orientations) var/orientation = orientations[choice] images += preview if(tgui_alert(src, "Confirm location.","Template Confirm",list("Yes","No")) == "Yes") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 221f43c6e6..8b01981ace 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -219,7 +219,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) /client/proc/count_objects_on_z_level() set category = "Mapping" set name = "Count Objects On Level" - var/level = input("Which z-level?","Level?") as text + var/level = tgui_input_text(src, "Which z-level?","Level?") if(!level) return var/num_level = text2num(level) @@ -228,7 +228,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) if(!isnum(num_level)) return - var/type_text = input("Which type path?","Path?") as text + var/type_text = tgui_input_text(src, "Which type path?","Path?") if(!type_text) return var/type_path = text2path(type_text) @@ -259,7 +259,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) set category = "Mapping" set name = "Count Objects All" - var/type_text = input("Which type path?","") as text + var/type_text = tgui_input_text(src, "Which type path?","") if(!type_text) return var/type_path = text2path(type_text) diff --git a/code/modules/admin/verbs/maprotation.dm b/code/modules/admin/verbs/maprotation.dm index 378aab0f70..08b4dfff5b 100644 --- a/code/modules/admin/verbs/maprotation.dm +++ b/code/modules/admin/verbs/maprotation.dm @@ -33,7 +33,7 @@ mapname += "\]" maprotatechoices[mapname] = VM - var/chosenmap = input("Choose a map to change to", "Change Map") as null|anything in maprotatechoices + var/chosenmap = tgui_input_list(src, "Choose a map to change to", "Change Map", maprotatechoices) if (!chosenmap) return SSticker.maprotatechecked = 1 diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index de064835c3..87eb782aee 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -5,7 +5,7 @@ return var/freq = 1 - var/vol = input(usr, "What volume would you like the sound to play at?",, 100) as null|num + var/vol = tgui_input_num(usr, "What volume would you like the sound to play at?",, 100) if(!vol) return vol = clamp(vol, 1, 100) @@ -61,7 +61,7 @@ to_chat(src, "Youtube-dl was not configured, action unavailable") //Check config.txt for the INVOKE_YOUTUBEDL value return - var/web_sound_input = input("Enter content URL (supported sites only, leave blank to stop playing)", "Play Internet Sound via youtube-dl") as text|null + var/web_sound_input = tgui_input_text(src, "Enter content URL (supported sites only, leave blank to stop playing)", "Play Internet Sound via youtube-dl") if(istext(web_sound_input)) var/web_sound_url = "" var/stop_web_sounds = FALSE @@ -139,7 +139,7 @@ if(!check_rights(R_SOUNDS)) return - var/web_sound_input = input("Enter content stream URL (must be a direct link)", "Play Internet Sound via direct URL") as text|null + var/web_sound_input = tgui_input_text(src, "Enter content stream URL (must be a direct link)", "Play Internet Sound via direct URL") if(istext(web_sound_input)) if(!length(web_sound_input)) log_admin("[key_name(src)] stopped web sound") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 1635fc9a52..02d2591d85 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -29,7 +29,7 @@ return message_admins("[key_name_admin(src)] has started answering [ADMIN_LOOKUPFLW(M)]'s prayer.") - var/msg = input("Message:", text("Subtle PM to [M.key]")) as text|null + var/msg = tgui_input_text(src, "Message:", text("Subtle PM to [M.key]")) if (!msg) message_admins("[key_name_admin(src)] decided not to answer [ADMIN_LOOKUPFLW(M)]'s prayer") @@ -65,12 +65,12 @@ return if (!sender) - sender = input("Who is the message from?", "Sender") as null|anything in list(RADIO_CHANNEL_CENTCOM,RADIO_CHANNEL_SYNDICATE) + sender = tgui_input_list(src, "Who is the message from?", "Sender", list(RADIO_CHANNEL_CENTCOM,RADIO_CHANNEL_SYNDICATE)) if(!sender) return message_admins("[key_name_admin(src)] has started answering [key_name_admin(H)]'s [sender] request.") - var/input = input("Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from [sender]", "") as text|null + var/input = tgui_input_text(src, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from [sender]", "") if(!input) message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(H)]'s [sender] request.") return @@ -100,7 +100,7 @@ if(operation == "set") prompt = "Please enter the new reputation value:" - msg = input("Message:", prompt) as num|null + msg = tgui_input_num(src, "Message:", prompt) if (!msg) return @@ -134,7 +134,7 @@ if(!check_rights(R_ADMIN)) return - var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text|null + var/msg = tgui_input_text(src, "Message:", text("Enter the text you wish to appear to everyone:")) if (!msg) return @@ -151,12 +151,12 @@ return if(!M) - M = input("Direct narrate to whom?", "Active Players") as null|anything in GLOB.player_list + M = tgui_input_list(src, "Direct narrate to whom?", "Active Players", GLOB.player_list) if(!M) return - var/msg = input("Message:", text("Enter the text you wish to appear to your target:")) as text|null + var/msg = tgui_input_text(src, "Message:", text("Enter the text you wish to appear to your target:")) if( !msg ) return @@ -176,10 +176,10 @@ return if(!A) return - var/range = input("Range:", "Narrate to mobs within how many tiles:", 7) as num|null + var/range = tgui_input_num(src, "Range:", "Narrate to mobs within how many tiles:", 7) if(!range) return - var/msg = input("Message:", text("Enter the text you wish to appear to everyone within view:")) as text|null + var/msg = tgui_input_text(src, "Message:", text("Enter the text you wish to appear to everyone within view:")) if (!msg) return for(var/mob/M in view(range,A)) @@ -296,13 +296,13 @@ continue //we have a live body we are tied to candidates += M.ckey if(candidates.len) - ckey = input("Pick the player you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates + ckey = tgui_input_list(usr, "Pick the player you want to respawn as a xeno.", "Suitable Candidates", candidates) else to_chat(usr, "Error: create_xeno(): no suitable candidates.") if(!istext(ckey)) return 0 - var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva") + var/alien_caste = tgui_input_list(usr, "Please choose which caste to spawn.","Pick a caste", list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva")) var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : null var/mob/living/carbon/alien/new_xeno switch(alien_caste) @@ -341,7 +341,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/input = ckey(input(src, "Please specify which key will be respawned.", "Key", "")) + var/input = ckey(tgui_input_text(src, "Please specify which key will be respawned.", "Key", "")) if(!input) return @@ -509,7 +509,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null + var/input = tgui_input_text(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") if(!input) return @@ -552,7 +552,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/input = input(usr, "Enter a Command Report. Ensure it makes sense IC.", "What?", "") as message|null + var/input = tgui_input_message(usr, "Enter a Command Report. Ensure it makes sense IC.", "What?", "") if(!input) return @@ -578,13 +578,13 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/input = input(usr, "Enter a priority announcement. Ensure it makes sense IC.", "What?", "") as message|null + var/input = tgui_input_message(src, "Enter a priority announcement. Ensure it makes sense IC.", "What?", "") if(!input) return - var/title = input(src, "What should the title be?", "What?","") as text|null + var/title = tgui_input_text(src, "What should the title be?", "What?","") - var/special_name = input(src, "Who is making the announcement?", "Who?", "") as text|null + var/special_name = tgui_input_text(src, "Who is making the announcement?", "Who?", "") priority_announce(input, title, sender_override = special_name) log_admin("[key_name(src)] has sent a priority announcement: [input]") @@ -598,7 +598,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/input = input(usr, "Please input a new name for Central Command.", "What?", "") as text|null + var/input = tgui_input_text(usr, "Please input a new name for Central Command.", "What?", "") if(!input) return change_command_name(input) @@ -630,19 +630,19 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/devastation = input("Range of total devastation. -1 to none", text("Input")) as num|null + var/devastation = tgui_input_num(src, "Range of total devastation. -1 to none", text("Input")) if(devastation == null) return - var/heavy = input("Range of heavy impact. -1 to none", text("Input")) as num|null + var/heavy = tgui_input_num(src, "Range of heavy impact. -1 to none", text("Input")) if(heavy == null) return - var/light = input("Range of light impact. -1 to none", text("Input")) as num|null + var/light = tgui_input_num(src, "Range of light impact. -1 to none", text("Input")) if(light == null) return - var/flash = input("Range of flash. -1 to none", text("Input")) as num|null + var/flash = tgui_input_num(src, "Range of flash. -1 to none", text("Input")) if(flash == null) return - var/flames = input("Range of flames. -1 to none", text("Input")) as num|null + var/flames = tgui_input_num(src, "Range of flames. -1 to none", text("Input")) if(flames == null) return @@ -666,7 +666,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/range = input("Range.", text("Input")) as num|null + var/range = tgui_input_num(src, "Range.", text("Input")) if(!range) return log_admin("[key_name(usr)] created an EM Pulse - log below") //because we'll just log the empulse itself @@ -727,7 +727,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set desc = "switches between 1x and custom views" if(view_size.getView() == view_size.default) - view_size.setTo(input("Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,128) - 7) + view_size.setTo(tgui_input_list(src, "Select view range:", "FUCK YE", list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,128) - 7)) else view_size.resetToDefault(getScreenSize(prefs.widescreenpref)) @@ -872,7 +872,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/level = input("Select security level to change to","Set Security Level") as null|anything in list("green","blue","amber","red","delta") + var/level = tgui_input_list(src, "Select security level to change to","Set Security Level", list("green","blue","amber","red","delta")) if(level) set_security_level(level) @@ -888,7 +888,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return if(!N.timing) - var/newtime = input(usr, "Set activation timer.", "Activate Nuke", "[N.timer_set]") as num|null + var/newtime = tgui_input_num(usr, "Set activation timer.", "Activate Nuke", "[N.timer_set]") if(!newtime) return N.timer_set = newtime @@ -1117,11 +1117,11 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!holder) return - var/weather_type = input("Choose a weather", "Weather") as null|anything in subtypesof(/datum/weather) + var/weather_type = tgui_input_list(src, "Choose a weather", "Weather", subtypesof(/datum/weather)) if(!weather_type) return - var/z_level = input("Z-Level to target? Leave blank to target current Z-Level.", "Z-Level") as num|null + var/z_level = tgui_input_num(src, "Z-Level to target? Leave blank to target current Z-Level.", "Z-Level") if(!isnum(z_level)) if(!src.mob) return @@ -1213,7 +1213,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/input = input(usr, "Please specify your tip that you want to send to the players.", "Tip", "") as message|null + var/input = tgui_input_message(usr, "Please specify your tip that you want to send to the players.", "Tip", "") if(!input) return @@ -1338,7 +1338,7 @@ Traitors and the like can also be revived with the previous role mostly intact. ADMIN_PUNISHMENT_SCARIFY, ADMIN_PUNISHMENT_CLUWNE) - var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in punishment_list + var/punishment = tgui_input_list(usr, "Choose a punishment", "DIVINE SMITING", punishment_list) if(QDELETED(target) || !punishment) return @@ -1365,7 +1365,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/turf/endT = spaceDebrisFinishLoc(startside, T.z) new /obj/effect/immovablerod(startT, endT,target) if(ADMIN_PUNISHMENT_SUPPLYPOD_QUICK) - var/target_path = input(usr,"Enter typepath of an atom you'd like to send with the pod (type \"empty\" to send an empty pod):" ,"Typepath","/obj/item/reagent_containers/food/snacks/grown/harebell") as null|text + var/target_path = tgui_input_text(usr,"Enter typepath of an atom you'd like to send with the pod (type \"empty\" to send an empty pod):" ,"Typepath","/obj/item/reagent_containers/food/snacks/grown/harebell") var/area/pod_storage_area = locate(/area/centcom/supplypod/podStorage) in GLOB.sortedAreas var/obj/structure/closet/supplypod/centcompod/pod = new(pick(get_area_turfs(pod_storage_area))) //Lets not runtime pod.damage = 40 @@ -1404,13 +1404,13 @@ Traitors and the like can also be revived with the previous role mostly intact. if(ADMIN_PUNISHMENT_CUSTOM_PIE) var/obj/item/reagent_containers/food/snacks/pie/cream/nostun/A = new() if(!A.reagents) - var/amount = input(usr, "Specify the reagent size of [A]", "Set Reagent Size", 50) as num|null + var/amount = tgui_input_num(usr, "Specify the reagent size of [A]", "Set Reagent Size", 50) if(amount) A.create_reagents(amount) if(A.reagents) var/chosen_id = choose_reagent_id(usr) if(chosen_id) - var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num|null + var/amount = tgui_input_num(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) if(amount) A.reagents.add_reagent(chosen_id, amount) A.splat(target) @@ -1449,7 +1449,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/list/how_fucked_is_this_dude = list("A little", "A lot", "So fucking much", "FUCK THIS DUDE") - var/hatred = input("How much do you hate this guy?") in how_fucked_is_this_dude + var/hatred = tgui_input_list(usr, "How much do you hate this guy?", "", how_fucked_is_this_dude) var/repetitions var/shots_per_limb_per_rep = 2 var/damage @@ -1545,7 +1545,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return var/message = pick(GLOB.admiral_messages) - message = input("Enter message from the on-call admiral to be put in the recall report.", "Admiral Message", message) as text|null + message = tgui_input_text(src, "Enter message from the on-call admiral to be put in the recall report.", "Admiral Message", message) if(!message) return @@ -1659,7 +1659,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!D) return - var/add_or_remove = input("Remove/Add?", "Trait Remove/Add") as null|anything in list("Add","Remove") + var/add_or_remove = tgui_input_list(usr, "Remove/Add?", "Trait Remove/Add", list("Add","Remove")) if(!add_or_remove) return var/list/availible_traits = list() @@ -1676,7 +1676,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/name = GLOB.trait_name_map[trait] || trait availible_traits[name] = trait - var/chosen_trait = input("Select trait to modify", "Trait") as null|anything in sortList(availible_traits) + var/chosen_trait = tgui_input_list(src, "Select trait to modify", "Trait", sortList(availible_traits)) if(!chosen_trait) return chosen_trait = availible_traits[chosen_trait] @@ -1686,14 +1686,14 @@ Traitors and the like can also be revived with the previous role mostly intact. if("Add") //Not doing source choosing here intentionally to make this bit faster to use, you can always vv it. ADD_TRAIT(D,chosen_trait,source) if("Remove") - var/specific = input("All or specific source ?", "Trait Remove/Add") as null|anything in list("All","Specific") + var/specific = tgui_input_list(src, "All or specific source ?", "Trait Remove/Add", list("All","Specific")) if(!specific) return switch(specific) if("All") source = null if("Specific") - source = input("Source to be removed","Trait Remove/Add") as null|anything in sortList(D.status_traits[chosen_trait]) + source = tgui_input_list(src, "Source to be removed","Trait Remove/Add", sortList(D.status_traits[chosen_trait])) if(!source) return REMOVE_TRAIT(D,chosen_trait,source) @@ -1708,7 +1708,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/turf/T = get_turf(usr) - target = input("Any specific target in mind? Please note only live, non cluwned, human targets are valid.", "Target", target) as null|anything in GLOB.player_list + target = tgui_input_list(src, "Any specific target in mind? Please note only live, non cluwned, human targets are valid.", "Target", GLOB.player_list) if(target && ishuman(target)) var/mob/living/carbon/human/H = target var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(T) diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index d8b927c670..b315c02ffe 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -104,7 +104,7 @@ message_admins("[key_name_admin(holder)] has removed the cap on security officers.") //Buttons for helpful stuff. This is where people land in the tgui if("clear_virus") - var/choice = input("Are you sure you want to cure all disease?") in list("Yes", "Cancel") + var/choice = tgui_input_list(holder, "Are you sure you want to cure all disease?", "", list("Yes", "Cancel")) if(choice == "Yes") message_admins("[key_name_admin(holder)] has cured all diseases.") for(var/thing in SSdisease.active_diseases) @@ -181,7 +181,7 @@ var/area/template = GLOB.areas_by_type[/area/tdome/arena_source] template.copy_contents_to(thunderdome) if("set_name") - var/new_name = input(holder, "Please input a new name for the station.", "What?", "") as text|null + var/new_name = tgui_input_text(holder, "Please input a new name for the station.", "What?", "") if(!new_name) return set_station_name(new_name) @@ -246,7 +246,7 @@ var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control E = DC.runEvent() if("Choose") - var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sortList(typesof(/datum/disease), /proc/cmp_typepaths_asc) + var/virus = tgui_input_list(holder, "Choose the virus to spread", "BIOHAZARD", sortList(typesof(/datum/disease), /proc/cmp_typepaths_asc)) var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control var/datum/round_event/disease_outbreak/DO = DC.runEvent() DO.virus_type = virus @@ -254,7 +254,7 @@ if("allspecies") if(!is_funmin) return - var/result = input(holder, "Please choose a new species","Species") as null|anything in GLOB.species_list + var/result = tgui_input_list(holder, "Please choose a new species","Species", GLOB.species_list) if(result) SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Mass Species Change", "[result]")) log_admin("[key_name(holder)] turned all humans into [result]", 1) @@ -452,7 +452,7 @@ return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Bomb Cap")) - var/newBombCap = input(holder,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) as num|null + var/newBombCap = tgui_input_num(holder,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) if (!CONFIG_SET(number/bombcap, newBombCap)) return diff --git a/code/modules/admin/verbs/shuttlepanel.dm b/code/modules/admin/verbs/shuttlepanel.dm index ef584272b7..e69c9aa050 100644 --- a/code/modules/admin/verbs/shuttlepanel.dm +++ b/code/modules/admin/verbs/shuttlepanel.dm @@ -24,7 +24,7 @@ options += "Delete Shuttle" options += "Into The Sunset (delete & greentext 'escape')" - var/selection = input(user, "Select where to fly [name || id]:", "Fly Shuttle") as null|anything in options + var/selection = tgui_input_list(user, "Select where to fly [name || id]:", "Fly Shuttle", options) if(!selection) return @@ -67,7 +67,7 @@ if (canDock(S) == SHUTTLE_CAN_DOCK) options[S.name || S.id] = S - var/selection = input(user, "Select the new arrivals destination:", "Fly Shuttle") as null|anything in options + var/selection = tgui_input_list(user, "Select the new arrivals destination:", "Fly Shuttle", options) if(!selection) return target_dock = options[selection] diff --git a/code/modules/admin/view_variables/get_variables.dm b/code/modules/admin/view_variables/get_variables.dm index 15263ec695..ee53a06ce1 100644 --- a/code/modules/admin/view_variables/get_variables.dm +++ b/code/modules/admin/view_variables/get_variables.dm @@ -83,25 +83,25 @@ if(extra_classes) classes += extra_classes - .["class"] = input(src, "What kind of data?", "Variable Type", default_class) as null|anything in classes + .["class"] = tgui_input_list(src, "What kind of data?", "Variable Type", classes) if(holder && holder.marked_datum && .["class"] == markstring) .["class"] = VV_MARKED_DATUM switch(.["class"]) if(VV_TEXT) - .["value"] = input("Enter new text:", "Text", current_value) as null|text + .["value"] = tgui_input_text(src, "Enter new text:", "Text", current_value) if(.["value"] == null) .["class"] = null return if(VV_MESSAGE) - .["value"] = input("Enter new text:", "Text", current_value) as null|message + .["value"] = tgui_input_message(src, "Enter new text:", "Text", current_value) if(.["value"] == null) .["class"] = null return if(VV_NUM) - .["value"] = input("Enter new number:", "Num", current_value) as null|num + .["value"] = tgui_input_num(src, "Enter new number:", "Num", current_value) if(.["value"] == null) .["class"] = null return @@ -128,7 +128,7 @@ var/type = current_value var/error = "" do - type = input("Enter type:[error]", "Type", type) as null|text + type = tgui_input_text(src, "Enter type:[error]", "Type", type) if(!type) break type = text2path(type) @@ -146,7 +146,7 @@ .["class"] = null return var/list/things = vv_reference_list(type, subtypes) - var/value = input("Select reference:", "Reference", current_value) as null|anything in things + var/value = tgui_input_list(src, "Select reference:", "Reference", things) if(!value) .["class"] = null return @@ -159,7 +159,7 @@ .["class"] = null return var/list/things = vv_reference_list(type, subtypes) - var/value = input("Select reference:", "Reference", current_value) as null|anything in things + var/value = tgui_input_list(src, "Select reference:", "Reference", things) if(!value) .["class"] = null return @@ -172,14 +172,14 @@ .["class"] = null return var/list/things = vv_reference_list(type, subtypes) - var/value = input("Select reference:", "Reference", current_value) as null|anything in things + var/value = tgui_input_list(src, "Select reference:", "Reference", things) if(!value) .["class"] = null return .["value"] = things[value] if(VV_CLIENT) - .["value"] = input("Select reference:", "Reference", current_value) as null|anything in GLOB.clients + .["value"] = tgui_input_list(src, "Select reference:", "Reference", GLOB.clients) if(.["value"] == null) .["class"] = null return @@ -234,7 +234,7 @@ var/type = current_value var/error = "" do - type = input("Enter type:[error]", "Type", type) as null|text + type = tgui_input_text(src, "Enter type:[error]", "Type", type) if(!type) break type = text2path(type) @@ -256,7 +256,7 @@ if(VV_TEXT_LOCATE) var/datum/D do - var/ref = input("Enter reference:", "Reference") as null|text + var/ref = tgui_input_text(src, "Enter reference:", "Reference") if(!ref) break D = locate(ref) diff --git a/code/modules/admin/view_variables/mass_edit_variables.dm b/code/modules/admin/view_variables/mass_edit_variables.dm index 6d7d10ebc0..b2171e5df1 100644 --- a/code/modules/admin/view_variables/mass_edit_variables.dm +++ b/code/modules/admin/view_variables/mass_edit_variables.dm @@ -31,7 +31,7 @@ names = sortList(names) - variable = input("Which var?", "Var") as null|anything in names + variable = tgui_input_list(src, "Which var?", "Var", names) else variable = var_name diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index 2febd0e0ef..3287c04cb8 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -131,7 +131,7 @@ GLOBAL_PROTECT(VVpixelmovement) value = "null" names["#[i] [key] = [value]"] = i if (!index) - var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)" + "(CLEAR NULLS)" + "(CLEAR DUPES)" + "(SHUFFLE)" + var/variable = tgui_input_list(src, "Which var?","Var",names + "(ADD VAR)" + "(CLEAR NULLS)" + "(CLEAR DUPES)" + "(SHUFFLE)") if(variable == null) return @@ -308,7 +308,7 @@ GLOBAL_PROTECT(VVpixelmovement) names = sortList(names) - variable = input("Which var?","Var") as null|anything in names + variable = tgui_input_list(src, "Which var?","Var",names) if(!variable) return diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index 29b5f539fe..e4f289ec21 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -86,7 +86,7 @@ var/Text = href_list["adjustDamage"] - var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num|null + var/amount = tgui_input_num(usr, "Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) if (isnull(amount)) return diff --git a/code/modules/admin/view_variables/topic_basic.dm b/code/modules/admin/view_variables/topic_basic.dm index 043c50173d..f8c1b6174e 100644 --- a/code/modules/admin/view_variables/topic_basic.dm +++ b/code/modules/admin/view_variables/topic_basic.dm @@ -68,7 +68,7 @@ names += componentsubtypes names += "---Elements---" names += sortList(subtypesof(/datum/element), /proc/cmp_typepaths_asc) - var/result = input(usr, "Choose a component/element to add","better know what ur fuckin doin pal") as null|anything in names + var/result = tgui_input_list(usr, "Choose a component/element to add","better know what ur fuckin doin pal",names) if(!usr || !result || result == "---Components---" || result == "---Elements---") return if(QDELETED(src)) diff --git a/code/modules/antagonists/abductor/abductor.dm b/code/modules/antagonists/abductor/abductor.dm index cbd631b889..4285e383c3 100644 --- a/code/modules/antagonists/abductor/abductor.dm +++ b/code/modules/antagonists/abductor/abductor.dm @@ -99,7 +99,7 @@ var/list/current_teams = list() for(var/datum/team/abductor_team/T in get_all_teams(/datum/team/abductor_team)) current_teams[T.name] = T - var/choice = input(admin,"Add to which team ?") as null|anything in (current_teams + "new team") + var/choice = tgui_input_list(admin,"Add to which team ?", "", current_teams + "new team") if (choice == "new team") team = new else if(choice in current_teams) diff --git a/code/modules/antagonists/blob/blob/powers.dm b/code/modules/antagonists/blob/blob/powers.dm index 9256d0d16b..f26a0e0002 100644 --- a/code/modules/antagonists/blob/blob/powers.dm +++ b/code/modules/antagonists/blob/blob/powers.dm @@ -72,7 +72,7 @@ for(var/i in 1 to GLOB.blob_nodes.len) var/obj/structure/blob/node/B = GLOB.blob_nodes[i] nodes["Blob Node #[i] ([get_area_name(B)])"] = B - var/node_name = input(src, "Choose a node to jump to.", "Node Jump") in nodes + var/node_name = tgui_input_list(src, "Choose a node to jump to.", "Node Jump", nodes) var/obj/structure/blob/node/chosen_node = nodes[node_name] if(chosen_node) forceMove(chosen_node.loc) @@ -352,7 +352,7 @@ var/datum/blobstrain/bs = pick((GLOB.valid_blobstrains)) choices[initial(bs.name)] = bs - var/choice = input(usr, "Please choose a new strain","Strain") as anything in choices + var/choice = tgui_input_list(usr, "Please choose a new strain","Strain", choices) if (choice && choices[choice] && !QDELETED(src)) var/datum/blobstrain/bs = choices[choice] set_strain(bs) diff --git a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm index 07c92bfd97..27f33ce546 100644 --- a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm +++ b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm @@ -289,7 +289,7 @@ options["\[ Not Now \]"] = null // Abort? if(options.len > 1) - var/choice = input(owner.current, "You have the opportunity to grow more ancient at the cost of [level_bloodcost] units of blood. Select a power to advance your Rank.", "Your Blood Thickens...") in options + var/choice = tgui_input_list(owner.current, "You have the opportunity to grow more ancient at the cost of [level_bloodcost] units of blood. Select a power to advance your Rank.", "Your Blood Thickens...", options) // Cheat-Safety: Can't keep opening/closing coffin to spam levels if(bloodsucker_level_unspent <= 0) // Already spent all your points, and tried opening/closing your coffin, pal. return diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index 30e6a80e85..8a5f23ae58 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -63,7 +63,7 @@ continue candidates[L.mind.name] = L.mind - var/choice = input(admin,"Choose the blood brother.", "Brother") as null|anything in candidates + var/choice = tgui_input_list(admin,"Choose the blood brother.", "Brother", candidates) if(!choice) return var/datum/mind/bro = candidates[choice] diff --git a/code/modules/antagonists/changeling/powers/hivemind.dm b/code/modules/antagonists/changeling/powers/hivemind.dm index f7718d7708..a342ae7b32 100644 --- a/code/modules/antagonists/changeling/powers/hivemind.dm +++ b/code/modules/antagonists/changeling/powers/hivemind.dm @@ -60,7 +60,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) to_chat(user, "The airwaves already have all of our DNA.") return - var/chosen_name = input("Select a DNA to channel: ", "Channel DNA", null) as null|anything in names + var/chosen_name = tgui_input_list(user, "Select a DNA to channel: ", "Channel DNA", names) if(!chosen_name) return @@ -107,7 +107,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 var/datum/changelingprofile/chosen_prof = names[S] diff --git a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm index d23a5d119b..a4cbdaa08f 100644 --- a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm +++ b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm @@ -459,7 +459,7 @@ for(var/datum/clockwork_rite/R in GLOB.all_clockwork_rites) if(is_servant_of_ratvar(user, require_full_power = TRUE) || !R.requires_full_power) possible_rites[R] = R - var/input_key = input(user, "Choose a rite", "Choosing a rite") as null|anything in possible_rites + var/input_key = tgui_input_list(user, "Choose a rite", "Choosing a rite", possible_rites) if(!input_key) return var/datum/clockwork_rite/CR = possible_rites[input_key] diff --git a/code/modules/antagonists/clockcult/clock_effects/spatial_gateway.dm b/code/modules/antagonists/clockcult/clock_effects/spatial_gateway.dm index ab8c7abd0a..e4fe9e8c9d 100644 --- a/code/modules/antagonists/clockcult/clock_effects/spatial_gateway.dm +++ b/code/modules/antagonists/clockcult/clock_effects/spatial_gateway.dm @@ -187,7 +187,7 @@ if(!possible_targets.len) to_chat(invoker, "There are no other eligible targets for a Spatial Gateway!") return FALSE - var/input_target_key = input(invoker, "Choose a target to form a rift to.", "Spatial Gateway") as null|anything in possible_targets + var/input_target_key = tgui_input_list(invoker, "Choose a target to form a rift to.", "Spatial Gateway", possible_targets) var/atom/movable/target = possible_targets[input_target_key] if(!src || !input_target_key || !invoker || !invoker.canUseTopic(src, !issilicon(invoker)) || !is_servant_of_ratvar(invoker) || (isitem(src) && invoker.get_active_held_item() != src) || !invoker.can_speak_vocal()) return FALSE //if any of the involved things no longer exist, the invoker is stunned, too far away to use the object, or does not serve ratvar, or if the object is an item and not in the mob's active hand, fail diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm index 8060b7b0cd..77b81ee536 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm @@ -371,7 +371,7 @@ update_quickbind() else // todo: async this due to ((input)) but its fine for now - var/target_index = input("Position of [initial(path.name)], 1 to [maximum_quickbound]?", "Input") as num|null + var/target_index = tgui_input_num(usr, "Position of [initial(path.name)], 1 to [maximum_quickbound]?", "Input") if(isnum(target_index) && target_index > 0 && target_index <= maximum_quickbound && !..()) var/datum/clockwork_scripture/S if(LAZYLEN(quickbound) >= target_index) diff --git a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm index db8b4b48ae..faea34b53e 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm @@ -156,7 +156,7 @@ commands += "Power This Structure" if(P.obj_integrity < P.max_integrity) commands += "Repair This Structure" - var/roma_invicta = input(src, "Choose a command to issue to your cult!", "Issue Commands") as null|anything in commands + var/roma_invicta = tgui_input_list(src, "Choose a command to issue to your cult!", "Issue Commands", commands) if(!roma_invicta) return var/command_text = "" @@ -290,7 +290,7 @@ to_chat(owner, "There are no Obelisks to warp to!") return - var/target_key = input(owner, "Choose an Obelisk to warp to.", "Obelisk Warp") as null|anything in possible_targets + var/target_key = tgui_input_list(owner, "Choose an Obelisk to warp to.", "Obelisk Warp", possible_targets) var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/target = possible_targets[target_key] if(!target_key || !owner) diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index b31b93744e..a8fe894eda 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -49,7 +49,7 @@ to_chat(owner, "Your body has reached its limit, you cannot store more than [MAX_BLOODCHARGE] spells at once. Pick a spell to nullify.") else to_chat(owner, "Your body has reached its limit, you cannot have more than [RUNELESS_MAX_BLOODCHARGE] spells at once without an empowering rune! Pick a spell to nullify.") - var/nullify_spell = input(owner, "Choose a spell to remove.", "Current Spells") as null|anything in spells + var/nullify_spell = tgui_input_list(owner, "Choose a spell to remove.", "Current Spells", spells) if(nullify_spell) qdel(nullify_spell) return @@ -61,9 +61,9 @@ var/cult_name = initial(J.name) possible_spells[cult_name] = J 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)") - var/nullify_spell = input(owner, "Choose a spell to remove.", "Current Spells") as null|anything in spells + var/nullify_spell = tgui_input_list(owner, "Choose a spell to remove.", "Current Spells", spells) if(nullify_spell) qdel(nullify_spell) return @@ -497,7 +497,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.is_holding(src) || user.incapacitated() || !actual_selected_rune || !proximity) return @@ -787,7 +787,7 @@ /obj/item/melee/blood_magic/manipulator/attack_self(mob/living/user) if(iscultist(user)) var/list/options = list("Blood Spear (150)", "Blood Bolt Barrage (300)", "Blood Beam (500)") - 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(!choice) to_chat(user, "You decide against conducting a greater blood rite.") return diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 35151953a0..e55d6bcb02 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -665,7 +665,7 @@ for(var/datum/mind/M in SSticker.mode.cult) if(M.current && M.current.stat != DEAD) cultists |= M.current - var/mob/living/cultist_to_receive = input(user, "Who do you wish to call to [src]?", "Followers of the Geometer") as null|anything in (cultists - user) + var/mob/living/cultist_to_receive = tgui_input_list(user, "Who do you wish to call to [src]?", "Followers of the Geometer", cultists - user) if(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated()) return if(!cultist_to_receive) diff --git a/code/modules/antagonists/cult/ritual.dm b/code/modules/antagonists/cult/ritual.dm index f299bdc4b2..0a93dc3675 100644 --- a/code/modules/antagonists/cult/ritual.dm +++ b/code/modules/antagonists/cult/ritual.dm @@ -53,7 +53,7 @@ This file contains the cult dagger and rune list code if(!check_rune_turf(Turf, user)) return - entered_rune_name = input(user, "Choose a rite to scribe.", "Sigils of Power") as null|anything in GLOB.rune_types + entered_rune_name = tgui_input_list(user, "Choose a rite to scribe.", "Sigils of Power", GLOB.rune_types) if(!src || QDELETED(src) || !Adjacent(user) || user.incapacitated() || !check_rune_turf(Turf, user)) return rune_to_scribe = GLOB.rune_types[entered_rune_name] diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index af5ab08d05..46ffba70b4 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -385,7 +385,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(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated() || !actual_selected_rune) fail_invoke() @@ -562,7 +562,7 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() return if(potential_revive_mobs.len > 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 mob_to_revive = potential_revive_mobs[1] if(QDELETED(src) || !validness_checks(mob_to_revive, user)) @@ -719,7 +719,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 - var/mob/living/cultist_to_summon = input(user, "Who do you wish to call to [src]?", "Followers of the Geometer") as null|anything in cultists + var/mob/living/cultist_to_summon = tgui_input_list(user, "Who do you wish to call to [src]?", "Followers of the Geometer", cultists) if(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated()) return if(!cultist_to_summon) diff --git a/code/modules/antagonists/devil/sintouched/sintouched.dm b/code/modules/antagonists/devil/sintouched/sintouched.dm index c9bf474567..67fed36bb3 100644 --- a/code/modules/antagonists/devil/sintouched/sintouched.dm +++ b/code/modules/antagonists/devil/sintouched/sintouched.dm @@ -56,7 +56,7 @@ /datum/antagonist/sintouched/admin_add(datum/mind/new_owner,mob/admin) var/choices = sins + "Random" - var/chosen_sin = input(admin,"What kind ?","Sin kind") as null|anything in choices + var/chosen_sin = tgui_input_list(admin,"What kind ?","Sin kind", choices) if(!chosen_sin) return if(chosen_sin in sins) diff --git a/code/modules/antagonists/eldritch_cult/eldritch_items.dm b/code/modules/antagonists/eldritch_cult/eldritch_items.dm index 28228aedd6..0f297ccb28 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_items.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_items.dm @@ -350,7 +350,7 @@ drawing = TRUE - var/type = pick_list[input(user,"Choose the rune","Rune") as null|anything in pick_list ] + var/type = pick_list[tgui_input_list(user,"Choose the rune","Rune", pick_list)] if(!type) drawing = FALSE return diff --git a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm index 33a17c3278..71a2d0580e 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm @@ -170,7 +170,7 @@ to_chat(user, "These items don't possess the required fingerprints or DNA.") return FALSE - var/chosen_mob = input("Select the person you wish to curse","Your target") as null|anything in sortList(compiled_list, /proc/cmp_mob_realname_dsc) + var/chosen_mob = tgui_input_list(user, "Select the person you wish to curse","Your target", sortList(compiled_list, /proc/cmp_mob_realname_dsc)) if(!chosen_mob) return FALSE curse(compiled_list[chosen_mob]) @@ -296,7 +296,7 @@ if(!targeted) break targets["[targeted.current.real_name] the [targeted.assigned_role]"] = targeted.current - LH.target = targets[input(user,"Choose your next target","Target") in targets] + LH.target = targets[tgui_input_list(user,"Choose your next target","Target", targets)] if(!LH.target && targets.len) LH.target = pick(targets) //Tsk tsk, you can and will get another target if you want it or not. diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm index 158acc0071..1d4bcd3910 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm @@ -621,7 +621,7 @@ if(!originator?.linked_mobs[living_owner]) CRASH("Uh oh the mansus link got somehow activated without it being linked to a raw prophet or the mob not being in a list of mobs that should be able to do it.") - var/message = sanitize(input("Message:", "Telepathy from the Manse") as text|null) + var/message = sanitize(tgui_input_text(usr, "Message:", "Telepathy from the Manse")) if(QDELETED(living_owner)) return diff --git a/code/modules/antagonists/eldritch_cult/eldritch_structures.dm b/code/modules/antagonists/eldritch_cult/eldritch_structures.dm index 01fd945cba..b920a1040a 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_structures.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_structures.dm @@ -80,7 +80,7 @@ for(var/X in subtypesof(/obj/item/eldritch_potion)) var/obj/item/eldritch_potion/potion = X lst[initial(potion.name)] = potion - var/type = lst[input(user,"Choose your brew","Brew") in lst] + var/type = lst[tgui_input_list(user,"Choose your brew","Brew", lst)] playsound(src, 'sound/misc/desceration-02.ogg', 75, TRUE) new type(drop_location()) current_mass = 0 diff --git a/code/modules/antagonists/nukeop/equipment/borgchameleon.dm b/code/modules/antagonists/nukeop/equipment/borgchameleon.dm index b3c31152a5..c01460b386 100644 --- a/code/modules/antagonists/nukeop/equipment/borgchameleon.dm +++ b/code/modules/antagonists/nukeop/equipment/borgchameleon.dm @@ -66,7 +66,7 @@ if(animation_playing) to_chat(user, "\the [src] is recharging.") return - var/borg_icon = input(user, "Select an icon!", "Robot Icon", null) as null|anything in engymodels + var/borg_icon = tgui_input_list(user, "Select an icon!", "Robot Icon", engymodels) if(!borg_icon) return FALSE switch(borg_icon) diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm index 44f267358a..9bd4a922bc 100644 --- a/code/modules/antagonists/wizard/equipment/artefact.dm +++ b/code/modules/antagonists/wizard/equipment/artefact.dm @@ -285,7 +285,7 @@ /obj/item/voodoo/attack_self(mob/user) if(!target && length(possible)) - 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) @@ -300,7 +300,7 @@ if(target && cooldown < world.time) switch(user.zone_selected) if(BODY_ZONE_PRECISE_MOUTH) - var/wgw = sanitize(input(user, "What would you like the victim to say", "Voodoo", null) as text) + var/wgw = sanitize(tgui_input_text(user, "What would you like the victim to say", "Voodoo", null)) target.say(wgw, forced = "voodoo doll") log_game("[key_name(user)] made [key_name(target)] say [wgw] with a voodoo doll.") if(BODY_ZONE_PRECISE_EYES) diff --git a/code/modules/arousal/arousal.dm b/code/modules/arousal/arousal.dm index 36da6c73ba..7f80cae837 100644 --- a/code/modules/arousal/arousal.dm +++ b/code/modules/arousal/arousal.dm @@ -16,7 +16,7 @@ set name = "Toggle undergarments" set category = "IC" - var/confirm = input(src, "Select what part of your form to alter", "Undergarment Toggling") as null|anything in list("Top", "Bottom", "Socks", "All") + var/confirm = tgui_input_list(src, "Select what part of your form to alter", "Undergarment Toggling", list("Top", "Bottom", "Socks", "All")) if(!confirm) return if(confirm == "Top") @@ -127,7 +127,7 @@ if(CHECK_BITFIELD(G.genital_flags, CAN_CLIMAX_WITH) && G.is_exposed(worn_stuff)) //filter out what you can't masturbate with LAZYADD(genitals_list, G) if(LAZYLEN(genitals_list)) - var/obj/item/organ/genital/ret_organ = input(src, "with what?", "Climax", null) as null|obj in genitals_list + var/obj/item/organ/genital/ret_organ = tgui_input_list(src, "with what?", "Climax", genitals_list) return ret_organ else if(!silent) to_chat(src, "You cannot climax without available genitals.") @@ -151,10 +151,10 @@ if(!silent) to_chat(src, "You cannot do this alone.") return //No one left. - var/mob/living/target = input(src, "With whom?", "Sexual partner", null) as null|anything in partners //pick one, default to null + var/mob/living/target = tgui_input_list(src, "With whom?", "Sexual partner", partners) //pick one, default to null if(target && in_range(src, target)) to_chat(src,"Waiting for consent...") - var/consenting = input(target, "Do you want [src] to climax with you?","Climax mechanics","No") in list("Yes","No") + var/consenting = tgui_input_list(target, "Do you want [src] to climax with you?","Climax mechanics", list("Yes","No")) if(consenting == "Yes") return target else @@ -172,7 +172,7 @@ containers_list += C if(containers_list.len) - var/obj/item/reagent_containers/SC = input(src, "Into or onto what?(Cancel for nowhere)", null) as null|obj in containers_list + var/obj/item/reagent_containers/SC = tgui_input_list(src, "Into or onto what?(Cancel for nowhere)", "", containers_list) if(SC && CanReach(SC)) return SC else if(!silent) @@ -226,7 +226,7 @@ return //Ok, now we check what they want to do. - var/choice = input(src, "Select sexual activity", "Sexual activity:") as null|anything in list("Climax alone","Climax with partner", "Fill container") + var/choice = tgui_input_list(src, "Select sexual activity", "Sexual activity:", list("Climax alone","Climax with partner", "Fill container")) if(!choice) return @@ -243,7 +243,7 @@ if(picked_organ) var/mob/living/partner = pick_partner() //Get someone if(partner) - var/spillage = input(src, "Would your fluids spill outside?", "Choose overflowing option", "Yes") as null|anything in list("Yes", "No") + var/spillage = tgui_input_list(src, "Would your fluids spill outside?", "Choose overflowing option", list("Yes", "No")) if(spillage && in_range(src, partner)) mob_climax_partner(picked_organ, partner, spillage == "Yes" ? TRUE : FALSE) if("Fill container") diff --git a/code/modules/arousal/genitals.dm b/code/modules/arousal/genitals.dm index bfcaff7d56..1df6c17774 100644 --- a/code/modules/arousal/genitals.dm +++ b/code/modules/arousal/genitals.dm @@ -118,9 +118,9 @@ return //Full list of exposable genitals created var/obj/item/organ/genital/picked_organ - picked_organ = input(src, "Choose which genitalia to expose/hide", "Expose/Hide genitals") as null|anything in genital_list + picked_organ = tgui_input_list(src, "Choose which genitalia to expose/hide", "Expose/Hide genitals", genital_list) if(picked_organ && (picked_organ in internal_organs)) - var/picked_visibility = input(src, "Choose visibility setting", "Expose/Hide genitals") as null|anything in GLOB.genitals_visibility_toggles + var/picked_visibility = tgui_input_list(src, "Choose visibility setting", "Expose/Hide genitals", GLOB.genitals_visibility_toggles) if(picked_visibility && picked_organ && (picked_organ in internal_organs)) picked_organ.toggle_visibility(picked_visibility) return @@ -136,7 +136,7 @@ if(!genital_list.len) //There's nothing that can show arousal return var/obj/item/organ/genital/picked_organ - picked_organ = input(src, "Choose which genitalia to toggle arousal on", "Set genital arousal", null) in genital_list + picked_organ = tgui_input_list(src, "Choose which genitalia to toggle arousal on", "Set genital arousal", genital_list) if(picked_organ) var/original_state = picked_organ.aroused_state picked_organ.set_aroused_state(!picked_organ.aroused_state) diff --git a/code/modules/arousal/toys/dildos.dm b/code/modules/arousal/toys/dildos.dm index 4de6877915..a4d014c1c0 100644 --- a/code/modules/arousal/toys/dildos.dm +++ b/code/modules/arousal/toys/dildos.dm @@ -46,25 +46,25 @@ if(!can_customize) return FALSE if(src && !user.incapacitated() && in_range(user,src)) - var/color_choice = input(user,"Choose a color for your dildo.","Dildo Color") as null|anything in GLOB.dildo_colors + var/color_choice = tgui_input_list(user,"Choose a color for your dildo.","Dildo Color", GLOB.dildo_colors) if(src && color_choice && !user.incapacitated() && in_range(user,src)) sanitize_inlist(color_choice, GLOB.dildo_colors, "Red") color = GLOB.dildo_colors[color_choice] update_appearance() if(src && !user.incapacitated() && in_range(user,src)) - var/shape_choice = input(user,"Choose a shape for your dildo.","Dildo Shape") as null|anything in GLOB.dildo_shapes + var/shape_choice = tgui_input_list(user,"Choose a shape for your dildo.","Dildo Shape", GLOB.dildo_shapes) if(src && shape_choice && !user.incapacitated() && in_range(user,src)) sanitize_inlist(shape_choice, GLOB.dildo_colors, "Knotted") dildo_shape = GLOB.dildo_shapes[shape_choice] update_appearance() if(src && !user.incapacitated() && in_range(user,src)) - var/size_choice = input(user,"Choose the size for your dildo.","Dildo Size") as null|anything in GLOB.dildo_sizes + var/size_choice = tgui_input_list(user,"Choose the size for your dildo.","Dildo Size", GLOB.dildo_sizes) if(src && size_choice && !user.incapacitated() && in_range(user,src)) sanitize_inlist(size_choice, GLOB.dildo_colors, "Medium") dildo_size = GLOB.dildo_sizes[size_choice] update_appearance() if(src && !user.incapacitated() && in_range(user,src)) - var/transparency_choice = input(user,"Choose the transparency of your dildo. Lower is more transparent!(192-255)","Dildo Transparency") as null|num + var/transparency_choice = tgui_input_num(user,"Choose the transparency of your dildo. Lower is more transparent!(192-255)","Dildo Transparency", alpha) if(src && transparency_choice && !user.incapacitated() && in_range(user,src)) sanitize_integer(transparency_choice, 192, 255, 192) alpha = transparency_choice diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm index 32e262ce65..c2994e7998 100644 --- a/code/modules/assembly/doorcontrol.dm +++ b/code/modules/assembly/doorcontrol.dm @@ -29,7 +29,7 @@ if(!can_change_id) return var/new_id - new_id = input(user, "Set ID", "Set ID", show_id? id : null) as text|null + new_id = tgui_input_text(user, "Set ID", "Set ID", show_id? id : null) if(!isnull(new_id)) //0/"" is considered !, so check null instead of just !. id = new_id diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index b670baaae7..5cc6fa33d6 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -63,7 +63,7 @@ GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE) if(!.) return if(href_list[VV_HK_PARSE_GASSTRING]) - var/gasstring = input(usr, "Input Gas String (WARNING: Advanced. Don't use this unless you know how these work.", "Gas String Parse") as text|null + var/gasstring = tgui_input_text(usr, "Input Gas String (WARNING: Advanced. Don't use this unless you know how these work.)", "Gas String Parse") if(!istext(gasstring)) return log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set to gas string [gasstring].") @@ -77,10 +77,10 @@ GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE) var/list/gases = get_gases() for(var/gas in gases) gases[gas] = get_moles(gas) - var/gasid = input(usr, "What kind of gas?", "Set Gas") as null|anything in GLOB.gas_data.ids + var/gasid = tgui_input_list(usr, "What kind of gas?", "Set Gas", GLOB.gas_data.ids) if(!gasid) return - var/amount = input(usr, "Input amount", "Set Gas", gases[gasid] || 0) as num|null + var/amount = tgui_input_num(usr, "Input amount", "Set Gas", gases[gasid] || 0) if(!isnum(amount)) return amount = max(0, amount) @@ -88,7 +88,7 @@ GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE) message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set gas [gasid] to [amount] moles.") set_moles(gasid, amount) if(href_list[VV_HK_SET_TEMPERATURE]) - var/temp = input(usr, "Set the temperature of this mixture to?", "Set Temperature", return_temperature()) as num|null + var/temp = tgui_input_num(usr, "Set the temperature of this mixture to?", "Set Temperature", return_temperature()) if(!isnum(temp)) return temp = max(2.7, temp) @@ -96,7 +96,7 @@ GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE) message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Changed temperature to [temp].") set_temperature(temp) if(href_list[VV_HK_SET_VOLUME]) - var/volume = input(usr, "Set the volume of this mixture to?", "Set Volume", return_volume()) as num|null + var/volume = tgui_input_num(usr, "Set the volume of this mixture to?", "Set Volume", return_volume()) if(!isnum(volume)) return volume = max(0, volume) diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 806126e684..51f5fc4769 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -425,7 +425,7 @@ var/datum/tlv/tlv = TLV[env] if(isnull(tlv)) return - var/value = input("New [name] for [env]:", name, tlv.vars[name]) as num|null + var/value = tgui_input_num(usr, "New [name] for [env]:", name, tlv.vars[name]) if(!isnull(value) && !..()) if(value < 0) tlv.vars[name] = -1 diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index 56a7d78288..d7bfb46af5 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -107,7 +107,7 @@ Passive gate is similar to the regular pump except: pressure = MAX_OUTPUT_PRESSURE . = TRUE else if(pressure == "input") - pressure = input("New output pressure (0-[MAX_OUTPUT_PRESSURE] kPa):", name, target_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure (0-[MAX_OUTPUT_PRESSURE] kPa):", name, target_pressure) if(!isnull(pressure) || !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index dc5a6eccd4..133c280728 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -135,7 +135,7 @@ pressure = MAX_OUTPUT_PRESSURE . = TRUE else if(pressure == "input") - pressure = input("New output pressure (0-[MAX_OUTPUT_PRESSURE] kPa):", name, target_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure (0-[MAX_OUTPUT_PRESSURE] kPa):", name, target_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm index d0b663e4ad..6ff796f4c1 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm @@ -83,7 +83,7 @@ pressure = 50*ONE_ATMOSPHERE . = TRUE else if(pressure == "input") // The manual expirience. - pressure = input("New output pressure ([close_pressure]-[50*ONE_ATMOSPHERE] kPa):", name, open_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure ([close_pressure]-[50*ONE_ATMOSPHERE] kPa):", name, open_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) @@ -98,7 +98,7 @@ pressure = open_pressure . = TRUE else if(pressure == "input") - pressure = input("New output pressure (0-[open_pressure] kPa):", name, close_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure (0-[open_pressure] kPa):", name, close_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index 46d584339b..258ee21d9b 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -125,7 +125,7 @@ rate = MAX_TRANSFER_RATE . = TRUE else if(rate == "input") - rate = input("New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, transfer_rate) as num|null + rate = tgui_input_num(usr, "New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, transfer_rate) if(!isnull(rate) && !..()) . = TRUE else if(text2num(rate) != null) diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index f8866877fe..7ade864a92 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -126,7 +126,7 @@ air_update_turf(1) /obj/machinery/atmospherics/components/proc/safe_input(var/title, var/text, var/default_set) - var/new_value = input(usr,text,title,default_set) as num + var/new_value = tgui_input_num(usr,text,title,default_set) if(usr.canUseTopic(src)) return new_value return default_set diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 4182f5ceca..dbad55e9ef 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -143,7 +143,7 @@ rate = MAX_TRANSFER_RATE . = TRUE else if(rate == "input") - rate = input("New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, transfer_rate) as num|null + rate = tgui_input_num(usr, "New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, transfer_rate) if(!isnull(rate) && !..()) . = TRUE else if(text2num(rate) != null) diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 3296981e5e..1257cb9bb2 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -151,7 +151,7 @@ pressure = MAX_OUTPUT_PRESSURE . = TRUE else if(pressure == "input") - pressure = input("New output pressure (0-[MAX_OUTPUT_PRESSURE] kPa):", name, target_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure (0-[MAX_OUTPUT_PRESSURE] kPa):", name, target_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index b2fa26edba..0a64d458d2 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -166,7 +166,7 @@ rate = MAX_TRANSFER_RATE . = TRUE else if(rate == "input") - rate = input("New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, volume_rate) as num|null + rate = tgui_input_num(usr, "New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, volume_rate) if(!isnull(rate) && !..()) . = TRUE else if(text2num(rate) != null) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm index ee4223b157..ecc9bc624f 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm @@ -82,7 +82,7 @@ pressure = 50*ONE_ATMOSPHERE . = TRUE else if(pressure == "input") - pressure = input("New output pressure ([close_pressure]-[50*ONE_ATMOSPHERE] kPa):", name, open_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure ([close_pressure]-[50*ONE_ATMOSPHERE] kPa):", name, open_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) @@ -97,7 +97,7 @@ pressure = open_pressure . = TRUE else if(pressure == "input") - pressure = input("New output pressure (0-[open_pressure] kPa):", name, close_pressure) as num|null + pressure = tgui_input_num(usr, "New output pressure (0-[open_pressure] kPa):", name, close_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index 8456c0b346..c8ed757b29 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -158,7 +158,7 @@ var/target = params["target"] var/adjust = text2num(params["adjust"]) if(target == "input") - target = input("Set new target ([min_temperature]-[max_temperature] K):", name, target_temperature) as num|null + target = tgui_input_num(usr, "Set new target ([min_temperature]-[max_temperature] K):", name, target_temperature) if(!isnull(target)) . = TRUE else if(adjust) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 868c5dafa3..e99ac55357 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -388,7 +388,7 @@ return switch(action) if("relabel") - var/label = input("New canister label:", name) as null|anything in sortList(label2types) + var/label = tgui_input_list(usr, "New canister label:", name, sortList(label2types)) if(label && !..()) var/newtype = label2types[label] if(newtype) @@ -416,7 +416,7 @@ pressure = can_max_release_pressure . = TRUE else if(pressure == "input") - pressure = input("New release pressure ([can_min_release_pressure]-[can_max_release_pressure] kPa):", name, release_pressure) as num|null + pressure = tgui_input_num(usr, "New release pressure ([can_min_release_pressure]-[can_max_release_pressure] kPa):", name, release_pressure) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) @@ -461,7 +461,7 @@ if("increase") timer_set = min(maximum_timer_set, timer_set + 10) if("input") - var/user_input = input(usr, "Set time to valve toggle.", name) as null|num + var/user_input = tgui_input_num(usr, "Set time to valve toggle.", name, timer_set) if(!user_input) return var/N = text2num(user_input) diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index ee4090b680..0dafac89d1 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -38,7 +38,7 @@ if(..()) return var/A - A = input("Area to bombard", "Open Fire", A) in GLOB.teleportlocs + A = tgui_input_list(usr, "Area to bombard", "Open Fire", GLOB.teleportlocs) var/area/thearea = GLOB.teleportlocs[A] if(usr.stat || usr.restrained()) return diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index bc7e2cbd08..a027995acc 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -88,7 +88,7 @@ else chargesa-- insistinga = 0 - var/wish = input("You want...","Wish") as null|anything in list("Power","Wealth","Immortality","To Kill","Peace") + var/wish = tgui_input_list(usr, "You want...","Wish", list("Power","Wealth","Immortality","To Kill","Peace")) switch(wish) if("Power") to_chat(user, "Your wish is granted, but at a terrible cost...") diff --git a/code/modules/buildmode/submodes/advanced.dm b/code/modules/buildmode/submodes/advanced.dm index 69aefaa3a5..69cb6ec588 100644 --- a/code/modules/buildmode/submodes/advanced.dm +++ b/code/modules/buildmode/submodes/advanced.dm @@ -17,7 +17,7 @@ to_chat(c, "***********************************************************") /datum/buildmode_mode/advanced/change_settings(client/c) - var/target_path = input(c, "Enter typepath:", "Typepath", "/obj/structure/closet") + var/target_path = tgui_input_text(c, "Enter typepath:", "Typepath", "/obj/structure/closet") objholder = text2path(target_path) if(!ispath(objholder)) objholder = pick_closest_path(target_path) diff --git a/code/modules/buildmode/submodes/area_edit.dm b/code/modules/buildmode/submodes/area_edit.dm index 19f536e073..e5ee2babf3 100644 --- a/code/modules/buildmode/submodes/area_edit.dm +++ b/code/modules/buildmode/submodes/area_edit.dm @@ -28,10 +28,10 @@ to_chat(c, "***********************************************************") /datum/buildmode_mode/area_edit/change_settings(client/c) - var/target_path = input(c, "Enter typepath:", "Typepath", "/area") + var/target_path = tgui_input_text(c, "Enter typepath:", "Typepath", "/area") var/areatype = text2path(target_path) if(ispath(areatype,/area)) - var/areaname = input(c, "Enter area name:", "Area name", "Area") + var/areaname = tgui_input_text(c, "Enter area name:", "Area name", "Area") if(!areaname || !length(areaname)) return storedarea = new areatype diff --git a/code/modules/buildmode/submodes/boom.dm b/code/modules/buildmode/submodes/boom.dm index 8340a21b0f..fc18154206 100644 --- a/code/modules/buildmode/submodes/boom.dm +++ b/code/modules/buildmode/submodes/boom.dm @@ -14,19 +14,19 @@ to_chat(c, "***********************************************************") /datum/buildmode_mode/boom/change_settings(client/c) - devastation = input(c, "Range of total devastation. -1 to none", text("Input")) as num|null + devastation = tgui_input_num(c, "Range of total devastation. -1 to none", text("Input")) if(devastation == null) devastation = -1 - heavy = input(c, "Range of heavy impact. -1 to none", text("Input")) as num|null + heavy = tgui_input_num(c, "Range of heavy impact. -1 to none", text("Input")) if(heavy == null) heavy = -1 - light = input(c, "Range of light impact. -1 to none", text("Input")) as num|null + light = tgui_input_num(c, "Range of light impact. -1 to none", text("Input")) if(light == null) light = -1 - flash = input(c, "Range of flash. -1 to none", text("Input")) as num|null + flash = tgui_input_num(c, "Range of flash. -1 to none", text("Input")) if(flash == null) flash = -1 - flames = input(c, "Range of flames. -1 to none", text("Input")) as num|null + flames = tgui_input_num(c, "Range of flames. -1 to none", text("Input")) if(flames == null) flames = -1 diff --git a/code/modules/buildmode/submodes/fill.dm b/code/modules/buildmode/submodes/fill.dm index baa306040c..a37937b5f4 100644 --- a/code/modules/buildmode/submodes/fill.dm +++ b/code/modules/buildmode/submodes/fill.dm @@ -12,7 +12,7 @@ to_chat(c, "***********************************************************") /datum/buildmode_mode/fill/change_settings(client/c) - var/target_path = input(c, "Enter typepath:" ,"Typepath","/obj/structure/closet") + var/target_path = tgui_input_text(c, "Enter typepath:" ,"Typepath","/obj/structure/closet") objholder = text2path(target_path) if(!ispath(objholder)) objholder = pick_closest_path(target_path) diff --git a/code/modules/buildmode/submodes/mapgen.dm b/code/modules/buildmode/submodes/mapgen.dm index 5e3541c569..34bd0ddf6c 100644 --- a/code/modules/buildmode/submodes/mapgen.dm +++ b/code/modules/buildmode/submodes/mapgen.dm @@ -16,7 +16,7 @@ for(var/path in gen_paths) var/datum/mapGenerator/MP = path options[initial(MP.buildmode_name)] = path - var/type = input(c,"Select Generator Type","Type") as null|anything in options + var/type = tgui_input_list(c,"Select Generator Type","Type", options) if(!type) return diff --git a/code/modules/buildmode/submodes/variable_edit.dm b/code/modules/buildmode/submodes/variable_edit.dm index ac4c1ef66a..9b09e41c68 100644 --- a/code/modules/buildmode/submodes/variable_edit.dm +++ b/code/modules/buildmode/submodes/variable_edit.dm @@ -22,8 +22,8 @@ valueholder = null /datum/buildmode_mode/varedit/change_settings(client/c) - varholder = input(c, "Enter variable name:" ,"Name", "name") - + varholder = tgui_input_text(c, "Enter variable name:" ,"Name", "name") + if(!vv_varname_lockcheck(varholder)) return diff --git a/code/modules/cargo/blackmarket/blackmarket_uplink.dm b/code/modules/cargo/blackmarket/blackmarket_uplink.dm index 7d5b333f13..830b4a6b6a 100644 --- a/code/modules/cargo/blackmarket/blackmarket_uplink.dm +++ b/code/modules/cargo/blackmarket/blackmarket_uplink.dm @@ -1,6 +1,6 @@ /obj/item/blackmarket_uplink name = "Black Market Uplink" - desc = "A mishmash of a subspace amplifier, a radio, and an analyzer. Somehow able to access the black market, with a variable inventory in limited stock at inflated prices. No refunds, customer responsible for pick-ups." + desc = "A mishmash of a subspace amplifier, a radio, and an analyzer. Somehow able to access the black market, with a variable inventory in limited stock at inflated prices. No refunds, customer responsible for pick-ups." icon = 'icons/obj/blackmarket.dmi' icon_state = "uplink" // UI variables. @@ -35,7 +35,7 @@ /obj/item/blackmarket_uplink/AltClick(mob/user) if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return - var/amount_to_remove = FLOOR(input(user, "How much do you want to withdraw? Current Amount: [money]", "Withdraw Funds", 5) as num|null, 1) + var/amount_to_remove = FLOOR(tgui_input_num(user, "How much do you want to withdraw? Current Amount: [money]", "Withdraw Funds", 5), 1) if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return if(!amount_to_remove || amount_to_remove < 0) diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index 641c6f3f6d..d2bb5144fd 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -284,7 +284,7 @@ var/list/expNames = list("Devastation", "Heavy Damage", "Light Damage", "Flame") //Explosions have a range of different types of damage var/list/boomInput = list() for (var/i=1 to expNames.len) //Gather input from the user for the value of each type of damage - boomInput.Add(input("Enter the [expNames[i]] range of the explosion. WARNING: This ignores the bomb cap!", "[expNames[i]] Range", 0) as null|num) + boomInput.Add(tgui_input_num(usr, "Enter the [expNames[i]] range of the explosion. WARNING: This ignores the bomb cap!", "[expNames[i]] Range", 0)) if (isnull(boomInput[i])) return if (!isnum(boomInput[i])) //If the user doesn't input a number, set that specific explosion value to zero @@ -306,7 +306,7 @@ damageChoice = 0 temp_pod.damage = 0 return - var/damageInput = input("Enter the amount of brute damage dealt by getting hit","How much damage to deal", 0) as null|num + var/damageInput = tgui_input_num(usr, "Enter the amount of brute damage dealt by getting hit","How much damage to deal", 0) if (isnull(damageInput)) return if (!isnum(damageInput)) //Sanitize the input for damage to deal.s @@ -330,10 +330,10 @@ temp_pod.adminNamed = FALSE temp_pod.setStyle(temp_pod.style) //This resets the name of the pod based on it's current style (see supplypod/setStyle() proc) return - var/nameInput= input("Custom name", "Enter a custom name", GLOB.podstyles[temp_pod.style][POD_NAME]) as null|text //Gather input for name and desc + var/nameInput= tgui_input_text(usr, "Custom name", "Enter a custom name", GLOB.podstyles[temp_pod.style][POD_NAME]) if (isnull(nameInput)) return - var/descInput = input("Custom description", "Enter a custom desc", GLOB.podstyles[temp_pod.style][POD_DESC]) as null|text //The GLOB.podstyles is used to get the name, desc, or icon state based on the pod's style + var/descInput = tgui_input_text(usr, "Custom description", "Enter a custom desc", GLOB.podstyles[temp_pod.style][POD_DESC]) //The GLOB.podstyles is used to get the name, desc, or icon state based on the pod's style if (isnull(descInput)) return temp_pod.name = nameInput @@ -344,10 +344,10 @@ if (temp_pod.effectShrapnel == TRUE) //If already doing custom damage, set back to default (no shrapnel) temp_pod.effectShrapnel = FALSE return - var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sortList(subtypesof(/obj/item/projectile), /proc/cmp_typepaths_asc) + var/shrapnelInput = tgui_input_list(usr, "Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", sortList(subtypesof(/obj/item/projectile), /proc/cmp_typepaths_asc)) if (isnull(shrapnelInput)) return - var/shrapnelMagnitude = input("Enter the magnitude of the pellet cloud. This is usually a value around 1-5. Please note that Ryll-Ryll has asked me to tell you that if you go too crazy with the projectiles you might crash the server. So uh, be gentle!", "Shrapnel Magnitude", 0) as null|num + var/shrapnelMagnitude = tgui_input_num(usr, "Enter the magnitude of the pellet cloud. This is usually a value around 1-5. Please note that Ryll-Ryll has asked me to tell you that if you go too crazy with the projectiles you might crash the server. So uh, be gentle!", "Shrapnel Magnitude", 0) if (isnull(shrapnelMagnitude)) return if (!isnum(shrapnelMagnitude)) @@ -403,7 +403,7 @@ specificTarget = null return var/list/mobs = getpois()//code stolen from observer.dm - var/inputTarget = input("Select a mob! (Smiting does this automatically)", "Target", null, null) as null|anything in mobs + var/inputTarget = tgui_input_list(usr, "Select a mob! (Smiting does this automatically)", "Target", mobs) if (isnull(inputTarget)) return var/mob/target = mobs[inputTarget] @@ -448,7 +448,7 @@ if (found.file == tempSound.file) soundLen = found.len if (!soundLen) - soundLen = input(holder, "Couldn't auto-determine sound file length. What is the exact length of the sound file, in seconds. This number will be used to line the sound up so that it finishes right as the pod lands!", "Pick a Sound File", 0.3) as null|num + soundLen = tgui_input_num(holder, "Couldn't auto-determine sound file length. What is the exact length of the sound file, in seconds. This number will be used to line the sound up so that it finishes right as the pod lands!", "Pick a Sound File", 0.3) if (isnull(soundLen)) return if (!isnum(soundLen)) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 94220f6c23..18db7598a2 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1612,12 +1612,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) switch(href_list["preference"]) if("ghostform") if(unlock_content) - var/new_form = input(user, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms + var/new_form = tgui_input_list(user, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND", GLOB.ghost_forms) if(new_form) ghost_form = new_form if("ghostorbit") if(unlock_content) - var/new_orbit = input(user, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", null) as null|anything in GLOB.ghost_orbits + var/new_orbit = tgui_input_list(user, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", GLOB.ghost_orbits) if(new_orbit) ghost_orbit = new_orbit @@ -1642,7 +1642,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) ghost_others = GHOST_OTHERS_SIMPLE if("name") - var/new_name = input(user, "Choose your character's name:", "Character Preference") as text|null + var/new_name = tgui_input_text(user, "Choose your character's name:", "Character Preference", real_name) if(new_name) new_name = reject_bad_name(new_name) if(new_name) @@ -1651,7 +1651,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") if("age") - var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null + var/new_age = tgui_input_num(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference", age) if(new_age) age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) @@ -1692,7 +1692,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("hair_style") var/new_hair_style - new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_list + new_hair_style = tgui_input_list(user, "Choose your character's hair style:", "Character Preference", GLOB.hair_styles_list) if(new_hair_style) hair_style = new_hair_style @@ -1709,7 +1709,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("facial_hair_style") var/new_facial_hair_style - new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_list + new_facial_hair_style = tgui_input_list(user, "Choose your character's facial-hair style:", "Character Preference", GLOB.facial_hair_styles_list) if(new_facial_hair_style) facial_hair_style = new_facial_hair_style @@ -1726,7 +1726,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("grad_style") var/new_grad_style - new_grad_style = input(user, "Choose your character's hair gradient style:", "Character Preference") as null|anything in GLOB.hair_gradients_list + new_grad_style = tgui_input_list(user, "Choose your character's hair gradient style:", "Character Preference", GLOB.hair_gradients_list) if(new_grad_style) grad_style = new_grad_style @@ -1740,12 +1740,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) bgstate = next_list_item(bgstate, bgstate_options) if("modify_limbs") - var/limb_type = input(user, "Choose the limb to modify:", "Character Preference") as null|anything in LOADOUT_ALLOWED_LIMB_TARGETS + var/limb_type = tgui_input_list(user, "Choose the limb to modify:", "Character Preference", LOADOUT_ALLOWED_LIMB_TARGETS) if(limb_type) - var/modification_type = input(user, "Choose the modification to the limb:", "Character Preference") as null|anything in LOADOUT_LIMBS + var/modification_type = tgui_input_list(user, "Choose the modification to the limb:", "Character Preference", LOADOUT_LIMBS) if(modification_type) if(modification_type == LOADOUT_LIMB_PROSTHETIC) - var/prosthetic_type = input(user, "Choose the type of prosthetic", "Character Preference") as null|anything in (list("prosthetic") + GLOB.prosthetic_limb_types) + var/prosthetic_type = tgui_input_list(user, "Choose the type of prosthetic", "Character Preference", list("prosthetic") + GLOB.prosthetic_limb_types) if(prosthetic_type) var/number_of_prosthetics = 0 for(var/modified_limb in modified_limbs) @@ -1763,7 +1763,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) modified_limbs[limb_type] = list(modification_type) if("underwear") - var/new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_list + var/new_underwear = tgui_input_list(user, "Choose your character's underwear:", "Character Preference", GLOB.underwear_list) if(new_underwear) underwear = new_underwear @@ -1773,7 +1773,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) undie_color = sanitize_hexcolor(n_undie_color, 6) if("undershirt") - var/new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_list + var/new_undershirt = tgui_input_list(user, "Choose your character's undershirt:", "Character Preference", GLOB.undershirt_list) if(new_undershirt) undershirt = new_undershirt @@ -1783,7 +1783,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) shirt_color = sanitize_hexcolor(n_shirt_color, 6) if("socks") - var/new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in GLOB.socks_list + var/new_socks = tgui_input_list(user, "Choose your character's socks:", "Character Preference", GLOB.socks_list) if(new_socks) socks = new_socks @@ -1809,7 +1809,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) right_eye_color = sanitize_hexcolor(new_eyes, 6) if("eye_type") - var/new_eye_type = input(user, "Choose your character's eye type.", "Character Preference") as null|anything in GLOB.eye_types + var/new_eye_type = tgui_input_list(user, "Choose your character's eye type.", "Character Preference", GLOB.eye_types) if(new_eye_type) eye_type = new_eye_type @@ -1818,7 +1818,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) right_eye_color = left_eye_color if("species") - var/result = input(user, "Select a species", "Species Selection") as null|anything in GLOB.roundstart_race_names + var/result = tgui_input_list(user, "Select a species", "Species Selection", GLOB.roundstart_race_names) if(result) var/newtype = GLOB.species_list[GLOB.roundstart_race_names[result]] pref_species = new newtype() @@ -1848,7 +1848,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) eye_type = pref_species.eye_type if("custom_species") - var/new_species = reject_bad_name(input(user, "Choose your species subtype, if unique. This will show up on examinations and health scans. Do not abuse this:", "Character Preference", custom_species) as null|text) + var/new_species = reject_bad_name(tgui_input_text(user, "Choose your species subtype, if unique. This will show up on examinations and health scans. Do not abuse this:", "Character Preference", custom_species)) if(new_species) custom_species = new_species else @@ -1892,7 +1892,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("ipc_screen") var/new_ipc_screen - new_ipc_screen = input(user, "Choose your character's screen:", "Character Preference") as null|anything in GLOB.ipc_screens_list + new_ipc_screen = tgui_input_list(user, "Choose your character's screen:", "Character Preference", GLOB.ipc_screens_list) if(new_ipc_screen) features["ipc_screen"] = new_ipc_screen @@ -1908,31 +1908,31 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_antenna_list[S.name] = path var/new_ipc_antenna - new_ipc_antenna = input(user, "Choose your character's antenna:", "Character Preference") as null|anything in snowflake_antenna_list + new_ipc_antenna = tgui_input_list(user, "Choose your character's antenna:", "Character Preference", snowflake_antenna_list) if(new_ipc_antenna) features["ipc_antenna"] = new_ipc_antenna if("arachnid_legs") var/new_arachnid_legs - new_arachnid_legs = input(user, "Choose your character's variant of arachnid legs:", "Character Preference") as null|anything in GLOB.arachnid_legs_list + new_arachnid_legs = tgui_input_list(user, "Choose your character's variant of arachnid legs:", "Character Preference", GLOB.arachnid_legs_list) if(new_arachnid_legs) features["arachnid_legs"] = new_arachnid_legs if("arachnid_spinneret") var/new_arachnid_spinneret - new_arachnid_spinneret = input(user, "Choose your character's spinneret markings:", "Character Preference") as null|anything in GLOB.arachnid_spinneret_list + new_arachnid_spinneret = tgui_input_list(user, "Choose your character's spinneret markings:", "Character Preference", GLOB.arachnid_spinneret_list) if(new_arachnid_spinneret) features["arachnid_spinneret"] = new_arachnid_spinneret if("arachnid_mandibles") var/new_arachnid_mandibles - new_arachnid_mandibles = input(user, "Choose your character's variant of mandibles:", "Character Preference") as null|anything in GLOB.arachnid_mandibles_list + new_arachnid_mandibles = tgui_input_list(user, "Choose your character's variant of mandibles:", "Character Preference", GLOB.arachnid_mandibles_list) if (new_arachnid_mandibles) features["arachnid_mandibles"] = new_arachnid_mandibles if("tail_lizard") var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_lizard + new_tail = tgui_input_list(user, "Choose your character's tail:", "Character Preference", GLOB.tails_list_lizard) if(new_tail) features["tail_lizard"] = new_tail if(new_tail != "None") @@ -1951,7 +1951,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_tails_list[S.name] = path var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in snowflake_tails_list + new_tail = tgui_input_list(user, "Choose your character's tail:", "Character Preference", snowflake_tails_list) if(new_tail) features["tail_human"] = new_tail if(new_tail != "None") @@ -1970,7 +1970,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_tails_list[S.name] = path var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in snowflake_tails_list + new_tail = tgui_input_list(user, "Choose your character's tail:", "Character Preference", snowflake_tails_list) if(new_tail) features["mam_tail"] = new_tail if(new_tail != "None") @@ -1980,7 +1980,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("meat_type") var/new_meat - new_meat = input(user, "Choose your character's meat type:", "Character Preference") as null|anything in GLOB.meat_types + new_meat = tgui_input_list(user, "Choose your character's meat type:", "Character Preference", GLOB.meat_types) if(new_meat) features["meat_type"] = new_meat @@ -1995,7 +1995,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_snouts_list[S.name] = path var/new_snout - new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in snowflake_snouts_list + new_snout = tgui_input_list(user, "Choose your character's snout:", "Character Preference", snowflake_snouts_list) if(new_snout) features["snout"] = new_snout features["mam_snouts"] = "None" @@ -2012,14 +2012,14 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_mam_snouts_list[S.name] = path var/new_mam_snouts - new_mam_snouts = input(user, "Choose your character's snout:", "Character Preference") as null|anything in snowflake_mam_snouts_list + new_mam_snouts = tgui_input_list(user, "Choose your character's snout:", "Character Preference", snowflake_mam_snouts_list) if(new_mam_snouts) features["mam_snouts"] = new_mam_snouts features["snout"] = "None" if("horns") var/new_horns - new_horns = input(user, "Choose your character's horns:", "Character Preference") as null|anything in GLOB.horns_list + new_horns = tgui_input_list(user, "Choose your character's horns:", "Character Preference", GLOB.horns_list) if(new_horns) features["horns"] = new_horns @@ -2033,7 +2033,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("wings") var/new_wings - new_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.r_wings_list + new_wings = tgui_input_list(user, "Choose your character's wings:", "Character Preference", GLOB.r_wings_list) if(new_wings) features["wings"] = new_wings @@ -2047,61 +2047,61 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("frills") var/new_frills - new_frills = input(user, "Choose your character's frills:", "Character Preference") as null|anything in GLOB.frills_list + new_frills = tgui_input_list(user, "Choose your character's frills:", "Character Preference", GLOB.frills_list) if(new_frills) features["frills"] = new_frills if("spines") var/new_spines - new_spines = input(user, "Choose your character's spines:", "Character Preference") as null|anything in GLOB.spines_list + new_spines = tgui_input_list(user, "Choose your character's spines:", "Character Preference", GLOB.spines_list) if(new_spines) features["spines"] = new_spines if("legs") var/new_legs - new_legs = input(user, "Choose your character's legs:", "Character Preference") as null|anything in GLOB.legs_list + new_legs = tgui_input_list(user, "Choose your character's legs:", "Character Preference", GLOB.legs_list) if(new_legs) features["legs"] = new_legs if("insect_wings") var/new_insect_wings - new_insect_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.insect_wings_list + new_insect_wings = tgui_input_list(user, "Choose your character's wings:", "Character Preference", GLOB.insect_wings_list) if(new_insect_wings) features["insect_wings"] = new_insect_wings if("deco_wings") var/new_deco_wings - new_deco_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.deco_wings_list + new_deco_wings = tgui_input_list(user, "Choose your character's wings:", "Character Preference", GLOB.deco_wings_list) if(new_deco_wings) features["deco_wings"] = new_deco_wings if("insect_fluff") var/new_insect_fluff - new_insect_fluff = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.insect_fluffs_list + new_insect_fluff = tgui_input_list(user, "Choose your character's wings:", "Character Preference", GLOB.insect_fluffs_list) if(new_insect_fluff) features["insect_fluff"] = new_insect_fluff if("insect_markings") var/new_insect_markings - new_insect_markings = input(user, "Choose your character's markings:", "Character Preference") as null|anything in GLOB.insect_markings_list + new_insect_markings = tgui_input_list(user, "Choose your character's markings:", "Character Preference", GLOB.insect_markings_list) if(new_insect_markings) features["insect_markings"] = new_insect_markings if("arachnid_legs") var/new_arachnid_legs - new_arachnid_legs = input(user, "Choose your character's variant of arachnid legs:", "Character Preference") as null|anything in GLOB.arachnid_legs_list + new_arachnid_legs = tgui_input_list(user, "Choose your character's variant of arachnid legs:", "Character Preference", GLOB.arachnid_legs_list) if(new_arachnid_legs) features["arachnid_legs"] = new_arachnid_legs if("arachnid_spinneret") var/new_arachnid_spinneret - new_arachnid_spinneret = input(user, "Choose your character's spinneret markings:", "Character Preference") as null|anything in GLOB.arachnid_spinneret_list + new_arachnid_spinneret = tgui_input_list(user, "Choose your character's spinneret markings:", "Character Preference", GLOB.arachnid_spinneret_list) if(new_arachnid_spinneret) features["arachnid_spinneret"] = new_arachnid_spinneret if("arachnid_mandibles") var/new_arachnid_mandibles - new_arachnid_mandibles = input(user, "Choose your character's variant of mandibles:", "Character Preference") as null|anything in GLOB.arachnid_mandibles_list + new_arachnid_mandibles = tgui_input_list(user, "Choose your character's variant of mandibles:", "Character Preference", GLOB.arachnid_mandibles_list) if (new_arachnid_mandibles) features["arachnid_mandibles"] = new_arachnid_mandibles @@ -2109,7 +2109,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/list/choices = GLOB.skin_tones - GLOB.nonstandard_skin_tones if(CONFIG_GET(flag/allow_custom_skintones)) choices += "custom" - var/new_s_tone = input(user, "Choose your character's skin tone:", "Character Preference") as null|anything in choices + var/new_s_tone = tgui_input_list(user, "Choose your character's skin tone:", "Character Preference", choices) if(new_s_tone) if(new_s_tone == "custom") var/default = use_custom_skin_tone ? skin_tone : null @@ -2136,7 +2136,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_taur_list[S.name] = path var/new_taur - new_taur = input(user, "Choose your character's tauric body:", "Character Preference") as null|anything in snowflake_taur_list + new_taur = tgui_input_list(user, "Choose your character's tauric body:", "Character Preference", snowflake_taur_list) if(new_taur) features["taur"] = new_taur if(new_taur != "None") @@ -2157,7 +2157,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_ears_list[S.name] = path var/new_ears - new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in snowflake_ears_list + new_ears = tgui_input_list(user, "Choose your character's ears:", "Character Preference", snowflake_ears_list) if(new_ears) features["ears"] = new_ears @@ -2172,20 +2172,20 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_ears_list[S.name] = path var/new_ears - new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in snowflake_ears_list + new_ears = tgui_input_list(user, "Choose your character's ears:", "Character Preference", snowflake_ears_list) if(new_ears) features["mam_ears"] = new_ears //Xeno Bodyparts if("xenohead")//Head or caste type var/new_head - new_head = input(user, "Choose your character's caste:", "Character Preference") as null|anything in GLOB.xeno_head_list + new_head = tgui_input_list(user, "Choose your character's caste:", "Character Preference", GLOB.xeno_head_list) if(new_head) features["xenohead"] = new_head if("xenotail")//Currently one one type, more maybe later if someone sprites them. Might include animated variants in the future. var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.xeno_tail_list + new_tail = tgui_input_list(user, "Choose your character's tail:", "Character Preference", GLOB.xeno_tail_list) if(new_tail) features["xenotail"] = new_tail if(new_tail != "None") @@ -2196,7 +2196,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("xenodorsal") var/new_dors - new_dors = input(user, "Choose your character's dorsal tube type:", "Character Preference") as null|anything in GLOB.xeno_dorsal_list + new_dors = tgui_input_list(user, "Choose your character's dorsal tube type:", "Character Preference", GLOB.xeno_dorsal_list) if(new_dors) features["xenodorsal"] = new_dors @@ -2239,7 +2239,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("cock_length") var/min_D = CONFIG_GET(number/penis_min_inches_prefs) var/max_D = CONFIG_GET(number/penis_max_inches_prefs) - var/new_length = input(user, "Penis length in inches:\n([min_D]-[max_D])", "Character Preference") as num|null + var/new_length = tgui_input_num(user, "Penis length in inches:\n([min_D]-[max_D])", "Character Preference", features["cock_length"]) if(new_length) features["cock_length"] = clamp(round(new_length), min_D, max_D) @@ -2252,7 +2252,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/datum/sprite_accessory/penis/P = GLOB.cock_shapes_list[A] if(P.taur_icon && T.taur_mode & P.accepted_taurs) LAZYSET(hockeys, "[A] (Taur)", A) - new_shape = input(user, "Penis shape:", "Character Preference") as null|anything in (GLOB.cock_shapes_list + hockeys) + new_shape = tgui_input_list(user, "Penis shape:", "Character Preference", GLOB.cock_shapes_list + hockeys) if(new_shape) features["cock_taur"] = FALSE if(hockeys[new_shape]) @@ -2261,7 +2261,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["cock_shape"] = new_shape if("cock_visibility") - var/n_vis = input(user, "Penis Visibility", "Character Preference") as null|anything in CONFIG_GET(keyed_list/safe_visibility_toggles) + var/n_vis = tgui_input_list(user, "Penis Visibility", "Character Preference", CONFIG_GET(keyed_list/safe_visibility_toggles)) if(n_vis) features["cock_visibility"] = n_vis @@ -2277,18 +2277,18 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user,"Invalid color. Your color is not bright enough.") if("balls_visibility") - var/n_vis = input(user, "Testicles Visibility", "Character Preference") as null|anything in CONFIG_GET(keyed_list/safe_visibility_toggles) + var/n_vis = tgui_input_list(user, "Testicles Visibility", "Character Preference", CONFIG_GET(keyed_list/safe_visibility_toggles)) if(n_vis) features["balls_visibility"] = n_vis if("breasts_size") - var/new_size = input(user, "Breast Size", "Character Preference") as null|anything in CONFIG_GET(keyed_list/breasts_cups_prefs) + var/new_size = tgui_input_list(user, "Breast Size", "Character Preference", CONFIG_GET(keyed_list/breasts_cups_prefs)) if(new_size) features["breasts_size"] = new_size if("breasts_shape") var/new_shape - new_shape = input(user, "Breast Shape", "Character Preference") as null|anything in GLOB.breasts_shapes_list + new_shape = tgui_input_list(user, "Breast Shape", "Character Preference", GLOB.breasts_shapes_list) if(new_shape) features["breasts_shape"] = new_shape @@ -2304,13 +2304,13 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user,"Invalid color. Your color is not bright enough.") if("breasts_visibility") - var/n_vis = input(user, "Breasts Visibility", "Character Preference") as null|anything in CONFIG_GET(keyed_list/safe_visibility_toggles) + var/n_vis = tgui_input_list(user, "Breasts Visibility", "Character Preference", CONFIG_GET(keyed_list/safe_visibility_toggles)) if(n_vis) features["breasts_visibility"] = n_vis if("vag_shape") var/new_shape - new_shape = input(user, "Vagina Type", "Character Preference") as null|anything in GLOB.vagina_shapes_list + new_shape = tgui_input_list(user, "Vagina Type", "Character Preference", GLOB.vagina_shapes_list) if(new_shape) features["vag_shape"] = new_shape @@ -2326,7 +2326,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user,"Invalid color. Your color is not bright enough.") if("vag_visibility") - var/n_vis = input(user, "Vagina Visibility", "Character Preference") as null|anything in CONFIG_GET(keyed_list/safe_visibility_toggles) + var/n_vis = tgui_input_list(user, "Vagina Visibility", "Character Preference", CONFIG_GET(keyed_list/safe_visibility_toggles)) if(n_vis) features["vag_visibility"] = n_vis @@ -2341,7 +2341,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) aooccolor = new_aooccolor 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 @@ -2353,17 +2353,17 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("uplink_loc") - var/new_loc = input(user, "Choose your character's traitor uplink spawn location:", "Character Preference") as null|anything in GLOB.uplink_spawn_loc_list + var/new_loc = tgui_input_list(user, "Choose your character's traitor uplink spawn location:", "Character Preference", GLOB.uplink_spawn_loc_list) if(new_loc) uplink_spawn_loc = new_loc if("ai_core_icon") - var/ai_core_icon = input(user, "Choose your preferred AI core display screen:", "AI Core Display Screen Selection") as null|anything in GLOB.ai_core_display_screens + var/ai_core_icon = tgui_input_list(user, "Choose your preferred AI core display screen:", "AI Core Display Screen Selection", GLOB.ai_core_display_screens) if(ai_core_icon) preferred_ai_core_display = ai_core_icon if("sec_dept") - var/department = input(user, "Choose your preferred security department:", "Security Departments") as null|anything in GLOB.security_depts_prefs + var/department = tgui_input_list(user, "Choose your preferred security department:", "Security Departments", GLOB.security_depts_prefs) if(department) prefered_security_department = department @@ -2379,26 +2379,26 @@ GLOBAL_LIST_EMPTY(preferences_datums) friendlyname += " (disabled)" maplist[friendlyname] = VM.map_name maplist[default] = null - var/pickedmap = input(user, "Choose your preferred map. This will be used to help weight random map selection.", "Character Preference") as null|anything in maplist + var/pickedmap = tgui_input_list(user, "Choose your preferred map. This will be used to help weight random map selection.", "Character Preference", maplist) if (pickedmap) preferred_map = maplist[pickedmap] if ("preferred_chaos") - var/pickedchaos = input(user, "Choose your preferred level of chaos. This will help with dynamic threat level ratings.", "Character Preference") as null|anything in list(CHAOS_NONE,CHAOS_LOW,CHAOS_MED,CHAOS_HIGH,CHAOS_MAX) + var/pickedchaos = tgui_input_list(user, "Choose your preferred level of chaos. This will help with dynamic threat level ratings.", "Character Preference", list(CHAOS_NONE,CHAOS_LOW,CHAOS_MED,CHAOS_HIGH,CHAOS_MAX)) preferred_chaos = pickedchaos if ("clientfps") - var/desiredfps = input(user, "Choose your desired fps. (0 = synced with server tick rate (currently:[world.fps]))", "Character Preference", clientfps) as null|num + var/desiredfps = tgui_input_num(user, "Choose your desired fps. (0 = synced with server tick rate (currently:[world.fps]))", "Character Preference", clientfps) if (!isnull(desiredfps)) clientfps = desiredfps parent.fps = desiredfps if("ui") - var/pickedui = input(user, "Choose your UI style.", "Character Preference", UI_style) as null|anything in GLOB.available_ui_styles + var/pickedui = tgui_input_list(user, "Choose your UI style.", "Character Preference", GLOB.available_ui_styles) if(pickedui) UI_style = pickedui if (parent && parent.mob && parent.mob.hud_used) parent.mob.hud_used.update_ui_style(ui_style2icon(UI_style)) if("pda_style") - var/pickedPDAStyle = input(user, "Choose your PDA style.", "Character Preference", pda_style) as null|anything in GLOB.pda_styles + var/pickedPDAStyle = tgui_input_list(user, "Choose your PDA style.", "Character Preference", GLOB.pda_styles) if(pickedPDAStyle) pda_style = pickedPDAStyle if("pda_color") @@ -2406,11 +2406,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(pickedPDAColor) pda_color = pickedPDAColor if("pda_skin") - var/pickedPDASkin = input(user, "Choose your PDA reskin.", "Character Preference", pda_skin) as null|anything in GLOB.pda_reskins + var/pickedPDASkin = tgui_input_list(user, "Choose your PDA reskin.", "Character Preference", pda_skin, GLOB.pda_reskins) if(pickedPDASkin) pda_skin = pickedPDASkin if ("max_chat_length") - var/desiredlength = input(user, "Choose the max character length of shown Runechat messages. Valid range is 1 to [CHAT_MESSAGE_MAX_LENGTH] (default: [initial(max_chat_length)]))", "Character Preference", max_chat_length) as null|num + var/desiredlength = tgui_input_num(user, "Choose the max character length of shown Runechat messages. Valid range is 1 to [CHAT_MESSAGE_MAX_LENGTH] (default: [initial(max_chat_length)]))", "Character Preference", max_chat_length) if (!isnull(desiredlength)) max_chat_length = clamp(desiredlength, 1, CHAT_MESSAGE_MAX_LENGTH) @@ -2420,7 +2420,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) hud_toggle_color = new_toggle_color if("gender") - var/chosengender = input(user, "Select your character's gender.", "Gender Selection", gender) as null|anything in list(MALE,FEMALE,"nonbinary","object") + var/chosengender = tgui_input_list(user, "Select your character's gender.", "Gender Selection", list(MALE,FEMALE,"nonbinary","object")) if(!chosengender) return switch(chosengender) @@ -2435,27 +2435,27 @@ GLOBAL_LIST_EMPTY(preferences_datums) gender = chosengender if("body_size") - var/new_body_size = input(user, "Choose your desired sprite size: (90-125%)\nWarning: This may make your character look distorted. Additionally, any size under 100% takes a 10% maximum health penalty", "Character Preference", features["body_size"]*100) as num|null + var/new_body_size = tgui_input_num(user, "Choose your desired sprite size: (90-125%)\nWarning: This may make your character look distorted. Additionally, any size under 100% takes a 10% maximum health penalty", "Character Preference", features["body_size"]*100) if(new_body_size) features["body_size"] = clamp(new_body_size * 0.01, CONFIG_GET(number/body_size_min), CONFIG_GET(number/body_size_max)) if("tongue") - var/selected_custom_tongue = input(user, "Choose your desired tongue (none means your species tongue)", "Character Preference") as null|anything in GLOB.roundstart_tongues + var/selected_custom_tongue = tgui_input_list(user, "Choose your desired tongue (none means your species tongue)", "Character Preference", GLOB.roundstart_tongues) if(selected_custom_tongue) custom_tongue = selected_custom_tongue if("speech_verb") - var/selected_custom_speech_verb = input(user, "Choose your desired speech verb (none means your species speech verb)", "Character Preference") as null|anything in GLOB.speech_verbs + var/selected_custom_speech_verb = tgui_input_list(user, "Choose your desired speech verb (none means your species speech verb)", "Character Preference", GLOB.speech_verbs) if(selected_custom_speech_verb) custom_speech_verb = selected_custom_speech_verb if("language") - var/selected_language = input(user, "Choose your desired additional language", "Character Preference") as null|anything in GLOB.roundstart_languages + var/selected_language = tgui_input_list(user, "Choose your desired additional language", "Character Preference", GLOB.roundstart_languages) if(selected_language) additional_language = selected_language if("bodysprite") - var/selected_body_sprite = input(user, "Choose your desired body sprite", "Character Preference") as null|anything in pref_species.allowed_limb_ids + var/selected_body_sprite = tgui_input_list(user, "Choose your desired body sprite", "Character Preference", pref_species.allowed_limb_ids) if(selected_body_sprite) chosen_limb_id = selected_body_sprite //this gets sanitized before loading @@ -2496,7 +2496,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) // add a marking var/marking_type = href_list["marking_type"] if(marking_type && features[marking_type]) - var/selected_limb = input(user, "Choose the limb to apply to.", "Character Preference") as null|anything in list("Head", "Chest", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "All") + var/selected_limb = tgui_input_list(user, "Choose the limb to apply to.", "Character Preference", list("Head", "Chest", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "All")) if(selected_limb) var/list/marking_list = GLOB.mam_body_markings_list var/list/snowflake_markings_list = list() @@ -2511,7 +2511,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) snowflake_markings_list[S.name] = path - var/selected_marking = input(user, "Select the marking to apply to the limb.") as null|anything in snowflake_markings_list + var/selected_marking = tgui_input_list(user, "Select the marking to apply to the limb.", snowflake_markings_list) if(selected_marking) if(selected_limb != "All") var/limb_value = text2num(GLOB.bodypart_values[selected_limb]) @@ -2534,7 +2534,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) options += "Secondary" if(number_colors == 3) options += "Tertiary" - var/color_option = input(user, "Select the colour you wish to edit") as null|anything in options + var/color_option = tgui_input_list(user, "Select the colour you wish to edit", "", options) if(color_option) if(color_option == "Secondary") color_number = 2 if(color_option == "Tertiary") color_number = 3 @@ -2623,7 +2623,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("no_tetris_storage") no_tetris_storage = !no_tetris_storage if ("screenshake") - var/desiredshake = input(user, "Set the amount of screenshake you want. \n(0 = disabled, 100 = full, 200 = maximum.)", "Character Preference", screenshake) as null|num + var/desiredshake = tgui_input_num(user, "Set the amount of screenshake you want. \n(0 = disabled, 100 = full, 200 = maximum.)", "Character Preference", screenshake) if (!isnull(desiredshake)) screenshake = desiredshake if("damagescreenshake") @@ -3175,7 +3175,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(!namedata) return - var/raw_name = input(user, "Choose your character's [namedata["qdesc"]]:","Character Preference") as text|null + var/raw_name = tgui_input_text(user, "Choose your character's [namedata["qdesc"]]:","Character Preference", custom_names[name_id]) if(!raw_name) if(namedata["allow_null"]) custom_names[name_id] = get_default_name(name_id) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index a43f781377..c2b06253c9 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -279,7 +279,7 @@ GLOBAL_LIST_INIT(ghost_forms, list("ghost","ghostking","ghostian2","skeleghost", if(!is_content_unlocked()) tgui_alert(src, "This setting is for accounts with BYOND premium only.") return - var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms + var/new_form = tgui_input_list(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND", GLOB.ghost_forms) if(new_form) prefs.ghost_form = new_form prefs.save_preferences() @@ -293,7 +293,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS if(!is_content_unlocked()) tgui_alert(src, "This setting is for accounts with BYOND premium only.") return - var/new_orbit = input(src, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_orbits + var/new_orbit = tgui_input_list(src, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", GLOB.ghost_orbits) if(new_orbit) prefs.ghost_orbit = new_orbit prefs.save_preferences() diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index d70f0546c9..3d50cfca48 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -215,7 +215,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8") else choices[C] = C choices = sortList(choices) - var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in choices + var/selection = tgui_input_list("Please, select a player!", "Ignore", choices) if(!selection || !(selection in choices)) return selection = choices[selection] diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 008772663d..c70e9feca3 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -93,7 +93,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("Select outfit to change into", "Chameleon Outfit", outfit_options) if(!IsAvailable() || QDELETED(src) || QDELETED(user)) return FALSE var/outfit_type = outfit_options[selected] @@ -178,7 +178,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("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/under/_under.dm b/code/modules/clothing/under/_under.dm index 59af632d2a..0630c4a5f6 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -232,7 +232,7 @@ return 0 var/list/modes = list("Off", "Binary vitals", "Exact vitals", "Tracking beacon") - var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes + var/switchMode = tgui_input_list("Select a sensor mode:", "Suit Sensor Mode", modes) if(get_dist(usr, src) > 1) to_chat(usr, "You have moved too far away!") return diff --git a/code/modules/economy/paystand.dm b/code/modules/economy/paystand.dm index f674bc230d..6b36c6a10b 100644 --- a/code/modules/economy/paystand.dm +++ b/code/modules/economy/paystand.dm @@ -22,7 +22,7 @@ name = rename_msg return else if(user.a_intent == INTENT_GRAB) - var/force_fee_input = input(user,"Set the fee!","Set a fee!",0) as num|null + var/force_fee_input = tgui_input_num(user,"Set the fee!","Set a fee!",force_fee) if(isnull(force_fee_input) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return force_fee = force_fee_input @@ -46,7 +46,7 @@ if(vbucks.registered_account) var/momsdebitcard = 0 if(!force_fee) - momsdebitcard = input(user, "How much would you like to deposit?", "Money Deposit") as null|num + momsdebitcard = tgui_input_num(user, "How much would you like to deposit?", "Money Deposit", force_fee) else momsdebitcard = force_fee if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) @@ -66,7 +66,7 @@ return if(istype(W, /obj/item/holochip)) var/obj/item/holochip/H = W - var/cashmoney = input(user, "How much would you like to deposit?", "Money Deposit") as null|num + var/cashmoney = tgui_input_num(user, "How much would you like to deposit?", "Money Deposit", force_fee) if(H.spend(cashmoney, FALSE)) purchase(user, cashmoney) to_chat(user, "Thanks for purchasing! The vendor has been informed.") @@ -89,7 +89,7 @@ to_chat(user, "ERROR: No identification card has been assigned to this paystand yet!") return if(!signaler) - var/cash_limit = input(user, "Enter the minimum amount of cash needed to deposit before the signaler is activated.", "Signaler Activation Threshold") as null|num + var/cash_limit = tgui_input_num(user, "Enter the minimum amount of cash needed to deposit before the signaler is activated.", "Signaler Activation Threshold", signaler_threshold) if(cash_limit < 1) to_chat(user, "ERROR: Invalid amount designated.") return diff --git a/code/modules/events/false_alarm.dm b/code/modules/events/false_alarm.dm index 5ac75cf087..650af7eeb8 100644 --- a/code/modules/events/false_alarm.dm +++ b/code/modules/events/false_alarm.dm @@ -17,8 +17,8 @@ if(!initial(event.fakeable)) continue possible_types += E - - forced_type = input(usr, "Select the scare.","False event") as null|anything in possible_types + + forced_type = tgui_input_list(usr, "Select the scare.","False event", possible_types) /datum/round_event_control/falsealarm/canSpawnEvent(players_amt, gamemode) return ..() && length(gather_false_events()) diff --git a/code/modules/events/mass_hallucination.dm b/code/modules/events/mass_hallucination.dm index 0801e38507..a86e7f34ef 100644 --- a/code/modules/events/mass_hallucination.dm +++ b/code/modules/events/mass_hallucination.dm @@ -10,7 +10,7 @@ if(!check_rights(R_FUN)) return - forced_hallucination = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in subtypesof(/datum/hallucination) + forced_hallucination = tgui_input_list(usr, "Choose the hallucination to apply","Send Hallucination", subtypesof(/datum/hallucination)) /datum/round_event/mass_hallucination fakeable = FALSE diff --git a/code/modules/events/wizard/madness.dm b/code/modules/events/wizard/madness.dm index ac86236623..8619590b49 100644 --- a/code/modules/events/wizard/madness.dm +++ b/code/modules/events/wizard/madness.dm @@ -12,7 +12,7 @@ var/suggested = pick(strings(REDPILL_FILE, "redpill_questions")) - forced_secret = (input(usr, "What horrifying truth will you reveal?", "Curse of Madness", sortList(suggested)) as text|null) || suggested + forced_secret = (tgui_input_text(usr, "What horrifying truth will you reveal?", "Curse of Madness", sortList(suggested))) || suggested /datum/round_event/wizard/madness/start() var/datum/round_event_control/wizard/madness/C = control diff --git a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm index f09d3d6728..70bfd80217 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm @@ -122,7 +122,7 @@ log_combat(usr, src, "dispensed [O] from", null, "with [stored_food[href_list["dispense"]]] remaining") if(href_list["portion"]) - portion = clamp(input("How much drink do you want to dispense per glass?") as num|null, 0, 50) + portion = clamp(tgui_input_num(usr, "How much drink do you want to dispense per glass?"), 0, 50) if (isnull(portion)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 58769cebf1..0d338c583b 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -213,7 +213,7 @@ if (params["amount"]) desired = text2num(params["amount"]) else - desired = input("How many items?", "How many items would you like to take out?", 1) as null|num + desired = tgui_input_num(usr, "How many items?", "How many items would you like to take out?", 1) if(QDELETED(src) || QDELETED(usr) || !usr.Adjacent(src)) // Sanity checkin' in case stupid stuff happens while we wait for input() return FALSE diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm index a2603d07ab..cf3e9f69b3 100644 --- a/code/modules/food_and_drinks/pizzabox.dm +++ b/code/modules/food_and_drinks/pizzabox.dm @@ -123,7 +123,7 @@ update_icon() return else - bomb_timer = input(user, "Set the [bomb] timer from [BOMB_TIMER_MIN] to [BOMB_TIMER_MAX].", bomb, bomb_timer) as num + bomb_timer = tgui_input_num(user, "Set the [bomb] timer from [BOMB_TIMER_MIN] to [BOMB_TIMER_MAX].", bomb, bomb_timer) bomb_timer = clamp(CEILING(bomb_timer / 2, 1), BOMB_TIMER_MIN, BOMB_TIMER_MAX) bomb_defused = FALSE diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm index ed7453ad3e..49cb3ff630 100644 --- a/code/modules/holiday/halloween/jacqueen.dm +++ b/code/modules/holiday/halloween/jacqueen.dm @@ -183,7 +183,7 @@ progression["[C.real_name]"] = progression["[C.real_name]"] | JACQ_HELLO var/choices = list("Trick", "Treat", "How do I get candies?", "Do I know you from somewhere?") - var/choice = input(C, "Trick or Treat?", "Trick or Treat?") in choices + var/choice = tgui_input_list(C, "Trick or Treat?", "Trick or Treat?", choices) switch(choice) if("Trick") trick(C) @@ -207,7 +207,7 @@ visible_message("[src] gives off a glowing smile, \"What ken Ah offer ye? I can magic up an object, a potion or a plushie fer ye.\"") jacqrunes("What ken Ah offer ye? I can magic up an object, a potion or a plushie fer ye.", C) var/choices_reward = list("Object - 3 candies", "Potion - 2 candies", "Jacqueline Tracker - 2 candies", "Plushie - 1 candy", "Can I get to know you instead?", "Become a pumpkinhead dullahan (perma) - 4 candies") - var/choice_reward = input(usr, "Trick or Treat?", "Trick or Treat?") in choices_reward + var/choice_reward = tgui_input_list(usr, "Trick or Treat?", "Trick or Treat?", choices_reward) //rewards switch(choice_reward) @@ -320,7 +320,7 @@ jacqrunes("A question? Sure, it'll cost you a candy though!", C) choices += "Nevermind" //Candies for chitchats - var/choice = input(C, "What do you want to ask?", "What do you want to ask?") in choices + var/choice = tgui_input_list(C, "What do you want to ask?", "What do you want to ask?", choices) if(!take_candies(C, 1)) visible_message("[src] raises an eyebrow, \"It's a candy per question [gender]! Thems the rules!\"") jacqrunes("It's a candy per question [gender]! Thems the rules!", C) diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm index 38e4fcc6ff..dc7b6c576d 100644 --- a/code/modules/hydroponics/grown/towercap.dm +++ b/code/modules/hydroponics/grown/towercap.dm @@ -173,7 +173,7 @@ /obj/structure/bonfire/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill) var/obj/item/stack/rods/R = W - var/choice = input(user, "What would you like to construct?", "Bonfire") as null|anything in list("Stake","Grill") + var/choice = tgui_input_list(user, "What would you like to construct?", "Bonfire", list("Stake","Grill")) switch(choice) if("Stake") R.use(1) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index a3d069c175..62f14127bf 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -626,7 +626,7 @@ for(var/muties in myseed.mutatelist) var/obj/item/seeds/another_mut = new muties fresh_mut_list[another_mut.plantname] = muties - var/locked_mutation = (input(user, "Select a mutation to lock.", "Plant Mutation Locks") as null|anything in sortList(fresh_mut_list)) + var/locked_mutation = (tgui_input_list(user, "Select a mutation to lock.", "Plant Mutation Locks", sortList(fresh_mut_list))) if(!user.canUseTopic(src, BE_CLOSE) || !locked_mutation) return myseed.mutatelist = list(fresh_mut_list[locked_mutation]) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 577635cd1c..79cd96e0b2 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -444,7 +444,7 @@ return if(istype(O, /obj/item/pen)) - var/choice = input("What would you like to change?") in list("Plant Name", "Seed Description", "Product Description", "Cancel") + var/choice = tgui_input_list(user, "What would you like to change?", "", list("Plant Name", "Seed Description", "Product Description", "Cancel")) if(!user.canUseTopic(src, BE_CLOSE)) return switch(choice) diff --git a/code/modules/instruments/songs/editor.dm b/code/modules/instruments/songs/editor.dm index e385eed142..47347315bd 100644 --- a/code/modules/instruments/songs/editor.dm +++ b/code/modules/instruments/songs/editor.dm @@ -127,12 +127,12 @@ else if(href_list["import"]) var/t = "" do - t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message) + t = html_encode(tgui_input_message(usr, "Please paste the entire song, formatted:", text("[]", name), t)) if(!in_range(parent, usr)) return if(length_char(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) - var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") + var/cont = tgui_input_list(usr, "Your message is too long! Would you like to continue editing it?", "", list("yes", "no")) if(cont == "no") break while(length_char(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) @@ -160,7 +160,7 @@ INVOKE_ASYNC(src, .proc/start_playing, usr) else if(href_list["newline"]) - var/newline = html_encode(input("Enter your line: ", parent.name) as text|null) + var/newline = html_encode(tgui_input_text(usr, "Enter your line: ", parent.name)) if(!newline || !in_range(parent, usr)) return if(lines.len > MUSIC_MAXLINES) @@ -188,22 +188,22 @@ stop_playing() else if(href_list["setlinearfalloff"]) - var/amount = input(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") as null|num + var/amount = tgui_input_num(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") if(!isnull(amount)) set_linear_falloff_duration(round(amount * 10, world.tick_lag)) else if(href_list["setexpfalloff"]) - var/amount = input(usr, "Set exponential sustain factor", "Exponential sustain factor") as null|num + var/amount = tgui_input_num(usr, "Set exponential sustain factor", "Exponential sustain factor") if(!isnull(amount)) set_exponential_drop_rate(round(amount, 0.00001)) else if(href_list["setvolume"]) - var/amount = input(usr, "Set volume", "Volume") as null|num + var/amount = tgui_input_num(usr, "Set volume", "Volume") if(!isnull(amount)) set_volume(round(amount, 1)) else if(href_list["setdropoffvolume"]) - var/amount = input(usr, "Set dropoff threshold", "Dropoff Threshold Volume") as null|num + var/amount = tgui_input_num(usr, "Set dropoff threshold", "Dropoff Threshold Volume") if(!isnull(amount)) set_dropoff_volume(round(amount, 0.01)) @@ -218,11 +218,11 @@ var/datum/instrument/I = SSinstruments.get_instrument(i) if(I) LAZYSET(categories[I.category || "ERROR CATEGORY"], I.name, I.id) - var/cat = input(usr, "Select Category", "Instrument Category") as null|anything in categories + var/cat = tgui_input_list(usr, "Select Category", "Instrument Category", categories) if(!cat) return var/list/instruments = categories[cat] - var/choice = input(usr, "Select Instrument", "Instrument Selection") as null|anything in instruments + var/choice = tgui_input_list(usr, "Select Instrument", "Instrument Selection", instruments) if(!choice) return choice = instruments[choice] //get id @@ -230,12 +230,12 @@ set_instrument(choice) else if(href_list["setnoteshift"]) - var/amount = input(usr, "Set note shift", "Note Shift") as null|num + var/amount = tgui_input_num(usr, "Set note shift", "Note Shift", note_shift) if(!isnull(amount)) note_shift = clamp(amount, note_shift_min, note_shift_max) else if(href_list["setsustainmode"]) - var/choice = input(usr, "Choose a sustain mode", "Sustain Mode") as null|anything in list("Linear", "Exponential") + var/choice = tgui_input_list(usr, "Choose a sustain mode", "Sustain Mode", list("Linear", "Exponential")) switch(choice) if("Linear") sustain_mode = SUSTAIN_LINEAR diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index ac27b4a30e..2706558391 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -294,7 +294,7 @@ if(!check_interactivity(M)) return - var/input = reject_bad_name(input("What do you want to name this?", "Rename", src.name) as null|text, TRUE) + var/input = reject_bad_name(tgui_input_text(usr, "What do you want to name this?", "Rename", src.name), TRUE) if(!check_interactivity(M)) return if(src && input) @@ -506,7 +506,7 @@ if(input_selection.len == 1) choice = input_selection[input_selection[1]] else - var/selection = input(user, "Where do you want to insert that item?", "Interaction") as null|anything in input_selection + var/selection = tgui_input_list(user, "Where do you want to insert that item?", "Interaction", input_selection) if(!check_interactivity(user)) return ..() if(selection) @@ -548,7 +548,7 @@ if(input_selection.len ==1) choice = input_selection[input_selection[1]] else - var/selection = input(user, "What do you want to interact with?", "Interaction") as null|anything in input_selection + var/selection = tgui_input_list(user, "What do you want to interact with?", "Interaction", input_selection) if(!check_interactivity(user)) return if(selection) diff --git a/code/modules/integrated_electronics/core/debugger.dm b/code/modules/integrated_electronics/core/debugger.dm index e3fded3a82..434dda4e07 100644 --- a/code/modules/integrated_electronics/core/debugger.dm +++ b/code/modules/integrated_electronics/core/debugger.dm @@ -12,7 +12,7 @@ var/copy_values = FALSE /obj/item/integrated_electronics/debugger/attack_self(mob/user) - var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref","copy","null") + var/type_to_use = tgui_input_list("Please choose a type to use.","[src] type setting", list("string","number","ref","copy","null")) if(!user.IsAdvancedToolUser()) return @@ -28,7 +28,7 @@ if("number") accepting_refs = FALSE copy_values = FALSE - new_data = input(user, "Now type in a number.","[src] number writing") as null|num + new_data = tgui_input_num(user, "Now type in a number.","[src] number writing") if(isnum(new_data) && user.IsAdvancedToolUser()) data_to_write = new_data to_chat(user, "You set \the [src]'s memory to [new_data].") diff --git a/code/modules/integrated_electronics/core/pins.dm b/code/modules/integrated_electronics/core/pins.dm index e08d77007d..91d3e984a7 100644 --- a/code/modules/integrated_electronics/core/pins.dm +++ b/code/modules/integrated_electronics/core/pins.dm @@ -177,7 +177,7 @@ D [1]/ || /datum/integrated_io/proc/ask_for_data_type(mob/user, var/default, var/list/allowed_data_types = list("string","number","null")) - var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in allowed_data_types + var/type_to_use = tgui_input_list("Please choose a type to use.","[src] type setting", allowed_data_types) if(!holder.check_interactivity(user)) return @@ -189,7 +189,7 @@ D [1]/ || to_chat(user, "You input "+new_data+" into the pin.") return new_data if("number") - new_data = input("Now type in a number.","[src] number writing", isnum(default) ? default : null) as null|num + new_data = tgui_input_num("Now type in a number.","[src] number writing", isnum(default) ? default : null) if(isnum(new_data) && holder.check_interactivity(user) ) to_chat(user, "You input [new_data] into the pin.") return new_data diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 5f6440bffb..b585b51a42 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -232,7 +232,7 @@ if("load") if(cloning) return - var/input = input("Put your code there:", "loading", null, null) as message | null + var/input = tgui_input_message(usr, "Put your code there:", "loading", null, null) if(!check_interactivity(usr) || cloning) return if(!input) diff --git a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm index 24dae1439d..f971b28e3e 100644 --- a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm @@ -3,7 +3,7 @@ name = "dir pin" /datum/integrated_io/dir/ask_for_pin_data(mob/user) - var/new_data = input("Please type in a valid dir number. \ + var/new_data = tgui_input_num(user, "Please type in a valid dir number. \ Valid dirs are;\n\ North/Fore = [NORTH],\n\ South/Aft = [SOUTH],\n\ @@ -12,7 +12,7 @@ Northeast = [NORTHEAST],\n\ Northwest = [NORTHWEST],\n\ Southeast = [SOUTHEAST],\n\ - Southwest = [SOUTHWEST]","[src] dir writing") as null|num + Southwest = [SOUTHWEST]","[src] dir writing") if(isnum(new_data) && holder.check_interactivity(user) ) to_chat(user, "You input [new_data] into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/core/special_pins/index_pin.dm b/code/modules/integrated_electronics/core/special_pins/index_pin.dm index e904c4c6d0..981a0c6ea0 100644 --- a/code/modules/integrated_electronics/core/special_pins/index_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/index_pin.dm @@ -4,7 +4,7 @@ data = 1 /datum/integrated_io/index/ask_for_pin_data(mob/user) - var/new_data = input("Please type in an index.","[src] index writing") as num + var/new_data = tgui_input_num(user, "Please type in an index.","[src] index writing") if(isnum(new_data) && holder.check_interactivity(user)) to_chat(user, "You input [new_data] into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/core/special_pins/list_pin.dm b/code/modules/integrated_electronics/core/special_pins/list_pin.dm index 3532d68d70..d96a253871 100644 --- a/code/modules/integrated_electronics/core/special_pins/list_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/list_pin.dm @@ -54,7 +54,7 @@ to_chat(user, "The list is empty, there's nothing to remove.") return if(!target_entry) - target_entry = input(user, "Which piece of data do you want to remove?", "Remove") as null|anything in my_list + target_entry = tgui_input_list(user, "Which piece of data do you want to remove?", "Remove", my_list) if(holder.check_interactivity(user) && target_entry) my_list.Remove(target_entry) @@ -64,7 +64,7 @@ to_chat(user, "The list is empty, there's nothing to modify.") return if(!target_entry) - target_entry = input(user, "Which piece of data do you want to edit?", "Edit") as null|anything in my_list + target_entry = tgui_input_list(user, "Which piece of data do you want to edit?", "Edit", my_list) if(holder.check_interactivity(user) && target_entry) var/edited_entry = ask_for_data_type(user, target_entry) if(edited_entry) @@ -89,11 +89,11 @@ to_chat(user, "The list is empty, or too small to do any meaningful swapping.") return if(!first_target) - first_target = input(user, "Which piece of data do you want to swap? (1)", "Swap") as null|anything in my_list + first_target = tgui_input_list(user, "Which piece of data do you want to swap? (1)", "Swap", my_list) if(holder.check_interactivity(user) && first_target) if(!second_target) - second_target = input(user, "Which piece of data do you want to swap? (2)", "Swap") as null|anything in my_list - first_target + second_target = tgui_input_list(user, "Which piece of data do you want to swap? (2)", "Swap", my_list - first_target) if(holder.check_interactivity(user) && second_target) var/first_pos = my_list.Find(first_target) diff --git a/code/modules/integrated_electronics/core/special_pins/number_pin.dm b/code/modules/integrated_electronics/core/special_pins/number_pin.dm index e864c3c789..2b47739d9a 100644 --- a/code/modules/integrated_electronics/core/special_pins/number_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/number_pin.dm @@ -3,7 +3,7 @@ name = "number pin" /datum/integrated_io/number/ask_for_pin_data(mob/user) - var/new_data = input("Please type in a number.","[src] number writing") as null|num + var/new_data = tgui_input_num(user, "Please type in a number.","[src] number writing") if(isnum(new_data) && holder.check_interactivity(user) ) to_chat(user, "You input [new_data] into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index f66931e253..4b23d83e1d 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -51,7 +51,7 @@ power_draw_per_use = 4 /obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user) - var/new_input = input(user, "Enter a number, please.",displayed_name) as null|num + var/new_input = tgui_input_num(user, "Enter a number, please.",displayed_name) if(isnum(new_input) && user.IsAdvancedToolUser()) set_pin_data(IC_OUTPUT, 1, new_input) push_data() @@ -1263,7 +1263,7 @@ var/I = get_pin_data(IC_INPUT, k) if(istext(I)) selection.Add(I) - var/selected = input(user,"Choose input.","Selection") in selection + var/selected = tgui_input_list(user,"Choose input.","Selection", selection) if(!selected) return set_pin_data(IC_OUTPUT, 1, selected) diff --git a/code/modules/integrated_electronics/subtypes/memory.dm b/code/modules/integrated_electronics/subtypes/memory.dm index 34c36883d1..26893af5ff 100644 --- a/code/modules/integrated_electronics/subtypes/memory.dm +++ b/code/modules/integrated_electronics/subtypes/memory.dm @@ -104,19 +104,19 @@ var/datum/integrated_io/O = outputs[1] if(!user.IsAdvancedToolUser()) return - var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null") + var/type_to_use = tgui_input_list(user, "Please choose a type to use.","[src] type setting", list("string","number","ref", "null")) var/new_data = null switch(type_to_use) if("string") accepting_refs = FALSE - new_data = input("Now type in a string.","[src] string writing") as null|text + new_data = tgui_input_text(user, "Now type in a string.","[src] string writing") if(istext(new_data) && user.IsAdvancedToolUser()) O.data = new_data to_chat(user, "You set \the [src]'s memory to [O.display_data(O.data)].") if("number") accepting_refs = FALSE - new_data = input("Now type in a number.","[src] number writing") as null|num + new_data = tgui_input_num(user, "Now type in a number.","[src] number writing") if(isnum(new_data) && user.IsAdvancedToolUser()) O.data = new_data to_chat(user, "You set \the [src]'s memory to [O.display_data(O.data)].") diff --git a/code/modules/language/language_menu.dm b/code/modules/language/language_menu.dm index bffd3d59af..b773404da0 100644 --- a/code/modules/language/language_menu.dm +++ b/code/modules/language/language_menu.dm @@ -84,7 +84,7 @@ if("grant_language") if((is_admin || isobserver(AM)) && language_datum) var/list/choices = list("Only Spoken", "Only Understood", "Both") - var/choice = input(user,"How do you want to add this language?","[language_datum]",null) as null|anything in choices + var/choice = tgui_input_list(user,"How do you want to add this language?","[language_datum]", choices) var/spoken = FALSE var/understood = FALSE switch(choice) @@ -103,7 +103,7 @@ if("remove_language") if((is_admin || isobserver(AM)) && language_datum) var/list/choices = list("Only Spoken", "Only Understood", "Both") - var/choice = input(user,"Which part do you wish to remove?","[language_datum]",null) as null|anything in choices + var/choice = tgui_input_list(user,"Which part do you wish to remove?","[language_datum]", choices) var/spoken = FALSE var/understood = FALSE switch(choice) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 9d5dbe8f63..8e132071d4 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -140,7 +140,7 @@ create_random_books(books_to_load, src, FALSE, random_category) load_random_books = FALSE if(contents.len) - var/obj/item/book/choice = input(user, "Which book would you like to remove from the shelf?") as null|obj in sortNames(contents.Copy()) + var/obj/item/book/choice = tgui_input_list(user, "Which book would you like to remove from the shelf?", "", sortNames(contents.Copy())) if(choice) if(!(user.mobility_flags & MOBILITY_USE) || user.stat != CONSCIOUS || !in_range(loc, user)) return @@ -239,7 +239,7 @@ if(!literate) to_chat(user, "You scribble illegibly on the cover of [src]!") return - 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?", "", list("Title", "Contents", "Author", "Cancel")) if(!user.canUseTopic(src, BE_CLOSE, literate)) return switch(choice) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 52dd6dac73..6609f56345 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -110,19 +110,19 @@ return if(href_list["settitle"]) - var/newtitle = input("Enter a title to search for:") as text|null + var/newtitle = tgui_input_text(usr, "Enter a title to search for:") if(newtitle) title = sanitize(newtitle) else title = null if(href_list["setcategory"]) - var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion") + var/newcategory = tgui_input_list(usr, "Choose a category to search for:", "", list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")) if(newcategory) category = sanitize(newcategory) else category = "Any" if(href_list["setauthor"]) - var/newauthor = input("Enter an author to search for:") as text|null + var/newauthor = tgui_input_text(usr, "Enter an author to search for:") if(newauthor) author = sanitize(newauthor) else @@ -407,13 +407,13 @@ if(newauthor) scanner.cache.author = newauthor if(href_list["setcategory"]) - var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion","Technical") + var/newcategory = tgui_input_list(usr, "Choose a category: ", "", list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion","Technical")) if(newcategory) upload_category = newcategory if(href_list["upload"]) if(scanner) if(scanner.cache) - var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort") + var/choice = tgui_input_list(usr, "Are you certain you wish to upload this title to the Archive?", "", list("Confirm", "Abort")) if(choice == "Confirm") if (!SSdbcore.Connect()) tgui_alert(usr, "Connection to Archive has been severed. Aborting.") @@ -447,7 +447,7 @@ if(printer_cooldown > world.time) say("Printer unavailable. Please allow a short time before attempting to print.") else - var/orderid = input("Enter your order:") as num|null + var/orderid = tgui_input_num(usr, "Enter your order:") if(orderid) if(isnum(orderid) && ISINTEGER(orderid)) href_list["targetid"] = num2text(orderid) diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm index 43d15ebffe..f2e11b1bad 100644 --- a/code/modules/mafia/controller.dm +++ b/code/modules/mafia/controller.dm @@ -728,13 +728,13 @@ rolelist_dict = list("CANCEL", "FINISH") + rolelist_dict while(!done) to_chat(usr, "You have a total player count of [assoc_value_sum(debug_setup)] in this setup.") - var/chosen_role_name = input(usr,"Select a role!","Custom Setup Creation",rolelist_dict[1]) as null|anything in rolelist_dict + var/chosen_role_name = tgui_input_list(usr,"Select a role!","Custom Setup Creation", rolelist_dict) if(chosen_role_name == "CANCEL") return if(chosen_role_name == "FINISH") break var/found_path = rolelist_dict[chosen_role_name] - var/role_count = input(usr,"How many? Zero to cancel.","Custom Setup Creation",0) as null|num + var/role_count = tgui_input_num(usr,"How many? Zero to cancel.","Custom Setup Creation",0) if(role_count > 0) debug_setup[found_path] = role_count custom_setup = debug_setup diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index e97060b45d..9b83e15d8f 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -152,7 +152,7 @@ /obj/structure/closet/crate/secure/loot/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) if(locked) to_chat(user, "The crate is locked with a Deca-code lock.") - var/input = input(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") as text + var/input = tgui_input_text(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") if(user.canUseTopic(src, BE_CLOSE)) var/list/sanitised = list() var/sanitycheck = TRUE diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm index be0a41427f..18eef50e80 100644 --- a/code/modules/mining/aux_base_camera.dm +++ b/code/modules/mining/aux_base_camera.dm @@ -200,7 +200,7 @@ return var/list/buildlist = list("Walls and Floors" = 1,"Airlocks" = 2,"Deconstruction" = 3,"Windows and Grilles" = 4) - var/buildmode = input("Set construction mode.", "Base Console", null) in buildlist + var/buildmode = tgui_input_list(usr, "Set construction mode.", "Base Console", buildlist) if(buildmode) B.RCD.mode = buildlist[buildmode] to_chat(owner, "Build mode is now [buildmode].") diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm index 296513af8d..31025c6153 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( if(!istype(user) || !user.canUseTopic(src, BE_CLOSE)) return . = TRUE - 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) || !user.canUseTopic(src, BE_CLOSE)) return if(input_color) @@ -133,7 +133,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list( if(!istype(user) || !user.canUseTopic(src, BE_CLOSE)) return . = TRUE - 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) || !user.canUseTopic(src, BE_CLOSE)) return if(input_color) diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 5044a73c10..dec21100ca 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/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index e64505df7e..c91663d0e6 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -1138,7 +1138,7 @@ var/mob/living/L = I da_list[L.real_name] = L - var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in da_list + var/choice = tgui_input_list(user,"Who do you want dead?","Choose Your Victim", da_list) choice = da_list[choice] diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 1adc951447..45e88a1ae0 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -287,7 +287,7 @@ if (params["sheets"]) desired = text2num(params["sheets"]) else - desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num + desired = tgui_input_num(usr, "How many sheets?", "How many sheets would you like to smelt?", 1) var/sheets_to_remove = round(min(desired,50,stored_amount)) @@ -332,7 +332,7 @@ if (params["sheets"]) desired = text2num(params["sheets"]) else - desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num + desired = tgui_input_num(usr, "How many sheets?", "How many sheets would you like to smelt?", 1) var/amount = round(min(desired,50,smelt_amount)) mat_container.use_materials(alloy.materials, amount) materials.silo_log(src, "released", -amount, "sheets", alloy.materials) diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm index da205a1dfb..329feef0d4 100644 --- a/code/modules/mob/dead/dead.dm +++ b/code/modules/mob/dead/dead.dm @@ -79,7 +79,7 @@ INITIALIZE_IMMEDIATE(/mob/dead) if(1) pick = csa[1] else - pick = input(src, "Pick a server to jump to", "Server Hop") as null|anything in csa + pick = tgui_input_list(src, "Pick a server to jump to", "Server Hop", csa) if(!pick) return diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 042bc69997..d8f41d2840 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -251,7 +251,7 @@ var/list/days = list() for(var/number in 1 to total_days_in_player_month) days += number - var/player_day = input(src, "What day of the month were you born in.") as anything in days + var/player_day = tgui_input_list(src, "What day of the month were you born in.", "", days) if(player_day <= current_day) //their birthday has passed age_gate_result = TRUE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index c66e45c3b4..a47c27325b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -475,7 +475,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/area/A = V if(!A.hidden) filtered += A - var/area/thearea = input("Area to jump to", "BOOYEA") as null|anything in filtered + var/area/thearea = tgui_input_list(usr, "Area to jump to", "BOOYEA", filtered) if(!thearea) return @@ -557,7 +557,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/target = null //Chosen target. dest += getpois(mobs_only = TRUE) //Fill list, prompt user with list - target = input("Please, select a player!", "Jump to Mob", null, null) as null|anything in dest + target = tgui_input_list(usr, "Please, select a player!", "Jump to Mob", dest) if (!target)//Make sure we actually have a target return @@ -582,7 +582,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/list/views = list() for(var/i in 7 to max_view) views |= i - var/new_view = input("Choose your new view", "Modify view range", 0) as null|anything in views + var/new_view = tgui_input_list(usr, "Choose your new view", "Modify view range", views) if(new_view) client.view_size.setTo(clamp(new_view, 7, max_view) - 7) else @@ -697,7 +697,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!(L in GLOB.player_list) && !L.mind) possessible += L - var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in possessible + var/mob/living/target = tgui_input_list(usr, "Your new life begins today!", "Possess Mob", possessible) if(!target) return 0 @@ -888,7 +888,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/eye_name = null - eye_name = input("Please, select a player!", "Observe", null, null) as null|anything in creatures + eye_name = tgui_input_list(usr, "Please, select a player!", "Observe", creatures) if (!eye_name) return diff --git a/code/modules/mob/dead/observer/respawn.dm b/code/modules/mob/dead/observer/respawn.dm index 3b559c1a9c..0b0c86e360 100644 --- a/code/modules/mob/dead/observer/respawn.dm +++ b/code/modules/mob/dead/observer/respawn.dm @@ -21,7 +21,7 @@ if(!valid.len) to_chat(src, "No player found that is either a ghost or is in lobby with restrictions active.") return - var/ckey = valid[input(src, "Choose a player (only showing logged in players who have restrictions)", "Unrestricted Respawn") as null|anything in valid] + var/ckey = valid[tgui_input_list(src, "Choose a player (only showing logged in players who have restrictions)", "Unrestricted Respawn", valid)] var/client/player = GLOB.directory[ckey] if(!player) to_chat(src, "Client not found.") @@ -67,7 +67,7 @@ if(!valid.len) to_chat(src, "No logged in ghosts found.") return - var/mob/dead/observer/O = valid[input(src, "Choose a player (only showing logged in)", "Remove Respawn Timer") as null|anything in valid] + var/mob/dead/observer/O = valid[tgui_input_list(src, "Choose a player (only showing logged in)", "Remove Respawn Timer", valid)] if(!O.client) to_chat(src, "[O] has no client.") diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 8f335be1e5..b38b982e69 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -91,13 +91,13 @@ Doesn't work on other aliens/AI.*/ var/list/options = list() for(var/mob/living/Ms in oview(user)) options += Ms - var/mob/living/M = input("Select who to whisper to:","Whisper to?",null) as null|mob in options + var/mob/living/M = tgui_input_list(user, "Select who to whisper to:","Whisper to?", options) if(!M) return 0 if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) to_chat(user, "As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled.") return FALSE - var/msg = sanitize(input("Message:", "Alien Whisper") as text|null) + var/msg = sanitize(tgui_input_text(user, "Message:", "Alien Whisper")) if(msg) if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) to_chat(user, "As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled.") @@ -126,10 +126,10 @@ Doesn't work on other aliens/AI.*/ for(var/mob/living/carbon/A in oview(user)) if(A.getorgan(/obj/item/organ/alien/plasmavessel)) aliens_around.Add(A) - var/mob/living/carbon/M = input("Select who to transfer to:","Transfer plasma to?",null) as mob in aliens_around + var/mob/living/carbon/M = tgui_input_list(user, "Select who to transfer to:","Transfer plasma to?", aliens_around) if(!M) return 0 - var/amount = input("Amount:", "Transfer Plasma to [M]") as num + var/amount = tgui_input_num(user, "Amount:", "Transfer Plasma to [M]") if (amount) amount = min(abs(round(amount)), user.getPlasma()) if (get_dist(user,M) <= 1) @@ -169,7 +169,7 @@ Doesn't work on other aliens/AI.*/ /obj/effect/proc_holder/alien/acid/fire(mob/living/carbon/alien/user) - var/O = input("Select what to dissolve:","Dissolve",null) as obj|turf in oview(1,user) + var/O = tgui_input_list(user, "Select what to dissolve:","Dissolve", oview(1,user)) if(!O || user.incapacitated()) return 0 else @@ -272,7 +272,7 @@ Doesn't work on other aliens/AI.*/ if(!check_vent_block(user)) return FALSE - var/choice = input("Choose what you wish to shape.","Resin building") as null|anything in structures + var/choice = tgui_input_list(user, "Choose what you wish to shape.","Resin building", structures) if(!choice) return FALSE if (!cost_check(check_turf,user)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 550a128a31..69dc2f220f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1038,7 +1038,7 @@ if(href_list[VV_HK_MODIFY_BODYPART]) if(!check_rights(R_SPAWN)) return - var/edit_action = input(usr, "What would you like to do?","Modify Body Part") as null|anything in list("add","remove", "augment") + var/edit_action = tgui_input_list(usr, "What would you like to do?","Modify Body Part", list("add","remove", "augment")) if(!edit_action) return var/list/limb_list = list() @@ -1051,7 +1051,7 @@ limb_list = list(BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) for(var/obj/item/bodypart/B in bodyparts) limb_list -= B.body_zone - var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in limb_list + var/result = tgui_input_list(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part", limb_list) if(result) var/obj/item/bodypart/BP = get_bodypart(result) switch(edit_action) @@ -1093,7 +1093,7 @@ for(var/i in artpaths) 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(src)) @@ -1109,7 +1109,7 @@ if(!check_rights(NONE)) return var/list/traumas = subtypesof(/datum/brain_trauma) - var/result = input(usr, "Choose the brain trauma to apply","Traumatize") as null|anything in traumas + var/result = tgui_input_list(usr, "Choose the brain trauma to apply","Traumatize", traumas) if(!usr) return if(QDELETED(src)) @@ -1131,7 +1131,7 @@ if(!check_rights(NONE)) return var/list/hallucinations = subtypesof(/datum/hallucination) - var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in hallucinations + var/result = tgui_input_list(usr, "Choose the hallucination to apply","Send Hallucination", hallucinations) if(!usr) return if(QDELETED(src)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index bd4664ae54..4c03d8cd1c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -333,7 +333,7 @@ if(href_list["hud"] == "m") if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/medical)) if(href_list["p_stat"]) - var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") + var/health_status = tgui_input_list(usr, "Specify a new physical status for this person.", "Medical HUD", list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel")) if(R) if(!H.canUseHUD()) return @@ -343,7 +343,7 @@ R.fields["p_stat"] = health_status return if(href_list["m_stat"]) - var/health_status = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields["m_stat"]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") + var/health_status = tgui_input_list(usr, "Specify a new mental status for this person.", "Medical HUD", list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel")) if(R) if(!H.canUseHUD()) return @@ -419,7 +419,7 @@ R = find_record("name", perpname, GLOB.data_core.security) if(R) if(href_list["status"]) - var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel") + var/setcriminal = tgui_input_list(usr, "Specify a new criminal status for this person.", "Security HUD", list("None", "*Arrest*", "Incarcerated", "Paroled", "Discharged", "Cancel")) if(setcriminal != "Cancel") if(R) if(H.canUseHUD()) @@ -878,7 +878,7 @@ var/qname = initial(T.name) options[has_quirk(T) ? "[qname] (Remove)" : "[qname] (Add)"] = T - var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in options + var/result = tgui_input_list(usr, "Choose quirk to add/remove","Quirk Mod", options) if(result) if(result == "Clear") for(var/datum/quirk/q in roundstart_quirks) @@ -916,7 +916,7 @@ if(href_list[VV_HK_SET_SPECIES]) if(!check_rights(R_SPAWN)) return - var/result = input(usr, "Please choose a new species","Species") as null|anything in GLOB.species_list + var/result = tgui_input_list(usr, "Please choose a new species","Species", GLOB.species_list) if(result) var/newtype = GLOB.species_list[result] admin_ticket_log("[key_name_admin(usr)] has modified the bodyparts of [src] to [result]") diff --git a/code/modules/mob/living/carbon/human/innate_abilities/customization.dm b/code/modules/mob/living/carbon/human/innate_abilities/customization.dm index 363f6ecbb2..ccce6141b6 100644 --- a/code/modules/mob/living/carbon/human/innate_abilities/customization.dm +++ b/code/modules/mob/living/carbon/human/innate_abilities/customization.dm @@ -22,7 +22,7 @@ /datum/action/innate/ability/humanoid_customization/proc/change_form() var/mob/living/carbon/human/H = owner - var/select_alteration = input(owner, "Select what part of your form to alter", "Form Alteration", "cancel") in list("Body Color","Hair Style", "Genitals", "Tail", "Snout", "Markings", "Ears", "Taur body", "Penis", "Vagina", "Penis Length", "Breast Size", "Breast Shape", "Cancel") + var/select_alteration = tgui_input_list(owner, "Select what part of your form to alter", "Form Alteration", list("Body Color","Hair Style", "Genitals", "Tail", "Snout", "Markings", "Ears", "Taur body", "Penis", "Vagina", "Penis Length", "Breast Size", "Breast Shape", "Cancel")) if(select_alteration == "Body Color") var/new_color = input(owner, "Choose your skin color:", "Race change","#"+H.dna.features["mcolor"]) as color|null @@ -36,21 +36,21 @@ to_chat(H, "Invalid color. Your color is not bright enough.") else if(select_alteration == "Hair Style") if(H.gender == MALE) - var/new_style = input(owner, "Select a facial hair style", "Hair Alterations") as null|anything in GLOB.facial_hair_styles_list + var/new_style = tgui_input_list(owner, "Select a facial hair style", "Hair Alterations", GLOB.facial_hair_styles_list) if(new_style) H.facial_hair_style = new_style else H.facial_hair_style = "Shaved" //handle normal hair - var/new_style = input(owner, "Select a hair style", "Hair Alterations") as null|anything in GLOB.hair_styles_list + var/new_style = tgui_input_list(owner, "Select a hair style", "Hair Alterations", GLOB.hair_styles_list) if(new_style) H.hair_style = new_style H.update_hair() else if (select_alteration == "Genitals") - var/operation = input("Select organ operation.", "Organ Manipulation", "cancel") in list("add sexual organ", "remove sexual organ", "cancel") + var/operation = tgui_input_list(owner, "Select organ operation.", "Organ Manipulation", list("add sexual organ", "remove sexual organ", "cancel")) switch(operation) if("add sexual organ") - var/new_organ = input("Select sexual organ:", "Organ Manipulation") as null|anything in GLOB.genitals_list + var/new_organ = tgui_input_list(owner, "Select sexual organ:", "Organ Manipulation", GLOB.genitals_list) if(!new_organ) return H.give_genital(GLOB.genitals_list[new_organ]) @@ -60,7 +60,7 @@ for(var/obj/item/organ/genital/X in H.internal_organs) var/obj/item/organ/I = X organs["[I.name] ([I.type])"] = I - var/obj/item/O = input("Select sexual organ:", "Organ Manipulation", null) as null|anything in organs + var/obj/item/O = tgui_input_list(owner, "Select sexual organ:", "Organ Manipulation", organs) var/obj/item/organ/genital/G = organs[O] if(!G) return @@ -77,7 +77,7 @@ if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(H.client.ckey))) snowflake_ears_list[S.name] = path var/new_ears - new_ears = input(owner, "Choose your character's ears:", "Ear Alteration") as null|anything in snowflake_ears_list + new_ears = tgui_input_list(owner, "Choose your character's ears:", "Ear Alteration", snowflake_ears_list) if(new_ears) H.dna.features["mam_ears"] = new_ears H.update_body() @@ -91,7 +91,7 @@ if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(H.client.ckey))) snowflake_snouts_list[S.name] = path var/new_snout - new_snout = input(owner, "Choose your character's face:", "Face Alteration") as null|anything in snowflake_snouts_list + new_snout = tgui_input_list(owner, "Choose your character's face:", "Face Alteration", snowflake_snouts_list) if(new_snout) H.dna.features["mam_snouts"] = new_snout H.update_body() @@ -105,7 +105,7 @@ if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(H.client.ckey))) snowflake_markings_list[S.name] = path var/new_mam_body_markings - new_mam_body_markings = input(H, "Choose your character's body markings:", "Marking Alteration") as null|anything in snowflake_markings_list + new_mam_body_markings = tgui_input_list(H, "Choose your character's body markings:", "Marking Alteration", snowflake_markings_list) if(new_mam_body_markings) H.dna.features["mam_body_markings"] = new_mam_body_markings for(var/X in H.bodyparts) //propagates the markings changes @@ -122,7 +122,7 @@ if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(H.client.ckey))) snowflake_tails_list[S.name] = path var/new_tail - new_tail = input(owner, "Choose your character's Tail(s):", "Tail Alteration") as null|anything in snowflake_tails_list + new_tail = tgui_input_list(owner, "Choose your character's Tail(s):", "Tail Alteration", snowflake_tails_list) if(new_tail) H.dna.features["mam_tail"] = new_tail if(new_tail != "None") @@ -138,7 +138,7 @@ if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(H.client.ckey))) snowflake_taur_list[S.name] = path var/new_taur - new_taur = input(owner, "Choose your character's tauric body:", "Tauric Alteration") as null|anything in snowflake_taur_list + new_taur = tgui_input_list(owner, "Choose your character's tauric body:", "Tauric Alteration", snowflake_taur_list) if(new_taur) H.dna.features["taur"] = new_taur if(new_taur != "None") @@ -149,7 +149,7 @@ for(var/obj/item/organ/genital/penis/X in H.internal_organs) qdel(X) var/new_shape - new_shape = input(owner, "Choose your character's dong", "Genital Alteration") as null|anything in GLOB.cock_shapes_list + new_shape = tgui_input_list(owner, "Choose your character's dong", "Genital Alteration", GLOB.cock_shapes_list) if(new_shape) H.dna.features["cock_shape"] = new_shape H.update_genitals() @@ -162,7 +162,7 @@ for(var/obj/item/organ/genital/vagina/X in H.internal_organs) qdel(X) var/new_shape - new_shape = input(owner, "Choose your character's pussy", "Genital Alteration") as null|anything in GLOB.vagina_shapes_list + new_shape = tgui_input_list(owner, "Choose your character's pussy", "Genital Alteration", GLOB.vagina_shapes_list) if(new_shape) H.dna.features["vag_shape"] = new_shape H.update_genitals() @@ -175,7 +175,7 @@ qdel(X) var/min_D = CONFIG_GET(number/penis_min_inches_prefs) var/max_D = CONFIG_GET(number/penis_max_inches_prefs) - var/new_length = input(owner, "Penis length in inches:\n([min_D]-[max_D])", "Genital Alteration") as num|null + var/new_length = tgui_input_num(owner, "Penis length in inches:\n([min_D]-[max_D])", "Genital Alteration", H.dna.features["cock_length"]) if(new_length) H.dna.features["cock_length"] = clamp(round(new_length), min_D, max_D) H.update_genitals() @@ -186,7 +186,7 @@ else if (select_alteration == "Breast Size") for(var/obj/item/organ/genital/breasts/X in H.internal_organs) qdel(X) - var/new_size = input(owner, "Breast Size", "Genital Alteration") as null|anything in CONFIG_GET(keyed_list/breasts_cups_prefs) + var/new_size = tgui_input_list(owner, "Breast Size", "Genital Alteration", CONFIG_GET(keyed_list/breasts_cups_prefs)) if(new_size) H.dna.features["breasts_size"] = new_size H.update_genitals() @@ -197,7 +197,7 @@ for(var/obj/item/organ/genital/breasts/X in H.internal_organs) qdel(X) var/new_shape - new_shape = input(owner, "Breast Shape", "Genital Alteration") as null|anything in GLOB.breasts_shapes_list + new_shape = tgui_input_list(owner, "Breast Shape", "Genital Alteration", GLOB.breasts_shapes_list) if(new_shape) H.dna.features["breasts_shape"] = new_shape H.update_genitals() diff --git a/code/modules/mob/living/carbon/human/species_types/ipc.dm b/code/modules/mob/living/carbon/human/species_types/ipc.dm index eb870f9624..6797881279 100644 --- a/code/modules/mob/living/carbon/human/species_types/ipc.dm +++ b/code/modules/mob/living/carbon/human/species_types/ipc.dm @@ -51,7 +51,7 @@ /datum/action/innate/monitor_change/Activate() var/mob/living/carbon/human/H = owner - var/new_ipc_screen = input(usr, "Choose your character's screen:", "Monitor Display") as null|anything in GLOB.ipc_screens_list + var/new_ipc_screen = tgui_input_list(usr, "Choose your character's screen:", "Monitor Display", GLOB.ipc_screens_list) if(!new_ipc_screen) return H.dna.features["ipc_screen"] = new_ipc_screen diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 04c69a4138..9e1c5e63bc 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -663,7 +663,7 @@ Remove(H) return - var/message = sanitize(input("Message:", "Slime Telepathy") as text|null) + var/message = sanitize(tgui_input_text(usr, "Message:", "Slime Telepathy")) if(!species || !(H in species.linked_mobs)) to_chat(H, "The link seems to have been severed...") @@ -700,13 +700,13 @@ var/list/options = list() for(var/mob/living/Ms in oview(H)) options += Ms - var/mob/living/M = input("Select who to send your message to:","Send thought to?",null) as null|mob in options + var/mob/living/M = tgui_input_list(usr, "Select who to send your message to:","Send thought to?", options) if(!M) return if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) to_chat(H, "As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled.") return - var/msg = sanitize(input("Message:", "Telepathy") as text|null) + var/msg = sanitize(tgui_input_text(usr, "Message:", "Telepathy")) if(msg) if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) to_chat(H, "As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled.") diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 2019458ebc..58ba34e1fb 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -271,7 +271,7 @@ to_chat(usr, "Wireless control is disabled!") return - var/reason = input(src, "What is the nature of your emergency? ([CALL_SHUTTLE_REASON_LENGTH] characters required.)", "Confirm Shuttle Call") as null|text + var/reason = tgui_input_text(src, "What is the nature of your emergency? ([CALL_SHUTTLE_REASON_LENGTH] characters required.)", "Confirm Shuttle Call") if(incapacitated()) return @@ -573,7 +573,7 @@ for(var/i in C.network) 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?", "", cameralist) if(!U.eyeobj) U.view_core() @@ -605,7 +605,7 @@ if(incapacitated()) return var/list/ai_emotions = list("Very Happy", "Happy", "Neutral", "Unsure", "Confused", "Sad", "BSOD", "Blank", "Problems?", "Awesome", "Facepalm", "Thinking", "Friend Computer", "Dorfy", "Blue Glow", "Red Glow") - var/n_emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions + var/n_emote = tgui_input_list(src, "Please, select a status!", "AI Status", ai_emotions) if(!n_emote) return emote_display = n_emote @@ -640,7 +640,7 @@ personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image. if(personnel_list.len) - input = input("Select a crew member:") as null|anything in personnel_list + input = tgui_input_list(src, "Select a crew member:", "", 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. @@ -665,7 +665,7 @@ "spider" = 'icons/mob/animal.dmi' ) - input = input("Please select a hologram:") as null|anything in icon_list + input = tgui_input_list(src, "Please select a hologram:", "", icon_list) if(input) qdel(holo_icon) switch(input) @@ -689,7 +689,7 @@ "custom" ) - input = input("Please select a hologram:") as null|anything in icon_list + input = tgui_input_list(src, "Please select a hologram:", "", icon_list) if(input) qdel(holo_icon) switch(input) @@ -949,7 +949,7 @@ to_chat(src, "No usable AI shell beacons detected.") if(!target || !(target in possible)) //If the AI is looking for a new shell, or its pre-selected shell is no longer valid - target = input(src, "Which body to control?") as null|anything in possible + target = tgui_input_list(src, "Which body to control?", "", possible) if (!target || target.stat == DEAD || target.deployed || !(!target.connected_ai ||(target.connected_ai == src))) return diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 2b5d3d98f2..2e9a9ef62e 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -97,11 +97,11 @@ to_chat(src, "Please wait [DisplayTimeText(announcing_vox - world.time)].") return - var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) as text + var/message = tgui_input_text(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) last_announcement = message - var/voxType = input(src, "Male or female VOX?", "VOX-gender") in list("male", "female") + var/voxType = tgui_input_list(src, "Male or female VOX?", "VOX-gender", list("male", "female")) if(!message || announcing_vox > world.time) return diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm index 63fb82082f..2a5cb9cdc7 100644 --- a/code/modules/mob/living/silicon/pai/pai_shell.dm +++ b/code/modules/mob/living/silicon/pai/pai_shell.dm @@ -77,19 +77,19 @@ if(CONFIG_GET(flag/pai_custom_holoforms)) choices += "Custom" var/old_chassis = chassis - var/choicetype = input(src, "What type of chassis do you want to use?") as null|anything in choices + var/choicetype = tgui_input_list(src, "What type of chassis do you want to use?", "", choices) if(!choicetype) return FALSE switch(choicetype) if("Custom") chassis = "custom" if("Preset - Basic") - var/choice = input(src, "What would you like to use for your holochassis composite?") as null|anything in possible_chassis + var/choice = tgui_input_list(src, "What would you like to use for your holochassis composite?", "", possible_chassis) if(!choice) return FALSE chassis = choice if("Preset - Dynamic") - var/choice = input(src, "What would you like to use for your holochassis composite?") as null|anything in dynamic_chassis_icons + var/choice = tgui_input_list(src, "What would you like to use for your holochassis composite?", "", dynamic_chassis_icons) if(!choice) return FALSE chassis = "dynamic" diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index f15b6e1d5c..de17c9edbe 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -147,7 +147,7 @@ radio.attack_self(src) if("image") - var/newImage = input("Select your new display image.", "Display Image", "Happy") in list("Happy", "Cat", "Extremely Happy", "Face", "Laugh", "Off", "Sad", "Angry", "What" , "Exclamation" ,"Question", "Sunglasses") + var/newImage = tgui_input_list(usr, "Select your new display image.", "Display Image", list("Happy", "Cat", "Extremely Happy", "Face", "Laugh", "Off", "Sad", "Angry", "What" , "Exclamation" ,"Question", "Sunglasses")) var/pID = 1 switch(newImage) @@ -395,7 +395,7 @@ return dat /mob/living/silicon/pai/proc/CheckDNA(mob/living/carbon/M, mob/living/silicon/pai/P) - var/answer = input(M, "[P] is requesting a DNA sample from you. Will you allow it to confirm your identity?", "[P] Check DNA", "No") in list("Yes", "No") + var/answer = tgui_input_list(M, "[P] is requesting a DNA sample from you. Will you allow it to confirm your identity?", "[P] Check DNA", list("Yes", "No")) if(answer == "Yes") M.visible_message("[M] presses [M.p_their()] thumb against [P].",\ "You press your thumb against [P].",\ diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 2c7e963e73..9e3b609fdd 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -150,7 +150,7 @@ if(BORG_SEC_AVAILABLE) modulelist["Security"] = /obj/item/robot_module/security - var/input_module = input("Please, select a module!", "Robot", null, null) as null|anything in sortList(modulelist) + var/input_module = tgui_input_list(src, "Please, select a module!", "Robot", sortList(modulelist)) if(!input_module || module.type != /obj/item/robot_module) return diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 77d1be2bcd..a83f4e84ca 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -338,7 +338,7 @@ return //Ask the user to pick a channel from what it has available. - var/Autochan = input("Select a channel:") as null|anything in list("Default","None") + radio.channels + var/Autochan = tgui_input_list(src, "Select a channel:", "", list("Default","None") + radio.channels) if(!Autochan) return diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index ff6941ec70..d2a2f841a3 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -181,7 +181,7 @@ empty_tiles() if("linemode") - var/setdir = input("Select construction direction:") as null|anything in list("north","east","south","west","disable") + var/setdir = tgui_input_list(usr, "Select construction direction:", "", list("north","east","south","west","disable")) switch(setdir) if("north") targetdirection = 1 @@ -433,4 +433,4 @@ if(robot.mode == BOT_REPAIRING) return TRUE return FALSE - + diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index b287b854a3..554bd247e8 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -240,7 +240,7 @@ if("destination") var/new_dest if(pda) - new_dest = input(user, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags + new_dest = tgui_input_list(user, "Enter Destination:", name, GLOB.deliverybeacontags) else new_dest = params["value"] if(new_dest) @@ -256,7 +256,7 @@ if("sethome") var/new_home if(pda) - new_home = input(user, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags + new_home = tgui_input_list(user, "Enter Home:", name, GLOB.deliverybeacontags) else new_home = params["value"] if(new_home) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm b/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm index 0f0d4dea72..710341e923 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm @@ -16,7 +16,7 @@ set category = "Drone" set name = "Drone ping" - var/alert_s = input(src,"Alert severity level","Drone ping",null) as null|anything in list("Low","Medium","High","Critical") + var/alert_s = tgui_input_list(src,"Alert severity level","Drone ping",list("Low","Medium","High","Critical")) var/area/A = get_area(loc) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm index 815c2bc0db..be67455177 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm @@ -95,11 +95,11 @@ /mob/living/simple_animal/drone/proc/pickVisualAppearence() picked = FALSE - var/appearence = input("Choose your appearance!", "Appearance", "Maintenance Drone") in list("Maintenance Drone", "Repair Drone", "Scout Drone") + var/appearence = tgui_input_list(usr, "Choose your appearance!", "Appearance", list("Maintenance Drone", "Repair Drone", "Scout Drone")) switch(appearence) if("Maintenance Drone") visualAppearence = MAINTDRONE - colour = input("Choose your colour!", "Colour", "grey") in list("grey", "blue", "red", "green", "pink", "orange") + colour = tgui_input_list(usr, "Choose your colour!", "Colour", list("grey", "blue", "red", "green", "pink", "orange")) icon_state = "[visualAppearence]_[colour]" icon_living = "[visualAppearence]_[colour]" icon_dead = "[visualAppearence]_dead" diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index ec11a3e83e..547d808673 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -461,7 +461,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians if(P.reset) guardians -= P //clear out guardians that are already reset if(guardians.len) - var/mob/living/simple_animal/hostile/guardian/G = input(src, "Pick the guardian you wish to reset", "Guardian Reset") as null|anything in guardians + var/mob/living/simple_animal/hostile/guardian/G = tgui_input_list(src, "Pick the guardian you wish to reset", "Guardian Reset", guardians) if(G) to_chat(src, "You attempt to reset [G.real_name]'s personality...") var/list/mob/candidates = pollGhostCandidates("Do you want to play as [src.real_name]'s [G.real_name]?", ROLE_PAI, null, FALSE, 100) @@ -555,7 +555,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians if(random) guardiantype = pick(possible_guardians) else - guardiantype = input(user, "Pick the type of [mob_name]", "[mob_name] Creation") as null|anything in possible_guardians + guardiantype = tgui_input_list(user, "Pick the type of [mob_name]", "[mob_name] Creation", possible_guardians) if(!guardiantype) to_chat(user, "[failure_message]" ) used = FALSE diff --git a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm index 5df446085a..6a082fbc88 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm @@ -96,7 +96,7 @@ set name = "Remove Surveillance Snare" set category = "Guardian" set desc = "Disarm unwanted surveillance snares." - var/picked_snare = input(src, "Pick which snare to remove", "Remove Snare") as null|anything in src.snares + var/picked_snare = tgui_input_list(src, "Pick which snare to remove", "Remove Snare", src.snares) if(picked_snare) src.snares -= picked_snare qdel(picked_snare) diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index d93993bf1f..6327ef77df 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -32,7 +32,7 @@ if(C!=src && Adjacent(C)) choices += C - var/mob/living/M = input(src,"Who do you wish to feed on?") in null|choices + var/mob/living/M = tgui_input_list(src,"Who do you wish to feed on?", "", choices) if(!M) return 0 if(CanFeedon(M)) diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm index 2c2efee534..7c4325fdcd 100644 --- a/code/modules/mob/mob_transformation_simple.dm +++ b/code/modules/mob/mob_transformation_simple.dm @@ -9,7 +9,7 @@ return if(!new_type) - new_type = input("Mob type path:", "Mob type") as text|null + new_type = tgui_input_text(usr, "Mob type path:", "Mob type") if(istext(new_type)) new_type = text2path(new_type) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 4198b6d757..e92886571c 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -73,7 +73,7 @@ return lowertext(copytext_char(input, 1, customsayverb)) /mob/proc/whisper_keybind() - var/message = input(src, "", "whisper") as text|null + var/message = tgui_input_text(src, "", "whisper") if(!length(message)) return return whisper_verb(message) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 44822e8771..15e28ceaf1 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -538,7 +538,7 @@ /mob/living/carbon/human/Animalize(mind_transfer = TRUE) var/list/mobtypes = typesof(/mob/living/simple_animal) - var/mobpath = input("Which type of mob should [src] turn into?", "Choose a type") as null|anything in mobtypes + var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a type", mobtypes) if(!mobpath) return if(mind) @@ -573,7 +573,7 @@ /mob/proc/Animalize(mind_transfer = TRUE) var/list/mobtypes = typesof(/mob/living/simple_animal) - var/mobpath = input("Which type of mob should [src] turn into?", "Choose a type") as null|anything in mobtypes + var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a type", mobtypes) if(!mobpath) return if(mind) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 4a7d57eeba..3cfd342122 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -425,7 +425,7 @@ var/obj/item/computer_hardware/H = all_components[h] component_names.Add(H.name) - var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names) + var/choice = tgui_input_list(user, "Which component do you want to uninstall?", "Computer maintenance", sortList(component_names)) if(!choice) return diff --git a/code/modules/modular_computers/file_system/programs/cargoship.dm b/code/modules/modular_computers/file_system/programs/cargoship.dm index 89a3b3247d..a023f92831 100644 --- a/code/modules/modular_computers/file_system/programs/cargoship.dm +++ b/code/modules/modular_computers/file_system/programs/cargoship.dm @@ -54,7 +54,7 @@ if("resetid") payments_acc = null if("setsplit") - var/potential_cut = input("How much would you like to payout to the registered card?","Percentage Profit") as num|null + var/potential_cut = tgui_input_num(usr, "How much would you like to payout to the registered card?","Percentage Profit") percent_cut = potential_cut ? clamp(round(potential_cut, 1), 1, 50) : 20 if("print") if(!printer) diff --git a/code/modules/newscaster/newscaster_machine.dm b/code/modules/newscaster/newscaster_machine.dm index 151ebd49d9..819d7411ae 100644 --- a/code/modules/newscaster/newscaster_machine.dm +++ b/code/modules/newscaster/newscaster_machine.dm @@ -381,7 +381,7 @@ GLOBAL_LIST_EMPTY(allCasters) for(var/datum/news/feed_channel/F in GLOB.news_network.network_channels) if( (!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name - channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels + channel_name = tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels) updateUsrDialog() else if(href_list["set_new_message"]) var/temp_message = trim(stripped_multiline_input(usr, "Write your Feed story", "Network Channel Handler", msg)) diff --git a/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm b/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm index ab52f3e018..1b11b320c2 100644 --- a/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm +++ b/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm @@ -12,7 +12,7 @@ */ /obj/item/clothing/suit/space/space_ninja/proc/ninjanet() var/mob/living/carbon/human/ninja = affecting - var/mob/living/net_target = input("Select who to capture:","Capture who?",null) as null|mob in sortNames(oview(ninja)) + var/mob/living/net_target = tgui_input_list(ninja, "Select who to capture:","Capture who?",sortNames(oview(ninja))) if(QDELETED(net_target)||!(net_target in oview(ninja))) return diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index b4f1acbed4..7b19a7ad42 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -123,7 +123,7 @@ desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp." /obj/item/pen/attack_self(mob/living/carbon/user) - var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num + var/deg = tgui_input_num(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") if(deg && (deg > 0 && deg <= 360)) degrees = deg to_chat(user, "You rotate the top of the pen to [degrees] degrees.") @@ -149,7 +149,7 @@ . = ..() //Changing name/description of items. Only works if they have the UNIQUE_RENAME object flag set if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME)) - var/penchoice = input(user, "What would you like to edit?", "Rename, change description or reset both?") as null|anything in list("Rename","Change description","Reset") + var/penchoice = tgui_input_list(user, "What would you like to edit?", "Rename, change description or reset both?", list("Rename","Change description","Reset")) if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) return if(penchoice == "Rename") diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 2ee284431a..a22d5f8e16 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -52,8 +52,8 @@ . = ..() if(!user.canUseTopic(src, BE_CLOSE)) return - var/desired_x = input(user, "How high do you want the camera to shoot, between [picture_size_x_min] and [picture_size_x_max]?", "Zoom", picture_size_x) as num - var/desired_y = input(user, "How wide do you want the camera to shoot, between [picture_size_y_min] and [picture_size_y_max]?", "Zoom", picture_size_y) as num + var/desired_x = tgui_input_num(user, "How high do you want the camera to shoot, between [picture_size_x_min] and [picture_size_x_max]?", "Zoom", picture_size_x) + var/desired_y = tgui_input_num(user, "How wide do you want the camera to shoot, between [picture_size_y_min] and [picture_size_y_max]?", "Zoom", picture_size_y) picture_size_x = min(clamp(desired_x, picture_size_x_min, picture_size_x_max), CAMERA_PICTURE_SIZE_HARD_LIMIT) picture_size_y = min(clamp(desired_y, picture_size_y_min, picture_size_y_max), CAMERA_PICTURE_SIZE_HARD_LIMIT) return TRUE diff --git a/code/modules/photography/camera/silicon_camera.dm b/code/modules/photography/camera/silicon_camera.dm index 28a080d5f1..69dcfd89a8 100644 --- a/code/modules/photography/camera/silicon_camera.dm +++ b/code/modules/photography/camera/silicon_camera.dm @@ -33,7 +33,7 @@ var/datum/picture/p = i nametemp += p.picture_name temp[p.picture_name] = p - find = input(user, "Select image") in nametemp|null + find = tgui_input_list(user, "Select image", "", nametemp) if(!find) return return temp[find] diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm index 8a27f2669c..915678ef5b 100644 --- a/code/modules/plumbing/ducts.dm +++ b/code/modules/plumbing/ducts.dm @@ -407,10 +407,10 @@ All the important duct code: . += "It's current color and layer are [duct_color] and [duct_layer]. Use in-hand to change." /obj/item/stack/ducts/attack_self(mob/user) - var/new_layer = input("Select a layer", "Layer") as null|anything in layers + var/new_layer = tgui_input_list(user, "Select a layer", "Layer", layers) if(new_layer) duct_layer = new_layer - var/new_color = input("Select a color", "Color") as null|anything in GLOB.pipe_paint_colors + var/new_color = tgui_input_list(user, "Select a color", "Color", GLOB.pipe_paint_colors) if(new_color) duct_color = new_color add_atom_colour(GLOB.pipe_paint_colors[new_color], FIXED_COLOUR_PRIORITY) diff --git a/code/modules/plumbing/plumbers/bottler.dm b/code/modules/plumbing/plumbers/bottler.dm index 396c7cac22..8bab3937b9 100644 --- a/code/modules/plumbing/plumbers/bottler.dm +++ b/code/modules/plumbing/plumbers/bottler.dm @@ -51,7 +51,7 @@ ///changing input ammount with a window /obj/machinery/plumbing/bottler/interact(mob/user) . = ..() - wanted_amount = clamp(round(input(user,"maximum is 100u","set ammount to fill with") as num|null, 1), 1, 100) + wanted_amount = clamp(round(tgui_input_num(user,"maximum is 100u","set ammount to fill with"), 1), 1, 100) reagents.clear_reagents() to_chat(user, " The [src] will now fill for [wanted_amount]u.") diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 9e779b9c1b..191ec3499f 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -520,7 +520,7 @@ By design, d1 is the smallest direction and d2 is the highest cost = 1 /obj/item/stack/cable_coil/cyborg/attack_self(mob/user) - var/cable_color = input(user,"Pick a cable color.","Cable Color") in list("red","yellow","green","blue","pink","orange","cyan","white") + var/cable_color = tgui_input_list(user,"Pick a cable color.","Cable Color", list("red","yellow","green","blue","pink","orange","cyan","white")) color = cable_color update_icon() diff --git a/code/modules/procedural_mapping/mapGenerator.dm b/code/modules/procedural_mapping/mapGenerator.dm index 323f74d0ef..0487feb1d8 100644 --- a/code/modules/procedural_mapping/mapGenerator.dm +++ b/code/modules/procedural_mapping/mapGenerator.dm @@ -147,16 +147,16 @@ set category = "Debug" var/datum/mapGenerator/nature/N = new() - var/startInput = input(usr,"Start turf of Map, (X;Y;Z)", "Map Gen Settings", "1;1;1") as text|null + var/startInput = tgui_input_text(usr,"Start turf of Map, (X;Y;Z)", "Map Gen Settings", "1;1;1") if (isnull(startInput)) return - var/endInput = input(usr,"End turf of Map (X;Y;Z)", "Map Gen Settings", "[world.maxx];[world.maxy];[mob ? mob.z : 1]") as text|null - + var/endInput = tgui_input_text(usr,"End turf of Map (X;Y;Z)", "Map Gen Settings", "[world.maxx];[world.maxy];[mob ? mob.z : 1]") + if (isnull(endInput)) return - + //maxx maxy and current z so that if you fuck up, you only fuck up one entire z level instead of the entire universe if(!startInput || !endInput) to_chat(src, "Missing Input") @@ -182,7 +182,7 @@ "Same turfs"=CLUSTER_CHECK_SAME_TURFS, "Same atoms"=CLUSTER_CHECK_SAME_ATOMS, "Different turfs"=CLUSTER_CHECK_DIFFERENT_TURFS, \ "Different atoms"=CLUSTER_CHECK_DIFFERENT_ATOMS, "All turfs"=CLUSTER_CHECK_ALL_TURFS,"All atoms"=CLUSTER_CHECK_ALL_ATOMS) - var/moduleClusters = input("Cluster Flags (Cancel to leave unchanged from defaults)","Map Gen Settings") as null|anything in clusters + var/moduleClusters = tgui_input_list(src, "Cluster Flags (Cancel to leave unchanged from defaults)","Map Gen Settings", clusters) //null for default var/theCluster = 0 diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index 16356fa2d0..2ff8130527 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -265,14 +265,14 @@ var/static/list/till_designs_pr_isnt_merged = list("green", "blue", "amber", "red", "delta") switch(selection) if("Minimum Level Setting") - var/input = input(user, "Input the new minimum level setting.", "Firing Pin Settings", NUM2SECLEVEL(min_sec_level)) as null|anything in till_designs_pr_isnt_merged + var/input = tgui_input_list(user, "Input the new minimum level setting.", "Firing Pin Settings", till_designs_pr_isnt_merged) if(!input) return min_sec_level = till_designs_pr_isnt_merged.Find(input) - 1 if(min_sec_level > max_sec_level) max_sec_level = SEC_LEVEL_DELTA if("Maximum Level Setting") - var/input = input(user, "Input the new maximum level setting.", "Firing Pin Settings", NUM2SECLEVEL(max_sec_level)) as null|anything in till_designs_pr_isnt_merged + var/input = tgui_input_list(user, "Input the new maximum level setting.", "Firing Pin Settings", till_designs_pr_isnt_merged) if(!input) return max_sec_level = till_designs_pr_isnt_merged.Find(input) - 1 diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm index 018161b075..c4f4cab0ff 100644 --- a/code/modules/reagents/chem_wiki_render.dm +++ b/code/modules/reagents/chem_wiki_render.dm @@ -17,7 +17,7 @@ var/prefix = "|Name | Reagents | Reaction vars | Description | Chem properties |\n|---|---|---|-----------|---|\n" - var/input_reagent = replacetext(lowertext(input("Input the name/type of a reagent to get it's description on it's own, or leave blank to parse every chem.", "Input") as text), " ", "") //95% of the time, the reagent type is a lowercase, no spaces / underscored version of the name + var/input_reagent = replacetext(lowertext(tgui_input_text(src, "Input the name/type of a reagent to get it's description on it's own, or leave blank to parse every chem.", "Input")), " ", "") //95% of the time, the reagent type is a lowercase, no spaces / underscored version of the name if(input_reagent) var/input_reagent2 = find_reagent(input_reagent) if(!input_reagent2) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 285ef70433..e6e8070663 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -221,7 +221,8 @@ var/to_container = params["to"] // Custom amount if (amount == -1) - amount = text2num(input( + amount = text2num(tgui_input_num( + usr, "Enter the amount you want to transfer:", name, "")) if (amount == null || amount <= 0) @@ -256,7 +257,7 @@ // Get amount of items var/amount = text2num(params["amount"]) if(amount == null) - amount = text2num(input(usr, + amount = text2num(tgui_input_num(usr, "Max 20. Buffer content will be split evenly.", "How many to make?", 1)) amount = clamp(round(amount), 0, 20) @@ -285,7 +286,7 @@ if(vol_each_text == "auto") vol_each = vol_each_max if(vol_each == null) - vol_each = text2num(input(usr, + vol_each = text2num(tgui_input_num(usr, "Maximum [vol_each_max] units per item.", "How many units to fill?", vol_each_max)) diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm index 489f9dd179..9644cd36e6 100644 --- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm +++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm @@ -30,7 +30,7 @@ beaker = null . = TRUE if("input") - var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text|null), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name + var/input_reagent = replacetext(lowertext(tgui_input_text(usr, "Enter the name of any reagent", "Input")), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name if (isnull(input_reagent)) return diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 9b8ff7b262..375aef573c 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -47,7 +47,7 @@ set name = "Set Transfer Amount" set category = "Object" set waitfor = FALSE - var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts + var/N = tgui_input_list(usr, "Amount per transfer from this:","[src]", possible_transfer_amounts) if(N) amount_per_transfer_from_this = N to_chat(usr, "[src]'s transfer amount is now [amount_per_transfer_from_this] units.") diff --git a/code/modules/reagents/reagent_containers/borghypo.dm b/code/modules/reagents/reagent_containers/borghypo.dm index 3388018280..5dd0273372 100644 --- a/code/modules/reagents/reagent_containers/borghypo.dm +++ b/code/modules/reagents/reagent_containers/borghypo.dm @@ -122,7 +122,7 @@ Borg Hypospray log_combat(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])") /obj/item/reagent_containers/borghypo/attack_self(mob/user) - var/chosen_reagent = modes[reagent_names[input(user, "What reagent do you want to dispense?") as null|anything in reagent_names]] + var/chosen_reagent = modes[reagent_names[tgui_input_list(user, "What reagent do you want to dispense?", "", reagent_names)]] if(!chosen_reagent) return mode = chosen_reagent diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index cc02e271f9..5df70f7e56 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -116,7 +116,7 @@ Note: Must be placed within 3 tiles of the R&D Console differences[i] = value if(length(worths) && !length(differences)) return FALSE - var/choice = input("Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?") in list("Proceed", "Cancel") + var/choice = tgui_input_list(user, "Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?", "", list("Proceed", "Cancel")) if(choice == "Cancel") return FALSE if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src)) @@ -134,7 +134,7 @@ Note: Must be placed within 3 tiles of the R&D Console user_mode_string = " for [json_encode(point_value)] points" else if(loaded_item.custom_materials?.len) user_mode_string = " for material reclamation" - var/choice = input("Are you sure you want to destroy [loaded_item][user_mode_string]?") in list("Proceed", "Cancel") + var/choice = tgui_input_list(user, "Are you sure you want to destroy [loaded_item][user_mode_string]?", "", list("Proceed", "Cancel")) if(choice == "Cancel") return FALSE if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src)) diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index 75a15be9ce..e4d344f9ba 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -153,7 +153,7 @@ Charged extracts: if(!istype(H)) to_chat(user, "You must be a humanoid to use this!") return - var/racechoice = input(H, "Choose your slime subspecies.", "Slime Selection") as null|anything in subtypesof(/datum/species/jelly) + var/racechoice = tgui_input_list(H, "Choose your slime subspecies.", "Slime Selection", subtypesof(/datum/species/jelly)) if(!racechoice) to_chat(user, "You decide not to become a slime for now.") return diff --git a/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm b/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm index a88b5cd35b..bc1597aac8 100644 --- a/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm +++ b/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm @@ -28,7 +28,7 @@ Self-sustaining extracts: return INITIALIZE_HINT_QDEL /obj/item/autoslime/attack_self(mob/user) - var/reagentselect = input(user, "Choose the reagent the extract will produce.", "Self-sustaining Reaction") as null|anything in extract.activate_reagents + var/reagentselect = tgui_input_list(user, "Choose the reagent the extract will produce.", "Self-sustaining Reaction", extract.activate_reagents) var/amount = 5 var/secondary diff --git a/code/modules/research/xenobiology/crossbreeding/stabilized.dm b/code/modules/research/xenobiology/crossbreeding/stabilized.dm index 69bd2c7e28..5fc7a628da 100644 --- a/code/modules/research/xenobiology/crossbreeding/stabilized.dm +++ b/code/modules/research/xenobiology/crossbreeding/stabilized.dm @@ -115,7 +115,7 @@ Stabilized extracts: generate_mobtype() /obj/item/slimecross/stabilized/gold/attack_self(mob/user) - var/choice = input(user, "Which do you want to reset?", "Familiar Adjustment") as null|anything in list("Familiar Location", "Familiar Species", "Familiar Sentience", "Familiar Name") + var/choice = tgui_input_list(user, "Which do you want to reset?", "Familiar Adjustment", list("Familiar Location", "Familiar Species", "Familiar Sentience", "Familiar Name")) if(!user.canUseTopic(src, BE_CLOSE)) return if(isliving(user)) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index ca502584d7..89fd64f3ad 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -47,7 +47,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) promptAndCheckIn(user) /obj/item/hilbertshotel/proc/promptAndCheckIn(mob/user) - var/chosenRoomNumber = input(user, "What number room will you be checking into?", "Room Number") as null|num + var/chosenRoomNumber = tgui_input_num(user, "What number room will you be checking into?", "Room Number") if(!chosenRoomNumber || !user.CanReach(src)) return if(chosenRoomNumber > SHORT_REAL_LIMIT) diff --git a/code/modules/shuttle/assault_pod.dm b/code/modules/shuttle/assault_pod.dm index 1258b9f4b8..43877819a3 100644 --- a/code/modules/shuttle/assault_pod.dm +++ b/code/modules/shuttle/assault_pod.dm @@ -35,7 +35,7 @@ /obj/item/assault_pod/attack_self(mob/living/user) var/target_area - target_area = input("Area to land", "Select a Landing Zone", target_area) as null|anything in GLOB.teleportlocs + target_area = tgui_input_list(user, "Area to land", "Select a Landing Zone", GLOB.teleportlocs) if(!target_area) return var/area/picked_area = GLOB.teleportlocs[target_area] diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index a215b58b55..05ecb3f05c 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -346,7 +346,7 @@ L["([L.len]) [nav_beacon.name] locked"] = null 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(usr, "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/shuttle/spaceship_navigation_beacon.dm b/code/modules/shuttle/spaceship_navigation_beacon.dm index dbf81d791e..de826af62f 100644 --- a/code/modules/shuttle/spaceship_navigation_beacon.dm +++ b/code/modules/shuttle/spaceship_navigation_beacon.dm @@ -43,7 +43,7 @@ if(!I.tool_behaviour == TOOL_MULTITOOL) return if(panel_open) - var/new_name = "Beacon_[input("Enter the custom name for this beacon", "It be Beacon ..your input..") as text]" + var/new_name = "Beacon_[tgui_input_list(user, "Enter the custom name for this beacon", "It be Beacon ..your input..")]" if(new_name && Adjacent(user)) name = new_name to_chat(user, "You change beacon name to [name].") diff --git a/code/modules/smithing/anvil.dm b/code/modules/smithing/anvil.dm index b796edabbf..476565c8bb 100644 --- a/code/modules/smithing/anvil.dm +++ b/code/modules/smithing/anvil.dm @@ -115,7 +115,7 @@ currentquality += qualitychange var/list/shapingsteps = list("weak hit", "strong hit", "heavy hit", "fold", "draw", "shrink", "bend", "punch", "upset") //weak/strong/heavy hit affect strength. All the other steps shape. workpiece_state = WORKPIECE_INPROGRESS - var/stepdone = input(user, "How would you like to work the metal?") in shapingsteps + var/stepdone = tgui_input_list(user, "How would you like to work the metal?", "", shapingsteps) var/steptime = 50 if(user.mind.skill_holder) var/skillmod = user.mind.get_skill_level(/datum/skill/level/dwarfy/blacksmithing)/10 + 1 diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 2272a14612..c999f01794 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -376,11 +376,11 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th continue possible_targets += M - //targets += input("Choose the target for the spell.", "Targeting") as mob in possible_targets + //targets += 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. var/mob/M if(!random_target) - M = input("Choose the target for the spell.", "Targeting") as null|mob in sortNames(possible_targets) + M = tgui_input_list(user, "Choose the target for the spell.", "Targeting", sortNames(possible_targets)) else switch(random_target_priority) if(TARGET_RANDOM) diff --git a/code/modules/spells/spell_types/area_teleport.dm b/code/modules/spells/spell_types/area_teleport.dm index 50d5ee0ad6..19a0d12a2b 100644 --- a/code/modules/spells/spell_types/area_teleport.dm +++ b/code/modules/spells/spell_types/area_teleport.dm @@ -28,7 +28,7 @@ var/A = null if(!randomise_selection) - A = input("Area to teleport to", "Teleport", A) as null|anything in GLOB.teleportlocs + A = tgui_input_list(usr, "Area to teleport to", "Teleport", GLOB.teleportlocs) else A = pick(GLOB.teleportlocs) if(!A) diff --git a/code/modules/spells/spell_types/devil.dm b/code/modules/spells/spell_types/devil.dm index 3b76107905..3ff78e24c2 100644 --- a/code/modules/spells/spell_types/devil.dm +++ b/code/modules/spells/spell_types/devil.dm @@ -54,7 +54,7 @@ user.put_in_hands(contract) else var/obj/item/paper/contract/infernal/contract // = new(user.loc, C.mind, contractType, user.mind) - var/contractTypeName = input(user, "What type of contract?") in list ("Power", "Wealth", "Prestige", "Magic", "Knowledge", "Friendship") + var/contractTypeName = tgui_input_list(user, "What type of contract?", "", list("Power", "Wealth", "Prestige", "Magic", "Knowledge", "Friendship")) switch(contractTypeName) if("Power") contract = new /obj/item/paper/contract/infernal/power(C.loc, C.mind, user.mind) diff --git a/code/modules/spells/spell_types/devil_boons.dm b/code/modules/spells/spell_types/devil_boons.dm index cf11466d19..2be22f6ecb 100644 --- a/code/modules/spells/spell_types/devil_boons.dm +++ b/code/modules/spells/spell_types/devil_boons.dm @@ -43,7 +43,7 @@ for(var/mob/C in targets) if(!C.client) continue - C.client.view_size.setTo((input("Select view range:", "Range", 4) in ranges) - 7) + C.client.view_size.setTo((tgui_input_list(user, "Select view range:", "Range", ranges - 7))) /obj/effect/proc_holder/spell/targeted/summon_friend name = "Summon Friend" diff --git a/code/modules/spells/spell_types/shapeshift.dm b/code/modules/spells/spell_types/shapeshift.dm index 67c2e3e941..f686fdfcd5 100644 --- a/code/modules/spells/spell_types/shapeshift.dm +++ b/code/modules/spells/spell_types/shapeshift.dm @@ -34,7 +34,7 @@ for(var/path in possible_shapes) var/mob/living/simple_animal/A = path animal_list[initial(A.name)] = path - var/new_shapeshift_type = input(M, "Choose Your Animal Form!", "It's Morphing Time!", null) as null|anything in animal_list + var/new_shapeshift_type = tgui_input_list(M, "Choose Your Animal Form!", "It's Morphing Time!", animal_list) if(shapeshift_type) return shapeshift_type = new_shapeshift_type diff --git a/code/modules/spells/spell_types/voice_of_god.dm b/code/modules/spells/spell_types/voice_of_god.dm index fa41b59c0d..77a66f74ae 100644 --- a/code/modules/spells/spell_types/voice_of_god.dm +++ b/code/modules/spells/spell_types/voice_of_god.dm @@ -24,7 +24,7 @@ /obj/effect/proc_holder/spell/voice_of_god/choose_targets(mob/user = usr) perform(user=user) /obj/effect/proc_holder/spell/voice_of_god/perform(list/targets, recharge = 1, mob/user = usr) - command = input(user, "Speak with the Voice of God", "Command") + command = tgui_input_text(user, "Speak with the Voice of God", "Command") if(QDELETED(src) || QDELETED(user)) return if(!command) diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index cb1fdcfc2e..442038c563 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -286,7 +286,7 @@ var/list/options = gps_locators if(area_aim) options += GLOB.teleportlocs - var/V = input(user,"Select target", "Select target",null) in options|null + var/V = tgui_input_list(user,"Select target", "Select target", options) target = options[V] diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index afe8c9d1d1..b036d86005 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -37,7 +37,7 @@ O.on_find(user) organs -= O organs[O.name] = O - chosen_organ = input("Target which organ?", "Surgery", null, null) as null|anything in organs + chosen_organ = tgui_input_list(user, "Target which organ?", "Surgery", organs) chosen_organ = organs[chosen_organ] if(!chosen_organ) return -1 diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index 652c49519a..c28c7d9848 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -53,7 +53,7 @@ if(!available_surgeries.len) return - 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] diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 0876357e8e..0cbd232afc 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -105,7 +105,7 @@ O.on_find(user) 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_held_item() == tool) I = organs[I] if(!I) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 9861a1b639..bc35298953 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -280,7 +280,7 @@ var/C = input(owner, "Select Color", "Select color", "#ffffff") as color|null if(!C || QDELETED(src) || QDELETED(user) || QDELETED(owner) || owner != user) return - var/range = input(user, "Enter range (0 - [max_light_beam_distance])", "Range Select", 0) as null|num + var/range = tgui_input_num(user, "Enter range (0 - [max_light_beam_distance])", "Range Select", 0) if(!isnum(range)) return diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index e41980cdd3..e2ddfe6cab 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -46,7 +46,7 @@ /datum/action/item_action/organ_action/use/adamantine_vocal_cords/Trigger() if(!IsAvailable()) return - var/message = input(owner, "Resonate a message to all nearby golems.", "Resonate") + var/message = tgui_input_text(owner, "Resonate a message to all nearby golems.", "Resonate") if(QDELETED(src) || QDELETED(owner) || !message) return owner.say(".x[message]") @@ -100,7 +100,7 @@ if(world.time < cords.next_command) to_chat(owner, "You must wait [DisplayTimeText(cords.next_command - world.time)] before Speaking again.") return - var/command = input(owner, "Speak with the Voice of God", "Command") + var/command = tgui_input_text(owner, "Speak with the Voice of God", "Command") if(QDELETED(src) || QDELETED(owner)) return if(!command) @@ -644,7 +644,7 @@ /datum/action/item_action/organ_action/velvet/Trigger() . = ..() - var/command = input(owner, "Speak in a sultry tone", "Command") + var/command = tgui_input_text(owner, "Speak in a sultry tone", "Command") if(QDELETED(src) || QDELETED(owner)) return if(!command) @@ -1220,7 +1220,7 @@ if (E.mental_capacity >= 5) var/trigger = html_decode(stripped_input(user, "Enter the trigger phrase", MAX_MESSAGE_LEN)) var/custom_words_words_list = list("Speak", "Echo", "Shock", "Cum", "Kneel", "Strip", "Trance", "Cancel") - var/trigger2 = input(user, "Pick an effect", "Effects") in custom_words_words_list + var/trigger2 = tgui_input_list(user, "Pick an effect", "Effects", custom_words_words_list) trigger2 = lowertext(trigger2) if ((findtext(trigger2, custom_words_words))) if (trigger2 == "speak" || trigger2 == "echo") @@ -1260,7 +1260,7 @@ H.SetStun(1000) var/trigger = stripped_input(user, "Enter the loop phrase", MAX_MESSAGE_LEN) var/customSpan = list("Notice", "Warning", "Hypnophrase", "Love", "Velvet") - var/trigger2 = input(user, "Pick the style", "Style") in customSpan + var/trigger2 = tgui_input_list(user, "Pick the style", "Style", customSpan) trigger2 = lowertext(trigger2) E.customEcho = trigger E.customSpan = trigger2 diff --git a/code/modules/surgery/plastic_surgery.dm b/code/modules/surgery/plastic_surgery.dm index d3597ba516..91809859c0 100644 --- a/code/modules/surgery/plastic_surgery.dm +++ b/code/modules/surgery/plastic_surgery.dm @@ -30,7 +30,7 @@ for(var/_i in 1 to 9) names += "Subject [target.gender == MALE ? "i" : "o"]-[pick("a", "b", "c", "d", "e")]-[rand(10000, 99999)]" names += target.dna.species.random_name(target.gender, TRUE) //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/tcg/cards.dm b/code/modules/tcg/cards.dm index f5c7c47aaf..6b1cbd9884 100644 --- a/code/modules/tcg/cards.dm +++ b/code/modules/tcg/cards.dm @@ -214,11 +214,11 @@ result = show_radial_menu(user, src, possible_actions, require_near = TRUE, tooltips = TRUE) switch(result) if("Health") - card_datum.health = input(user, "What do you want health to be?", "Changing [src]'s health") as num|null + card_datum.health = tgui_input_num(user, "What do you want health to be?", "Changing [src]'s health", card_datum.health) if("Attack") - card_datum.attack = input(user, "What do you want attack to be?", "Changing [src]'s attack") as num|null + card_datum.attack = tgui_input_num(user, "What do you want attack to be?", "Changing [src]'s attack", card_datum.attack) if("Mana") - card_datum.mana_cost = input(user, "What do you want mana cost to be?", "Changing [src]'s mana cost") as num|null + card_datum.mana_cost = tgui_input_num(user, "What do you want mana cost to be?", "Changing [src]'s mana cost", card_datum.mana_cost) user.visible_message("[user] changes [src]'s [result].") /obj/item/tcg_card/equipped(mob/user, slot, initial) @@ -575,7 +575,7 @@ qdel(I) if(istype(I, /obj/item/tcgcard_deck)) var/obj/item/tcgcard_deck/deck = I - var/named = input(user, "How will this deck be named? Leave this field empty if you don't want to save this deck.") + var/named = tgui_input_text(user, "How will this deck be named? Leave this field empty if you don't want to save this deck.") if(named) decks[named] = list() for(var/obj/item/tcg_card/card in deck.contents) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index eab1c55ca9..6434a694b1 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1141,7 +1141,7 @@ GLOBAL_LIST_EMPTY(vending_products) var/price = 1 /obj/item/price_tagger/attack_self(mob/user) - price = max(1, round(input(user,"set price","price") as num|null, 1)) + price = max(1, round(tgui_input_num(user,"set price","price"), 1)) to_chat(user, " The [src] will now give things a [price] cr tag.") /obj/item/price_tagger/afterattack(atom/target, mob/user, proximity) diff --git a/code/modules/vore/eating/living.dm b/code/modules/vore/eating/living.dm index 7705db7b92..f65ffd3f82 100644 --- a/code/modules/vore/eating/living.dm +++ b/code/modules/vore/eating/living.dm @@ -104,12 +104,12 @@ /mob/living/proc/feed_self_to_grabbed(var/mob/living/user, var/mob/living/pred) pred.lazy_init_belly() - var/belly = input("Choose Belly") in pred.vore_organs + var/belly = tgui_input_list(user, "Choose Belly", "", pred.vore_organs) return perform_the_nom(user, user, pred, belly) /mob/living/proc/feed_grabbed_to_other(var/mob/living/user, var/mob/living/prey, var/mob/living/pred) pred.lazy_init_belly() - var/belly = input("Choose Belly") in pred.vore_organs + var/belly = tgui_input_list(user, "Choose Belly", "", pred.vore_organs) return perform_the_nom(user, prey, pred, belly) // diff --git a/code/modules/vore/eating/vorepanel.dm b/code/modules/vore/eating/vorepanel.dm index 8e8cfc4935..6ea0693df2 100644 --- a/code/modules/vore/eating/vorepanel.dm +++ b/code/modules/vore/eating/vorepanel.dm @@ -222,7 +222,7 @@ if(host.vore_organs.len >= BELLIES_MAX) return FALSE - var/new_name = html_encode(input(usr,"New belly's name:","New Belly") as text|null) + var/new_name = html_encode(tgui_input_text(usr,"New belly's name:","New Belly")) var/failure_msg if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) @@ -283,7 +283,7 @@ unsaved_changes = FALSE return TRUE if("setflavor") - var/new_flavor = html_encode(input(usr,"What your character tastes like (400ch limit). This text will be printed to the pred after 'X tastes of...' so just put something like 'strawberries and cream':","Character Flavor",host.vore_taste) as text|null) + var/new_flavor = html_encode(tgui_input_message(usr,"What your character tastes like (400ch limit). This text will be printed to the pred after 'X tastes of...' so just put something like 'strawberries and cream':","Character Flavor",host.vore_taste)) if(!new_flavor) return FALSE @@ -295,7 +295,7 @@ unsaved_changes = TRUE return TRUE if("setsmell") - var/new_smell = html_encode(input(usr,"What your character smells like (400ch limit). This text will be printed to the pred after 'X smells of...' so just put something like 'strawberries and cream':","Character Smell",host.vore_smell) as text|null) + var/new_smell = html_encode(tgui_input_message(usr,"What your character smells like (400ch limit). This text will be printed to the pred after 'X smells of...' so just put something like 'strawberries and cream':","Character Smell",host.vore_smell)) if(!new_smell) return FALSE @@ -504,7 +504,7 @@ var/attr = params["attribute"] switch(attr) if("b_name") - var/new_name = html_encode(input(usr,"Belly's new name:","New Name") as text|null) + var/new_name = html_encode(tgui_input_text(usr,"Belly's new name:","New Name", host.vore_selected.name)) var/failure_msg if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) @@ -538,7 +538,7 @@ host.vore_selected.digest_mode = new_mode . = TRUE if("b_desc") - var/new_desc = html_encode(input(usr,"Belly Description ([BELLIES_DESC_MAX] char limit):","New Description",host.vore_selected.desc) as message|null) + var/new_desc = html_encode(tgui_input_message(usr,"Belly Description ([BELLIES_DESC_MAX] char limit):","New Description",host.vore_selected.desc)) if(new_desc) new_desc = readd_quotes(new_desc) @@ -552,27 +552,27 @@ var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name. '%count' will be replaced with the number of anything in your belly (will not work for absorbed examine). '%countprey' will be replaced with the number of living prey in your belly (or absorbed prey for absorbed examine)." switch(params["msgtype"]) if("dmp") - var/new_message = input(user,"These are sent to prey when they expire. Write them in 2nd person ('you feel X'). Avoid using %prey in this type."+help,"Digest Message (to prey)",host.vore_selected.get_messages("dmp")) as message + var/new_message = tgui_input_message(user,"These are sent to prey when they expire. Write them in 2nd person ('you feel X'). Avoid using %prey in this type."+help,"Digest Message (to prey)",host.vore_selected.get_messages("dmp")) if(new_message) host.vore_selected.set_messages(new_message,"dmp") if("dmo") - var/new_message = input(user,"These are sent to you when prey expires in you. Write them in 2nd person ('you feel X'). Avoid using %pred in this type."+help,"Digest Message (to you)",host.vore_selected.get_messages("dmo")) as message + var/new_message = tgui_input_message(user,"These are sent to you when prey expires in you. Write them in 2nd person ('you feel X'). Avoid using %pred in this type."+help,"Digest Message (to you)",host.vore_selected.get_messages("dmo")) if(new_message) host.vore_selected.set_messages(new_message,"dmo") if("smo") - var/new_message = input(user,"These are sent to those nearby when prey struggles. Write them in 3rd person ('X's Y bulges')."+help,"Struggle Message (outside)",host.vore_selected.get_messages("smo")) as message + var/new_message = tgui_input_message(user,"These are sent to those nearby when prey struggles. Write them in 3rd person ('X's Y bulges')."+help,"Struggle Message (outside)",host.vore_selected.get_messages("smo")) if(new_message) host.vore_selected.set_messages(new_message,"smo") if("smi") - var/new_message = input(user,"These are sent to prey when they struggle. Write them in 2nd person ('you feel X'). Avoid using %prey in this type."+help,"Struggle Message (inside)",host.vore_selected.get_messages("smi")) as message + var/new_message = tgui_input_message(user,"These are sent to prey when they struggle. Write them in 2nd person ('you feel X'). Avoid using %prey in this type."+help,"Struggle Message (inside)",host.vore_selected.get_messages("smi")) if(new_message) host.vore_selected.set_messages(new_message,"smi") if("em") - var/new_message = input(user,"These are sent to people who examine you when this belly has contents. Write them in 3rd person ('Their %belly is bulging')."+help,"Examine Message (when full)",host.vore_selected.get_messages("em")) as message + var/new_message = tgui_input_message(user,"These are sent to people who examine you when this belly has contents. Write them in 3rd person ('Their %belly is bulging')."+help,"Examine Message (when full)",host.vore_selected.get_messages("em")) if(new_message) host.vore_selected.set_messages(new_message,"em") @@ -587,7 +587,7 @@ host.vore_selected.emote_lists = initial(host.vore_selected.emote_lists) . = TRUE if("b_verb") - var/new_verb = html_encode(input(usr,"New verb when eating (infinitive tense, e.g. nom or swallow):","New Verb") as text|null) + var/new_verb = html_encode(tgui_input_text(usr,"New verb when eating (infinitive tense, e.g. nom or swallow):","New Verb", host.vore_selected.vore_verb)) if(length(new_verb) > BELLIES_NAME_MAX || length(new_verb) < BELLIES_NAME_MIN) tgui_alert_async(usr, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") @@ -626,7 +626,7 @@ host.vore_selected.can_taste = !host.vore_selected.can_taste . = TRUE if("b_bulge_size") - var/new_bulge = input(user, "Choose the required size prey must be to show up on examine, ranging from 25% to 200% Set this to 0 for no text on examine.", "Set Belly Examine Size.") as num|null + var/new_bulge = tgui_input_num(user, "Choose the required size prey must be to show up on examine, ranging from 25% to 200% Set this to 0 for no text on examine.", "Set Belly Examine Size.", host.vore_selected.bulge_size) if(new_bulge == null) return FALSE if(new_bulge == 0) //Disable. @@ -650,17 +650,17 @@ host.vore_selected.escapable = 0 . = TRUE if("b_escapechance") - var/escape_chance_input = input(user, "Set prey escape chance on resist (as %)", "Prey Escape Chance") as num|null + var/escape_chance_input = tgui_input_num(user, "Set prey escape chance on resist (as %)", "Prey Escape Chance", host.vore_selected.escapechance) if(!isnull(escape_chance_input)) //These have to be 'null' because both cancel and 0 are valid, separate options host.vore_selected.escapechance = sanitize_integer(escape_chance_input, 0, 100, initial(host.vore_selected.escapechance)) . = TRUE if("b_escapetime") - var/escape_time_input = input(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time") as num|null + var/escape_time_input = tgui_input_num(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time", host.vore_selected.escapetime) if(!isnull(escape_time_input)) host.vore_selected.escapetime = sanitize_integer(escape_time_input*10, 10, 600, initial(host.vore_selected.escapetime)) . = TRUE if("b_transferchance") - var/transfer_chance_input = input(user, "Set belly transfer chance on resist (as %). You must also set the location for this to have any effect.", "Prey Escape Time") as num|null + var/transfer_chance_input = tgui_input_num(user, "Set belly transfer chance on resist (as %). You must also set the location for this to have any effect.", "Prey Escape Time", host.vore_selected.transferchance) if(!isnull(transfer_chance_input)) host.vore_selected.transferchance = sanitize_integer(transfer_chance_input, 0, 100, initial(host.vore_selected.transferchance)) . = TRUE @@ -675,12 +675,12 @@ host.vore_selected.transferlocation = choice.name . = TRUE if("b_absorbchance") - var/absorb_chance_input = input(user, "Set belly absorb mode chance on resist (as %)", "Prey Absorb Chance") as num|null + var/absorb_chance_input = tgui_input_num(user, "Set belly absorb mode chance on resist (as %)", "Prey Absorb Chance", host.vore_selected.absorbchance) if(!isnull(absorb_chance_input)) host.vore_selected.absorbchance = sanitize_integer(absorb_chance_input, 0, 100, initial(host.vore_selected.absorbchance)) . = TRUE if("b_digestchance") - var/digest_chance_input = input(user, "Set belly digest mode chance on resist (as %)", "Prey Digest Chance") as num|null + var/digest_chance_input = tgui_input_num(user, "Set belly digest mode chance on resist (as %)", "Prey Digest Chance", host.vore_selected.digestchance) if(!isnull(digest_chance_input)) host.vore_selected.digestchance = sanitize_integer(digest_chance_input, 0, 100, initial(host.vore_selected.digestchance)) . = TRUE diff --git a/modular_citadel/code/modules/mentor/mentor_memo.dm b/modular_citadel/code/modules/mentor/mentor_memo.dm index 59ea92febd..24b7ed32d2 100644 --- a/modular_citadel/code/modules/mentor/mentor_memo.dm +++ b/modular_citadel/code/modules/mentor/mentor_memo.dm @@ -6,7 +6,7 @@ if(!SSdbcore.IsConnected()) to_chat(src, "Failed to establish database connection.", confidential = TRUE) return - var/memotask = input(usr,"Choose task.","Memo") in list("Show","Write","Edit","Remove") + var/memotask = tgui_input_list(usr,"Choose task.","Memo", list("Show","Write","Edit","Remove")) if(!memotask) return mentor_memo_output(memotask) @@ -43,7 +43,7 @@ return qdel(query_memocheck) - var/memotext = input(src,"Write your Memo","Memo") as message + var/memotext = tgui_input_message(src,"Write your Memo","Memo") if(!memotext) return var/datum/db_query/query_memoadd = SSdbcore.NewQuery({" @@ -73,7 +73,7 @@ if(!memolist.len) to_chat(src, "No memos found in database.") return - var/target_ckey = input(src, "Select whose memo to edit", "Select memo") as null|anything in memolist + var/target_ckey = tgui_input_list(src, "Select whose memo to edit", "Select memo", memolist) if(!target_ckey) return var/datum/db_query/query_memofind = SSdbcore.NewQuery({" @@ -87,7 +87,7 @@ if(query_memofind.NextRow()) var/old_memo = query_memofind.item[1] qdel(query_memofind) - var/new_memo = input("Input new memo", "New Memo", "[old_memo]", null) as message + var/new_memo = tgui_input_message(src, "Input new memo", "New Memo", "[old_memo]") if(!new_memo) return var/edit_text = "Edited by [ckey] on [SQLtime()] from
[old_memo]
to
[new_memo]
" @@ -146,7 +146,7 @@ if(!memolist.len) to_chat(src, "No memos found in database.") return - var/target_ckey = input(src, "Select whose mentor memo to delete", "Select mentor memo") as null|anything in memolist + var/target_ckey = tgui_input_list(src, "Select whose mentor memo to delete", "Select mentor memo", memolist) if(!target_ckey) return var/datum/db_query/query_memodel = SSdbcore.NewQuery({" diff --git a/modular_citadel/code/modules/mentor/mentorpm.dm b/modular_citadel/code/modules/mentor/mentorpm.dm index 3260e96767..b99f1cdde1 100644 --- a/modular_citadel/code/modules/mentor/mentorpm.dm +++ b/modular_citadel/code/modules/mentor/mentorpm.dm @@ -10,7 +10,7 @@ targets["[T]"] = T var/list/sorted = sortList(targets) - var/target = input(src,"To whom shall we send a message?","Mentor PM",null) in sorted|null + var/target = tgui_input_list(src,"To whom shall we send a message?","Mentor PM",sorted) cmd_mentor_pm(targets[target],null) SSblackbox.record_feedback("tally", "Mentor_verb", 1, "APM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -36,7 +36,7 @@ //get message text, limit it's length.and clean/escape html if(!msg) - msg = input(src,"Message:", "Private message") as text|null + msg = tgui_input_text(src,"Message:", "Private message") if(!msg) if (is_mentor(whom))