Converts over the missing TGUI input lists (#23859)

* Converts over the missing TGUI input lists

* last fixes

* num revert
This commit is contained in:
GDN
2024-02-14 15:17:29 -06:00
committed by GitHub
parent 8f9035d1ed
commit 82b863cefd
54 changed files with 167 additions and 168 deletions

View File

@@ -125,8 +125,8 @@
poll_icon = image(icon = 'icons/mob/robots.dmi', icon_state = "syndi-engi-preview")
/obj/item/antag_spawner/nuke_ops/borg_tele/before_candidate_search(mob/user)
var/switch_roles_choice = input("Would you like to continue playing as an operative or take over as the cyborg? If you play as the cyborg, another player will control your old self.", "Play As") as null|anything in list("Nuclear Operative", "Syndicate Cyborg")
if(!switch_roles_choice || !(check_usability(user)))
var/switch_roles_choice = tgui_input_list(user, "Would you like to continue playing as an operative or take over as the cyborg? If you play as the cyborg, another player will control your old self.", "Play As", list("Nuclear Operative", "Syndicate Cyborg", "Don't activate this Cyborg Teleporter"))
if(!switch_roles_choice || !(check_usability(user)) || switch_roles_choice == "Don't activate this Cyborg Teleporter")
return FALSE
if(switch_roles_choice == "Syndicate Cyborg")

View File

@@ -288,7 +288,7 @@
for(var/mob/living/carbon/human/H as anything in targets)
targets_by_name[H.real_name] = H
var/target_name = input(user, "Person to Locate", "Blood Stench") in targets_by_name
var/target_name = tgui_input_list(user, "Person to Locate", "Blood Stench", targets_by_name)
if(!target_name)
return
var/mob/living/carbon/human/target = targets_by_name[target_name]

View File

@@ -140,7 +140,9 @@
to_chat(user, "<span class='notice'>Open the maintenance panel first.</span>")
return
var/list/choices = list("West" = WEST, "East" = EAST, "South" = SOUTH, "North" = NORTH)
var/selected = input(user,"Select a direction for the connector.", "Connector Direction") in choices
var/selected = tgui_input_list(user, "Select a direction for the connector.", "Connector Direction", choices)
if(!selected)
return
dir = choices[selected]
var/node_connect = dir
initialize_directions = dir

View File

@@ -46,7 +46,7 @@
var/ghost_role = alert("Become [mob_name]? (Warning, You can no longer be cloned!)",,"Yes","No")
if(ghost_role == "No")
return
if(!species_prompt())
if(!species_prompt(user))
return
if(!loc || !uses && !permanent || QDELETED(src) || QDELETED(user))
to_chat(user, "<span class='warning'>The [name] is no longer usable!</span>")
@@ -219,9 +219,9 @@
mob_name = id_job
return ..()
/obj/effect/mob_spawn/human/species_prompt()
/obj/effect/mob_spawn/human/species_prompt(mob/user)
if(allow_species_pick)
var/selected_species = input("Select a species", "Species Selection") as null|anything in pickable_species
var/selected_species = tgui_input_list(user, "Select a species", "Species Selection", pickable_species)
if(!selected_species)
return TRUE // You didn't pick, so just continue on with the spawning process as a human
var/datum/species/S = GLOB.all_species[selected_species]

View File

@@ -313,14 +313,15 @@
return
var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon")
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
var/switchMode = tgui_input_list(user, "Select a sensor mode:", "Suit Sensor Mode", modes)
if(!user.Adjacent(src))
to_chat(user, "<span class='warning'>You have moved too far away!</span>")
return
if(!ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
to_chat(user, "<span class='warning'>You can't use your hands!</span>")
return
if(!switchMode)
return
sensor_mode = modes.Find(switchMode) - 1
if(loc == user)

View File

@@ -27,7 +27,7 @@
for(var/i = 1; i <= GLOB.blob_nodes.len; i++)
var/obj/structure/blob/node/B = GLOB.blob_nodes[i]
nodes["Blob Node #[i] ([get_location_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)
src.loc = chosen_node.loc
@@ -414,7 +414,6 @@
for(var/mob/living/simple_animal/hostile/blob_minion in blob_mobs)
if(blob_minion.stat == CONSCIOUS)
blob_minion.say(speak_text)
return
/mob/camera/blob/verb/create_storage()
set category = "Blob"

View File

@@ -515,8 +515,8 @@
/obj/item/pizzabox/pizza_bomb/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters) && primed)
to_chat(user, "<span class='danger'>Oh God, what wire do you cut?!</span>")
var/chosen_wire = input(user, "OH GOD OH GOD", "WHAT WIRE?!") in wires
if(!in_range(src, user) || issilicon(usr) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || user.restrained())
var/chosen_wire = tgui_input_list(user, "OH GOD OH GOD", "WHAT WIRE?!", wires)
if(!in_range(src, user) || issilicon(usr) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || user.restrained() || !chosen_wire)
return
playsound(src, I.usesound, 50, 1, 1)
user.visible_message("<span class='warning'>[user] cuts the [chosen_wire] wire!</span>", "<span class='danger'>You cut the [chosen_wire] wire!</span>")

View File

@@ -23,7 +23,7 @@
else
var/obj/item/F = I
var/obj/item/food/snacks/customizable/C
C = input("Select food to make.", "Cooking", C) in food_choices
C = tgui_input_list(user, "Select food to make.", "Cooking", food_choices)
if(!C)
return
else

View File

@@ -123,7 +123,9 @@
areaindex[tmpname] = 1
L[tmpname] = R
var/desc = input("Please select a location to target.", "Flare Target Interface") in L
var/desc = tgui_input_list(user, "Please select a location to target.", "Flare Target Interface", L)
if(!desc)
return
destination = L[desc]
/obj/item/wormhole_jaunter/contractor/attack_self(mob/user) // message is later down

View File

@@ -415,7 +415,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!isobserver(usr))
to_chat(usr, "Not when you're not dead!")
return
var/target = input("Area to teleport to", "Teleport to a location") as null|anything in SSmapping.ghostteleportlocs
var/target = tgui_input_list(usr, "Area to teleport to", "Teleport to a location", SSmapping.ghostteleportlocs)
teleport(SSmapping.ghostteleportlocs[target])
/mob/dead/observer/proc/jump_to_ruin()

