Skip to content

Commit

Permalink
More inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong committed Nov 28, 2023
1 parent 64b773e commit fb33dc2
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 29 deletions.
4 changes: 2 additions & 2 deletions code/_onclick/hud/ai_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion code/datums/spell_targeting/matter_eater_targeting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spell_targeting/remoteview_targeting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spell_targeting/targeted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spell_targeting/telepathic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/mimic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='notice'>You decide against changing forms.</span>")
revert_cast(user)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/shapeshift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions code/game/gamemodes/cult/blood_magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/cult_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@
to_chat(user, "<span class='cultitalic'>You are not in the right dimension!</span>")
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
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/ritual.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
to_chat(usr, "<span class='warning'>There are no valid targets!</span>")
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()
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/nuclear/pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/atmos_controllers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/constructable_frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/devices/painter/pipe_painter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/client/preference/link_processing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions code/modules/paperwork/photography.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 --
Expand All @@ -549,7 +549,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
to_chat(user, "<span class='userdanger'>No images saved</span>")
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

Expand Down
2 changes: 1 addition & 1 deletion code/modules/paperwork/silicon_photography.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/pda/ai_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
to_chat(usr, "<span class='warning'>Cannot use messenger!</span>")
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]
Expand Down

0 comments on commit fb33dc2

Please sign in to comment.