From fb33dc2e7cb8f999fa6054b4686a3dded0b29d5d Mon Sep 17 00:00:00 2001 From: Aylong Date: Tue, 28 Nov 2023 14:03:00 +0200 Subject: [PATCH] More inputs --- code/_onclick/hud/ai_hud.dm | 4 ++-- code/datums/spell_targeting/matter_eater_targeting.dm | 2 +- code/datums/spell_targeting/remoteview_targeting.dm | 2 +- code/datums/spell_targeting/targeted.dm | 2 +- code/datums/spell_targeting/telepathic.dm | 2 +- code/datums/spells/mimic.dm | 2 +- code/datums/spells/shapeshift.dm | 2 +- code/game/gamemodes/cult/blood_magic.dm | 8 ++++---- code/game/gamemodes/cult/cult_items.dm | 2 +- code/game/gamemodes/cult/ritual.dm | 2 +- code/game/gamemodes/cult/runes.dm | 6 +++--- .../miniantags/demons/slaughter demon/slaughter.dm | 2 +- code/game/gamemodes/nuclear/pinpointer.dm | 2 +- code/game/machinery/computer/atmos_controllers.dm | 2 +- code/game/machinery/constructable_frame.dm | 4 ++-- code/game/objects/items/devices/painter/pipe_painter.dm | 4 +++- code/modules/client/preference/link_processing.dm | 4 ++-- code/modules/paperwork/photography.dm | 4 ++-- code/modules/paperwork/silicon_photography.dm | 2 +- code/modules/pda/ai_pda.dm | 2 +- 20 files changed, 31 insertions(+), 29 deletions(-) diff --git a/code/_onclick/hud/ai_hud.dm b/code/_onclick/hud/ai_hud.dm index 63783a04467d..8579060078bf 100644 --- a/code/_onclick/hud/ai_hud.dm +++ b/code/_onclick/hud/ai_hud.dm @@ -16,7 +16,7 @@ /obj/screen/ai/camera_list/Click() var/mob/living/silicon/ai/AI = usr - var/camera = input(AI, "Choose which camera you want to view", "Cameras") as null|anything in AI.get_camera_list() + var/camera = tgui_input_list(AI, "Choose which camera you want to view", "Cameras", AI.get_camera_list()) AI.ai_camera_list(camera) /obj/screen/ai/camera_track @@ -26,7 +26,7 @@ /obj/screen/ai/camera_track/Click() if(isAI(usr)) var/mob/living/silicon/ai/AI = usr - var/target_name = input(AI) as null|anything in AI.trackable_mobs() + var/target_name = tgui_input_list(AI, "Choose a target you want to track", "Tracking", AI.trackable_mobs()) if(target_name) AI.ai_camera_track(target_name) diff --git a/code/datums/spell_targeting/matter_eater_targeting.dm b/code/datums/spell_targeting/matter_eater_targeting.dm index 9a672576d8f1..a9f33c676768 100644 --- a/code/datums/spell_targeting/matter_eater_targeting.dm +++ b/code/datums/spell_targeting/matter_eater_targeting.dm @@ -40,7 +40,7 @@ continue possible_targets += O - var/atom/movable/target = input("Choose the target of your hunger.", "Targeting") as null|anything in possible_targets + var/atom/movable/target = tgui_input_list(user, "Choose the target of your hunger", "Targeting", possible_targets) if(QDELETED(target)) return diff --git a/code/datums/spell_targeting/remoteview_targeting.dm b/code/datums/spell_targeting/remoteview_targeting.dm index f089ba285858..fce68b121810 100644 --- a/code/datums/spell_targeting/remoteview_targeting.dm +++ b/code/datums/spell_targeting/remoteview_targeting.dm @@ -16,7 +16,7 @@ if(!length(remoteviewers)) return - var/mob/target = input("Choose the target to spy on.", "Targeting") as null|anything in remoteviewers + var/mob/target = tgui_input_list(user, "Choose the target to spy on", "Targeting", remoteviewers) if(QDELETED(target)) return diff --git a/code/datums/spell_targeting/targeted.dm b/code/datums/spell_targeting/targeted.dm index 5ff208cf6d4b..7fd1aa23ef52 100644 --- a/code/datums/spell_targeting/targeted.dm +++ b/code/datums/spell_targeting/targeted.dm @@ -25,7 +25,7 @@ else if(max_targets == 1) // Only one target var/atom/target if(!random_target) - target = input("Choose the target for the spell.", "Targeting") as anything in possible_targets + target = tgui_input_list(user, "Choose the target for the spell.", "Targeting", possible_targets) //Adds a safety check post-input to make sure those targets are actually in range. if(target in view_or_range(range, spell_location, selection_type)) targets += target diff --git a/code/datums/spell_targeting/telepathic.dm b/code/datums/spell_targeting/telepathic.dm index 618f9da80ca7..c6458a019118 100644 --- a/code/datums/spell_targeting/telepathic.dm +++ b/code/datums/spell_targeting/telepathic.dm @@ -28,7 +28,7 @@ if(!length(valid_targets)) return - var/target_name = input("Choose the target to listen to.", "Targeting") as null|anything in valid_targets + var/target_name = tgui_input_list(user, "Choose the target to listen to.", "Targeting", valid_targets) var/mob/living/target = valid_targets[target_name] if(QDELETED(target)) diff --git a/code/datums/spells/mimic.dm b/code/datums/spells/mimic.dm index 6fe1fbfb1613..4d807f4baaff 100644 --- a/code/datums/spells/mimic.dm +++ b/code/datums/spells/mimic.dm @@ -94,7 +94,7 @@ forms += "Original Form" forms += available_forms.Copy() - var/what = input(user, "Which form do you want to become?", "Mimic") as null|anything in forms + var/what = tgui_input_list(user, "Which form do you want to become?", "Mimic", forms) if(!what) to_chat(user, "You decide against changing forms.") revert_cast(user) diff --git a/code/datums/spells/shapeshift.dm b/code/datums/spells/shapeshift.dm index 289e0e2c5c34..09d1439e951e 100644 --- a/code/datums/spells/shapeshift.dm +++ b/code/datums/spells/shapeshift.dm @@ -27,7 +27,7 @@ for(var/path in possible_shapes) var/mob/living/simple_animal/A = path animal_list[initial(A.name)] = path - shapeshift_type = input(M, "Choose Your Animal Form!", "It's Morphing Time!", null) as anything in animal_list + shapeshift_type = tgui_input_list(M, "Choose Your Animal Form!", "It's Morphing Time!", animal_list) if(!shapeshift_type) //If you aren't gonna decide I am! shapeshift_type = pick(animal_list) shapeshift_type = animal_list[shapeshift_type] diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm index f9e0b667e653..41a81a2ae2c2 100644 --- a/code/game/gamemodes/cult/blood_magic.dm +++ b/code/game/gamemodes/cult/blood_magic.dm @@ -51,7 +51,7 @@ possible_spells[cult_name] = J if(length(spells)) possible_spells += "(REMOVE SPELL)" - entered_spell_name = input(owner, "Pick a blood spell to prepare...", "Spell Choices") as null|anything in possible_spells + entered_spell_name = tgui_input_list(owner, "Pick a blood spell to prepare...", "Spell Choices", possible_spells) if(entered_spell_name == "(REMOVE SPELL)") remove_spell() return @@ -80,8 +80,8 @@ SSblackbox.record_feedback("tally", "cult_spells_prepared", 1, "[new_spell.name]") channeling = FALSE -/datum/action/innate/cult/blood_magic/proc/remove_spell(message = "Pick a spell to remove.") - var/nullify_spell = input(owner, message, "Current Spells") as null|anything in spells +/datum/action/innate/cult/blood_magic/proc/remove_spell() + var/nullify_spell = tgui_input_list(owner, "Pick a spell to remove", "Current Spells", spells) if(nullify_spell) qdel(nullify_spell) @@ -518,7 +518,7 @@ log_game("Teleport spell failed - user in away mission") return - var/input_rune_key = input(user, "Choose a rune to teleport to.", "Rune to Teleport to") as null|anything in potential_runes //we know what key they picked + var/input_rune_key = tgui_input_list(user, "Choose a rune to teleport to", "Rune to Teleport to", potential_runes) //we know what key they picked var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to? if(QDELETED(src) || !user || user.l_hand != src && user.r_hand != src || user.incapacitated() || !actual_selected_rune) return diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 084ff4419573..ee9c00bfb532 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -782,7 +782,7 @@ to_chat(user, "You are not in the right dimension!") return - var/input_rune_key = input(user, "Choose a rune to make a portal to.", "Rune to make a portal to") as null|anything in potential_runes //we know what key they picked + var/input_rune_key = tgui_input_list(user, "Choose a rune to make a portal to", "Rune to make a portal to", potential_runes) //we know what key they picked var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to? if(QDELETED(R) || QDELETED(actual_selected_rune) || !Adjacent(user) || user.incapacitated()) return diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index cea7205c4125..f9690f5c683a 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -116,7 +116,7 @@ if(!length(possible_runes)) return - var/chosen_rune = input(user, "Choose a rite to scribe.", "Sigils of Power") as null|anything in possible_runes + var/chosen_rune = tgui_input_list(user, "Choose a rite to scribe.", "Sigils of Power", possible_runes) if(!chosen_rune) return var/obj/effect/rune/rune = possible_runes[chosen_rune] diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 925378fff65b..b7731ccc775b 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -490,7 +490,7 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() return - var/input_rune_key = input(user, "Choose a rune to teleport to.", "Rune to Teleport to") as null|anything in potential_runes //we know what key they picked + var/input_rune_key = tgui_input_list(user, "Choose a rune to teleport to.", "Rune to Teleport to", potential_runes) //we know what key they picked var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to? if(QDELETED(src) || QDELETED(actual_selected_rune) ||!Adjacent(user) || user.incapacitated()) fail_invoke() @@ -632,7 +632,7 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() return if(length(potential_revive_mobs) > 1) - mob_to_revive = input(user, "Choose a cultist to revive.", "Cultist to Revive") as null|anything in potential_revive_mobs + mob_to_revive = tgui_input_list(user, "Choose a cultist to revive.", "Cultist to Revive", potential_revive_mobs) else // If there's only one, no need for a menu mob_to_revive = potential_revive_mobs[1] if(!validness_checks(mob_to_revive, user)) @@ -756,7 +756,7 @@ structure_check() searches for nearby cultist structures required for the invoca for(var/datum/mind/M in SSticker.mode.cult) if(!(M.current in invokers) && M.current && M.current.stat != DEAD) cultists[M.current.real_name] = M.current - var/input = input(user, "Who do you wish to call to [src]?", "Acolytes") as null|anything in cultists + var/input = tgui_input_list(user, "Who do you wish to call to [src]?", "Acolytes", cultists) var/mob/living/cultist_to_summon = cultists[input] if(QDELETED(src) || !Adjacent(user) || user.incapacitated()) return diff --git a/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm b/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm index 73f0e1de4989..573a2a5d92e0 100644 --- a/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm +++ b/code/game/gamemodes/miniantags/demons/slaughter demon/slaughter.dm @@ -185,7 +185,7 @@ to_chat(usr, "There are no valid targets!") return - var/mob/living/target = input("Choose the target to talk to.", "Targeting") as null|mob in validtargets + var/mob/living/target = tgui_input_list(user, "Choose the target to talk to.", "Targeting", validtargets) return target /datum/action/innate/demon/whisper/Activate() diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index de0df0602afc..5e478757e797 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -220,7 +220,7 @@ var/name = initial(T.name) item_names += name item_paths[name] = initial(T.typepath) - var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in item_names + var/targetitem = tgui_input_list(user, "Select item to search for", "Select Item", item_names) if(!targetitem) return diff --git a/code/game/machinery/computer/atmos_controllers.dm b/code/game/machinery/computer/atmos_controllers.dm index 6ff44df86905..b674b48e10e0 100644 --- a/code/game/machinery/computer/atmos_controllers.dm +++ b/code/game/machinery/computer/atmos_controllers.dm @@ -70,7 +70,7 @@ GLOBAL_LIST_EMPTY(gas_sensors) "-SAVE TO BUFFER-" = "multitool" ) - var/temp_answer = input(user, "Select an option to adjust", "Options!", null) as null|anything in options + var/temp_answer = tgui_input_list(user, "Select an option to adjust", "Options!", options) if(!Adjacent(user)) break diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index d35d03c84cda..558c13a5bef1 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -289,7 +289,7 @@ to destroy them and players will be able to make replacements. . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - var/choice = input(user, "Choose a new brand", "Select an Item") as null|anything in station_vendors + var/choice = tgui_input_list(user, "Choose a new brand", "Select an Item", station_vendors) if(!choice) return set_type(choice) @@ -569,7 +569,7 @@ to destroy them and players will be able to make replacements. . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - var/choice = input(user, "Circuit Setting", "What would you change the board setting to?") as null|anything in fridge_names_paths + var/choice = tgui_input_list(user, "Circuit Setting", "What would you change the board setting to?", fridge_names_paths) if(!choice) return set_type(user, choice) diff --git a/code/game/objects/items/devices/painter/pipe_painter.dm b/code/game/objects/items/devices/painter/pipe_painter.dm index 5514d3865393..8eecf74a6da5 100644 --- a/code/game/objects/items/devices/painter/pipe_painter.dm +++ b/code/game/objects/items/devices/painter/pipe_painter.dm @@ -12,7 +12,9 @@ paint_setting = pick(modes) /datum/painter/pipe/pick_color(mob/user) - paint_setting = tgui_input_list(user, "Which color do you want to use?", "Pick color", paint_setting) + paint_setting = tgui_input_list(user, "Which color do you want to use?", "Pick color", modes) + if(!paint_setting) + return /datum/painter/pipe/paint_atom(atom/target, mob/user) if(!istype(target, /obj/machinery/atmospherics/pipe)) diff --git a/code/modules/client/preference/link_processing.dm b/code/modules/client/preference/link_processing.dm index e9e736557b3a..8f3b1dc2bca1 100644 --- a/code/modules/client/preference/link_processing.dm +++ b/code/modules/client/preference/link_processing.dm @@ -223,7 +223,7 @@ if(can_use_species(user, _species)) new_species += _species - active_character.species = tgui_input_list(user, "Please select a species", "Character Generation", new_species) + active_character.species = tgui_input_list(user, "Please select a species", "Character Generation", sortList(new_species)) if(!active_character.species) return var/datum/species/NS = GLOB.all_species[active_character.species] @@ -311,7 +311,7 @@ if(!(lang.flags & RESTRICTED)) new_languages += lang.name - active_character.language = tgui_input_list(user, "Please select a secondary language", "Character Generation", new_languages) + active_character.language = tgui_input_list(user, "Please select a secondary language", "Character Generation", sortList(new_languages)) if(!active_character.language) return diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index b19c765dd045..6092fc9f093a 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -536,7 +536,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor return var/datum/picture/picture - picture = input("Select image to print:", picture) as null|anything in saved_pictures + picture = tgui_input_list(user, "Select image to print", "Print image", saved_pictures) if(picture) printpicture(user, picture) pictures_left -- @@ -549,7 +549,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor to_chat(user, "No images saved") return var/datum/picture/picture - picture = input("Select image to delete:", picture) as null|anything in saved_pictures + picture = tgui_input_list(user, "Select image to delete", "Delete image", saved_pictures) if(picture) saved_pictures -= picture diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm index e5231da3746d..7f2d6106a409 100644 --- a/code/modules/paperwork/silicon_photography.dm +++ b/code/modules/paperwork/silicon_photography.dm @@ -47,7 +47,7 @@ return for(var/datum/picture/t in cam.aipictures) nametemp += t.fields["name"] - find = input("Select image (numbered in order taken)") in nametemp + find = tgui_input_list(usr, "Select image (numbered in order taken)", "Pick Image", nametemp) for(var/datum/picture/q in cam.aipictures) if(q.fields["name"] == find) diff --git a/code/modules/pda/ai_pda.dm b/code/modules/pda/ai_pda.dm index caebaa35e917..dc67d5f29089 100644 --- a/code/modules/pda/ai_pda.dm +++ b/code/modules/pda/ai_pda.dm @@ -25,7 +25,7 @@ to_chat(usr, "Cannot use messenger!") var/list/plist = M.available_pdas() if(plist) - var/c = input(usr, "Please select a PDA") as null|anything in sortList(plist) + var/c = tgui_input_list(usr, "Please select a PDA", "Send message", sortList(plist)) if(!c) // if the user hasn't selected a PDA file we can't send a message return var/selected = plist[c]