View File

@@ -1487,7 +1487,9 @@
return
var/turf/origin = T
var/direction = input(src,"Which way?","Tile selection") as anything in list("Here","North","South","East","West")
var/direction = tgui_input_list(src, "Which direction?", "Tile selection", list("Here", "North", "South", "East", "West"))
if(!direction)
return
if(direction != "Here")
T = get_step(T,text2dir(direction))
if(!istype(T))

View File

@@ -1,7 +1,7 @@
/mob/living/verb/set_default_language(language as null|anything in languages)
/mob/living/verb/set_default_language()
set name = "Set Default Language"
set category = "IC"
var/language = tgui_input_list(src, "Your current default language is: [default_language]", "Set your default language", languages)
if(language)
to_chat(src, "<span class='notice'>You will now speak [language] if you do not specify a language when speaking.</span>")
else
@@ -9,14 +9,12 @@
default_language = language
// Silicons can't neccessarily speak everything in their languages list
/mob/living/silicon/set_default_language(language as null|anything in speech_synthesizer_langs)
..()
/mob/living/verb/check_default_language()
set name = "Check Default Language"
/mob/living/silicon/set_default_language()
set name = "Set Default Language"
set category = "IC"
if(default_language)
to_chat(src, "<span class='notice'>You are currently speaking [default_language] by default.</span>")
var/language = tgui_input_list(src, "Your current default language is: [default_language]", "Set your default language", speech_synthesizer_langs)
if(language)
to_chat(src, "<span class='notice'>You will now speak [language] if you do not specify a language when speaking.</span>")
else
to_chat(src, "<span class='notice'>Your current default language is your species or mob type default.</span>")
to_chat(src, "<span class='notice'>You will now speak whatever your standard default language is if you do not specify one when speaking.</span>")
default_language = language

View File

@@ -447,7 +447,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
//if(icon_state == initial(icon_state))
var/icontype = ""
icontype = input("Select an icon!", "AI", null, null) in display_choices
icontype = tgui_input_list(usr, "Select an icon!", "AI", display_choices)
icon = 'icons/mob/ai.dmi' //reset this in case we were on a custom sprite and want to change to a standard one
switch(icontype)
if("Custom")
@@ -968,7 +968,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
return
var/list/ai_emotions = list("Very Happy", "Happy", "Neutral", "Unsure", "Confused", "Sad", "BSOD", "Blank", "Problems?", "Awesome", "Facepalm", "Friend Computer")
var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions
var/emote = tgui_input_list(usr, "Please, select a status!", "AI Status", ai_emotions)
if(check_unable())
return

View File

@@ -29,18 +29,18 @@
// Copied over from paper's rename verb
// see code\modules\paperwork\paper.dm line 62
/obj/item/pen/multi/robopen/proc/RenamePaper(mob/user as mob,obj/paper as obj)
/obj/item/pen/multi/robopen/proc/RenamePaper(mob/user, obj/paper)
if(!user || !paper)
return
var/n_name = input(user, "What would you like to label the paper?", "Paper Labelling", null) as text
var/n_name = input(user, "What would you like to label the paper?", "Paper Labelling") as text
if(!user || !paper)
return
n_name = copytext(n_name, 1, 32)
if(( get_dist(user,paper) <= 1 && user.stat == 0))
paper.name = "paper[(n_name ? "- '[n_name]'" : null)]"
if(get_dist(user, paper) > 1 || user.stat)
return
paper.name = "paper[(n_name ? "- '[n_name]'" : null)]"
add_fingerprint(user)
return
//TODO: Add prewritten forms to dispense when you work out a good way to store the strings.
/obj/item/form_printer

View File

@@ -337,7 +337,7 @@
set desc = "Sets a description which will be shown when someone examines you."
set category = "IC"
pose = sanitize(copytext(input(usr, "This is [src]. It...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
pose = sanitize(copytext(input(usr, "This is [src]. It...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
/mob/living/silicon/verb/set_flavor()
set name = "Set Flavour Text"

View File

@@ -238,7 +238,7 @@
if(mode == BOT_IDLE || mode == BOT_DELIVER)
start_home()
if("destination")
var/new_dest = input(usr, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags
var/new_dest = tgui_input_list(usr, "Enter Destination:", name, GLOB.deliverybeacontags)
if(new_dest)
set_destination(new_dest)
if("setid")
@@ -246,7 +246,7 @@
if(new_id)
set_suffix(new_id)
if("sethome")
var/new_home = input(usr, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags
var/new_home = tgui_input_list(usr, "Enter Home:", name, GLOB.deliverybeacontags)
if(new_home)
home_destination = new_home
if("unload")
@@ -779,7 +779,7 @@
unload(0)
if("target")
var/dest = input("Select Bot Destination", "Mulebot [suffix] Interlink", destination) as null|anything in GLOB.deliverybeacontags
var/dest = tgui_input_list(user, "Select Bot Destination", "Mulebot [suffix] Interlink", GLOB.deliverybeacontags)
if(dest)
set_destination(dest)

View File

@@ -127,11 +127,11 @@
continue
choices += H
if(!choices.len)
if(!length(choices))
to_chat(src, "<span class='warning'>No suitable diona nearby.</span>")
return FALSE
var/mob/living/M = input(src,"Who do you wish to merge with?") in null|choices
var/mob/living/M = tgui_input_list(src, "Who do you wish to merge with?", "Nymph Merging", choices)
if(!M || !src || !(Adjacent(M)) || stat != CONSCIOUS) //input can take a while, so re-validate
return FALSE
@@ -232,11 +232,11 @@
if(Adjacent(H) && H.dna && !(NO_BLOOD in H.dna.species.species_traits))
choices += H
if(!choices.len)
if(!length(choices))
to_chat(src, "<span class='warning'>No suitable blood donors nearby.</span>")
return FALSE
var/mob/living/carbon/human/M = input(src,"Who do you wish to take a sample from?") in null|choices
var/mob/living/carbon/human/M = tgui_input_list(src, "Who do you wish to take a sample from?", "Blood Sampling", choices)
if(!M || !src || !(Adjacent(M)) || stat != CONSCIOUS) //input can take a while, so re-validate
return FALSE

View File

@@ -223,7 +223,7 @@
if(Adjacent(O))
choices += O
if(length(choices))
cocoon_target = input(src,"What do you wish to cocoon?") in null|choices
cocoon_target = tgui_input_list(src, "What do you wish to cocoon?", "Cocoon Wrapping", choices)
else
to_chat(src, "<span class='warning'>No suitable dead prey or wrappable objects found nearby.")
return

View File

@@ -241,8 +241,8 @@
if(Adjacent(O) && !O.anchored)
if(!istype(O, /obj/structure/spider))
choices += O
if(choices.len)
cocoon_target = input(src,"What do you wish to cocoon?") in null|choices
if(length(choices))
cocoon_target = tgui_input_list(src, "What do you wish to cocoon?", "Cocoon Selection", choices)
else
to_chat(src, "<span class='danger'>There is nothing nearby you can wrap.</span>")

View File

@@ -49,7 +49,7 @@
queeneggs_action.button.name = "Empress Eggs"
/mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/LayQueenEggs()
var/eggtype = input("What kind of eggs?") as null|anything in list(TS_DESC_QUEEN, TS_DESC_MOTHER, TS_DESC_PRINCE, TS_DESC_PRINCESS, TS_DESC_RED, TS_DESC_GRAY, TS_DESC_GREEN, TS_DESC_BLACK, TS_DESC_PURPLE, TS_DESC_WHITE, TS_DESC_BROWN)
var/eggtype = tgui_input_list(src, "What kind of eggs?", "Egg laying", list(TS_DESC_QUEEN, TS_DESC_MOTHER, TS_DESC_PRINCE, TS_DESC_PRINCESS, TS_DESC_RED, TS_DESC_GRAY, TS_DESC_GREEN, TS_DESC_BLACK, TS_DESC_PURPLE, TS_DESC_WHITE, TS_DESC_BROWN))
var/numlings = input("How many in the batch?") as null|anything in list(1, 2, 3, 4, 5, 10, 15, 20, 30, 40, 50)
if(eggtype == null || numlings == null)
to_chat(src, "<span class='danger'>Cancelled.</span>")

View File

@@ -48,10 +48,10 @@
eggtypes += TS_DESC_BLACK
var/eggtype = pick(eggtypes)
if(client)
eggtype = input("What kind of eggs?") as null|anything in eggtypes
eggtype = tgui_input_list(src, "What kind of eggs?", "Egg Laying", eggtypes)
if(!(eggtype in eggtypes))
to_chat(src, "<span class='danger'>Unrecognized egg type.</span>")
return 0
return FALSE
if(!isturf(loc))
// This has to be checked after we ask the user what egg type. Otherwise they could trigger prompt THEN move into a vent.
to_chat(src, "<span class='danger'>Eggs can only be laid while standing on a floor.</span>")

View File

@@ -255,14 +255,14 @@
var/list/eggtypes = ListAvailableEggTypes()
var/list/eggtypes_uncapped = list(TS_DESC_RED, TS_DESC_GRAY, TS_DESC_GREEN)
var/eggtype = input("What kind of eggs?") as null|anything in eggtypes
var/eggtype = tgui_input_list(src, "What kind of eggs?", "Laying Eggs", eggtypes)
if(canlay < 1)
// this was checked before input() but we have to check again to prevent them spam-clicking the popup.
to_chat(src, "<span class='danger'>Too soon to lay another egg.</span>")
return
if(!(eggtype in eggtypes))
to_chat(src, "<span class='danger'>Unrecognized egg type.</span>")
return 0
return FALSE
// Multiple of eggtypes_uncapped can be laid at once. Other types must be laid one at a time (to prevent exploits)
var/numlings = 1

View File

@@ -459,7 +459,7 @@ GLOBAL_LIST_EMPTY(ts_infected_list)
if(T.stat == DEAD)
continue
targets |= T // we use |= instead of += to avoid adding src to the list twice
var/mob/living/L = input("Choose a terror to watch.", "Selection") in targets
var/mob/living/L = tgui_input_list(src, "Choose a terror to watch.", "Brood Viewing", targets)
if(istype(L))
reset_perspective(L)

View File

@@ -29,12 +29,12 @@
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?", "Feeding Selection", choices)
if(!M)
return 0
return FALSE
if(CanFeedon(M))
Feedon(M)
return 1
return TRUE
/datum/action/innate/slime/feed
name = "Feed"

View File

@@ -885,7 +885,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
var/eye_name = null
var/ok = "[is_admin ? "Admin Observe" : "Observe"]"
eye_name = input("Please, select a player!", ok, null, null) as null|anything in creatures
eye_name = tgui_input_list(usr, "Please, select a player!", ok, creatures)
if(!eye_name)
return

View File

@@ -41,7 +41,7 @@
/obj/item/photo/attackby(obj/item/P as obj, mob/user as mob, params)
if(is_pen(P) || istype(P, /obj/item/toy/crayon))
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
txt = copytext(txt, 1, 128)
if(loc == user && user.stat == 0)
scribble = txt

View File

@@ -14,7 +14,7 @@
teleport_target = null
return ..()
/obj/item/gun/energy/telegun/attack_self(mob/living/user as mob)
/obj/item/gun/energy/telegun/attack_self(mob/living/user)
var/list/L = list()
var/list/areaindex = list()
@@ -34,7 +34,9 @@
areaindex[tmpname] = 1
L[tmpname] = R
var/desc = input("Please select a location to lock in.", "Telegun Target Interface") in L
var/desc = tgui_input_list(user, "Please select a location to lock in.", "Telegun Target Selection", L)
if(!desc)
return
teleport_target = L[desc]
to_chat(user, "<span class='notice'>The [src] is now set to [desc].</span>")
//Process the shot without draining the cell

View File

@@ -133,7 +133,7 @@
/obj/item/gun/throw/crossbow/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
var/choice = input("Select tension to draw to:", "[src]", XBOW_TENSION_FULL) as null|anything in possible_tensions
var/choice = tgui_input_list(user, "Select tension to draw to:", "[src]", possible_tensions)
if(!choice)
return

View File

@@ -18,11 +18,7 @@
/obj/item/reagent_containers/AltClick(mob/user)
if(!Adjacent(user) || !length(possible_transfer_amounts) || !ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return
var/default = null
if(amount_per_transfer_from_this in possible_transfer_amounts)
default = amount_per_transfer_from_this
var/new_transfer_rate = input("Amount per transfer from this:", "[src]", default) as null|anything in possible_transfer_amounts
var/new_transfer_rate = tgui_input_list(user, "Amount per transfer from this:", "[src]", possible_transfer_amounts)
if(!new_transfer_rate)
return

View File

@@ -301,7 +301,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
break
if(!pointless)
var/choice = input("This item does not raise tech levels. Proceed destroying loaded item anyway?") in list("Proceed", "Cancel")
var/choice = alert(user, "This item does not raise tech levels. Proceed destroying loaded item anyway?", "Are you sure you want to destroy this item?", "Proceed", "Cancel")
if(choice == "Cancel" || !linked_destroy)
return

View File

@@ -33,7 +33,9 @@
/obj/item/assault_pod/attack_self(mob/living/user)
var/target_area
target_area = input("Area to land", "Select a Landing Zone", target_area) in SSmapping.teleportlocs
target_area = tgui_input_list(user, "Area to land", "Select a Landing Zone", SSmapping.teleportlocs)
if(!target_area)
return
var/area/picked_area = SSmapping.teleportlocs[target_area]
if(!src || QDELETED(src))
return