diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index fe812773023..8d663fd4da4 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -300,18 +300,18 @@
/proc/ionnum()
return "[pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")]"
-//When an AI is activated, it can choose from a list of non-slaved borgs to have as a slave.
-/proc/freeborg()
+// Selects an unlinked borg, used in the robot upload console
+/proc/freeborg(mob/user)
var/select
var/list/borgs = list()
for(var/mob/living/silicon/robot/A in GLOB.player_list)
- if(A.stat == 2 || A.connected_ai || A.scrambledcodes || isdrone(A))
+ if(A.stat == DEAD || A.connected_ai || A.scrambledcodes || isdrone(A))
continue
var/name = "[A.real_name] ([A.modtype] [A.braintype])"
borgs[name] = A
if(length(borgs))
- select = input("Unshackled borg signals detected:", "Borg selection", null, null) as null|anything in borgs
+ select = tgui_input_list(user, "Unshackled borg signals detected:", "Borg selection", borgs)
return borgs[select]
//When a borg is activated, it can choose which AI it wants to be slaved to
@@ -338,10 +338,12 @@
/proc/select_active_ai(mob/user)
var/list/ais = active_ais()
- if(length(ais))
- if(user) . = input(usr,"AI signals detected:", "AI selection") in ais
- else . = pick(ais)
- return .
+ if(!length(ais))
+ return
+ if(user)
+ return tgui_input_list(user, "AI signals detected:", "AI selection", ais)
+ else
+ return pick(ais)
/proc/get_sorted_mobs()
var/list/old_list = getmobs()
diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm
index a4d72d5d1d0..ba04088fe7a 100644
--- a/code/_onclick/hud/alert.dm
+++ b/code/_onclick/hud/alert.dm
@@ -428,7 +428,7 @@ Recharging stations are available in robotics, the dormitory bathrooms, and the
var/mob/living/simple_animal/diona/D = nymphs[1]
D.split(TRUE)
else
- var/mob/living/simple_animal/diona/D = input("Select a nymph to drop:", "Nymph Dropping", nymphs[1]) as anything in nymphs
+ var/mob/living/simple_animal/diona/D = tgui_input_list(usr, "Select a nymph to drop:", "Nymph Dropping", nymphs)
if(D in usr.contents)
D.split(TRUE)
diff --git a/code/datums/spells/area_teleport.dm b/code/datums/spells/area_teleport.dm
index 80ad56996f8..60502ffbe86 100644
--- a/code/datums/spells/area_teleport.dm
+++ b/code/datums/spells/area_teleport.dm
@@ -11,18 +11,18 @@
/obj/effect/proc_holder/spell/area_teleport/before_cast(list/targets, mob/user)
..()
selected_area = null // Reset it
- var/A
+ var/area_name
if(!randomise_selection)
- A = input("Area to teleport to", "Teleport", A) as null|anything in SSmapping.teleportlocs
+ area_name = tgui_input_list(user, "Area to teleport to", "Teleport", SSmapping.teleportlocs)
else
- A = pick(SSmapping.teleportlocs)
+ area_name = pick(SSmapping.teleportlocs)
- if(!A)
+ if(!area_name)
smoke_type = SMOKE_NONE
return
- var/area/thearea = SSmapping.teleportlocs[A]
+ var/area/thearea = SSmapping.teleportlocs[area_name]
if(thearea.tele_proof && !istype(thearea, /area/wizard_station))
to_chat(user, "A mysterious force disrupts your arcane spell matrix, and you remain where you are.")
diff --git a/code/game/dna/mutations/mutation_powers.dm b/code/game/dna/mutations/mutation_powers.dm
index 346e1f68b3f..2f8cb14e015 100644
--- a/code/game/dna/mutations/mutation_powers.dm
+++ b/code/game/dna/mutations/mutation_powers.dm
@@ -750,13 +750,13 @@
//Alt heads.
if(head_organ.dna.species.bodyflags & HAS_ALT_HEADS)
var/list/valid_alt_heads = M.generate_valid_alt_heads()
- var/new_alt_head = input("Please select alternate head", "Character Generation", head_organ.alt_head) as null|anything in valid_alt_heads
+ var/new_alt_head = tgui_input_list(user, "Please select alternate head", "Character Generation", valid_alt_heads)
if(new_alt_head)
M.change_alt_head(new_alt_head)
// hair
var/list/valid_hairstyles = M.generate_valid_hairstyles()
- var/new_style = input("Please select hair style", "Character Generation", head_organ.h_style) as null|anything in valid_hairstyles
+ var/new_style = tgui_input_list(user, "Please select hair style", "Character Generation", valid_hairstyles)
// if new style selected (not cancel)
if(new_style)
@@ -774,7 +774,7 @@
// facial hair
var/list/valid_facial_hairstyles = M.generate_valid_facial_hairstyles()
- new_style = input("Please select facial style", "Character Generation", head_organ.f_style) as null|anything in valid_facial_hairstyles
+ new_style = tgui_input_list(user, "Please select facial style", "Character Generation", valid_facial_hairstyles)
if(new_style)
M.change_facial_hair(new_style)
@@ -792,7 +792,7 @@
//Head accessory.
if(head_organ.dna.species.bodyflags & HAS_HEAD_ACCESSORY)
var/list/valid_head_accessories = M.generate_valid_head_accessories()
- var/new_head_accessory = input("Please select head accessory style", "Character Generation", head_organ.ha_style) as null|anything in valid_head_accessories
+ var/new_head_accessory = tgui_input_list(user, "Please select head accessory style", "Character Generation", valid_head_accessories)
if(new_head_accessory)
M.change_head_accessory(new_head_accessory)
@@ -804,8 +804,8 @@
//Body accessory.
if((M.dna.species.tail && M.dna.species.bodyflags & (HAS_TAIL)) || (M.dna.species.wing && M.dna.species.bodyflags & (HAS_WING)))
var/list/valid_body_accessories = M.generate_valid_body_accessories()
- if(valid_body_accessories.len > 1) //By default valid_body_accessories will always have at the very least a 'none' entry populating the list, even if the user's species is not present in any of the list items.
- var/new_body_accessory = input("Please select body accessory style", "Character Generation", M.body_accessory) as null|anything in valid_body_accessories
+ if(length(valid_body_accessories) > 1) //By default valid_body_accessories will always have at the very least a 'none' entry populating the list, even if the user's species is not present in any of the list items.
+ var/new_body_accessory = tgui_input_list(user, "Please select body accessory style", "Character Generation", valid_body_accessories)
if(new_body_accessory)
M.change_body_accessory(new_body_accessory)
@@ -813,7 +813,7 @@
//Head markings.
if(M.dna.species.bodyflags & HAS_HEAD_MARKINGS)
var/list/valid_head_markings = M.generate_valid_markings("head")
- var/new_marking = input("Please select head marking style", "Character Generation", M.m_styles["head"]) as null|anything in valid_head_markings
+ var/new_marking = tgui_input_list(user, "Please select head marking style", "Character Generation", valid_head_markings)
if(new_marking)
M.change_markings(new_marking, "head")
@@ -824,7 +824,7 @@
//Body markings.
if(M.dna.species.bodyflags & HAS_BODY_MARKINGS)
var/list/valid_body_markings = M.generate_valid_markings("body")
- var/new_marking = input("Please select body marking style", "Character Generation", M.m_styles["body"]) as null|anything in valid_body_markings
+ var/new_marking = tgui_input_list(user, "Please select body marking style", "Character Generation", valid_body_markings)
if(new_marking)
M.change_markings(new_marking, "body")
@@ -834,7 +834,7 @@
//Tail markings.
if(M.dna.species.bodyflags & HAS_TAIL_MARKINGS)
var/list/valid_tail_markings = M.generate_valid_markings("tail")
- var/new_marking = input("Please select tail marking style", "Character Generation", M.m_styles["tail"]) as null|anything in valid_tail_markings
+ var/new_marking = tgui_input_list("Please select tail marking style", "Character Generation", valid_tail_markings)
if(new_marking)
M.change_markings(new_marking, "tail")
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm
index 63b4626aee6..d4aac9db269 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm
@@ -126,7 +126,7 @@
if(!target || !iscarbon(owner))
return
var/obj/machinery/abductor/console/console = target
- console.SelectDisguise(remote=1)
+ console.SelectDisguise(TRUE, usr)
/datum/action/innate/set_droppoint
name = "Set Experiment Release Point"
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/console.dm b/code/game/gamemodes/miniantags/abduction/machinery/console.dm
index 233f2ebdc02..65a5d01cc9f 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/console.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/console.dm
@@ -119,7 +119,7 @@
if(vest)
vest.toggle_nodrop()
else if(href_list["select_disguise"])
- SelectDisguise()
+ SelectDisguise(FALSE, usr)
else if(href_list["dispense"])
switch(href_list["dispense"])
if("baton")
@@ -149,10 +149,10 @@
if(vest)
vest.flip_mode()
-/obj/machinery/abductor/console/proc/SelectDisguise(remote = 0)
- var/entry_name = input( "Choose Disguise", "Disguise") as null|anything in disguises
+/obj/machinery/abductor/console/proc/SelectDisguise(remote, mob/user)
+ var/entry_name = tgui_input_list(user, "Choose Disguise", "Abductor Disguises", disguises)
var/datum/icon_snapshot/chosen = disguises[entry_name]
- if(chosen && (remote || in_range(usr,src)))
+ if(chosen && (remote || in_range(user, src)))
vest.SetDisguise(chosen)
/obj/machinery/abductor/console/proc/SetDroppoint(turf/location,user)
@@ -164,9 +164,7 @@
pad.teleport_target = location
to_chat(user, "Location marked as test subject release point.")
-
/obj/machinery/abductor/console/proc/Link_Abduction_Equipment() // these must all be explicitly `in machines` or they will not properly link.
-
for(var/obj/machinery/abductor/pad/p in GLOB.abductor_equipment)
if(p.team == team)
pad = p
diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm
index f293b12f107..7df88286499 100644
--- a/code/game/gamemodes/miniantags/guardian/guardian.dm
+++ b/code/game/gamemodes/miniantags/guardian/guardian.dm
@@ -295,7 +295,7 @@
picked_random_type = pick(possible_guardians)
guardian_type = picked_random_type
else
- guardian_type = input(user, "Pick the type of [mob_name]", "[mob_name] Creation") as null|anything in possible_guardians
+ guardian_type = tgui_input_list(user, "Pick the type of [mob_name]", "[mob_name] Creation", possible_guardians)
if(!guardian_type)
to_chat(user, "You decide against using the [name].")
used = FALSE
diff --git a/code/game/gamemodes/miniantags/guardian/host_actions.dm b/code/game/gamemodes/miniantags/guardian/host_actions.dm
index a6df9937431..89e5fcccc6a 100644
--- a/code/game/gamemodes/miniantags/guardian/host_actions.dm
+++ b/code/game/gamemodes/miniantags/guardian/host_actions.dm
@@ -149,12 +149,11 @@
to_chat(guardian_user, "Surveillance trap deployed!")
return TRUE
else
- to_chat(guardian_user, "You have too many traps deployed. Delete one to place another.")
- var/picked_snare = input(guardian_user, "Pick which trap to disarm", "Disarm Trap") as null|anything in guardian_user.snares
+ var/picked_snare = tgui_input_list(guardian_user, "You have too many snares deployed! Delete one to place another.", "Disarm Snare", guardian_user.snares)
if(picked_snare)
guardian_user.snares -= picked_snare
qdel(picked_snare)
- to_chat(src, "Snare disarmed.")
+ to_chat(user, "Snare disarmed.")
revert_cast()
/obj/effect/proc_holder/spell/choose_battlecry
diff --git a/code/game/gamemodes/miniantags/guardian/types/gaseous.dm b/code/game/gamemodes/miniantags/guardian/types/gaseous.dm
index 221d2833f98..63b9ae2a6b6 100644
--- a/code/game/gamemodes/miniantags/guardian/types/gaseous.dm
+++ b/code/game/gamemodes/miniantags/guardian/types/gaseous.dm
@@ -44,7 +44,7 @@
target_turf.air_update_turf()
/mob/living/simple_animal/hostile/guardian/gaseous/ToggleMode()
- var/picked_gas = input("Select a gas to expel.", "Gas Producer") as null|anything in possible_gases
+ var/picked_gas = tgui_input_list(src, "Select a gas to expel.", "Gas Producer", possible_gases)
if(!picked_gas)
moles_of_gas = null
to_chat(src, "You stopped expelling gas.")
diff --git a/code/game/machinery/computer/atmos_controllers.dm b/code/game/machinery/computer/atmos_controllers.dm
index c42f44a809b..e4fbb99242e 100644
--- a/code/game/machinery/computer/atmos_controllers.dm
+++ b/code/game/machinery/computer/atmos_controllers.dm
@@ -338,7 +338,7 @@ GLOBAL_LIST_EMPTY(gas_sensors)
if(!ismultitool(I)) // Should never happen
return
- var/choice = input(user, "Configure what", "Configuration") in list("Inlet", "Outlet", "Sensors", "Cancel")
+ var/choice = tgui_input_list(user, "Configure what", "Configuration", list("Inlet", "Outlet", "Sensors", "Cancel"))
if((!choice) || (choice == "Cancel") || !Adjacent(user))
return
diff --git a/code/game/machinery/computer/depot_consoles.dm b/code/game/machinery/computer/depot_consoles.dm
index aa2c59f4104..a9cca60da28 100644
--- a/code/game/machinery/computer/depot_consoles.dm
+++ b/code/game/machinery/computer/depot_consoles.dm
@@ -451,8 +451,8 @@
else
areaindex[tmpname] = 1
L[tmpname] = R
- var/desc = input("Please select a location to lock in.", "Syndicate Teleporter") in L
- return(L[desc])
+ var/desc = tgui_input_list(usr, "Please select a location to lock in.", "Syndicate Teleporter", L)
+ return L[desc]
/obj/machinery/computer/syndicate_depot/teleporter/proc/update_portal()
if(portal_enabled && !myportal)
diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm
index 25de4f24ae5..39e01428a41 100644
--- a/code/game/machinery/computer/law.dm
+++ b/code/game/machinery/computer/law.dm
@@ -99,24 +99,23 @@
borg.cmd_show_laws()
borg.throw_alert("newlaw", /obj/screen/alert/newlaw)
-/obj/machinery/computer/aiupload/attack_hand(mob/user as mob)
- if(src.stat & NOPOWER)
- to_chat(usr, "The upload computer has no power!")
+/obj/machinery/computer/aiupload/attack_hand(mob/user)
+ if(stat & NOPOWER)
+ to_chat(user, "The upload computer has no power!")
return
- if(src.stat & BROKEN)
- to_chat(usr, "The upload computer is broken!")
+ if(stat & BROKEN)
+ to_chat(user, "The upload computer is broken!")
return
- src.current = select_active_ai(user)
+ current = select_active_ai(user)
- if(!src.current)
- to_chat(usr, "No active AIs detected.")
- else
- to_chat(usr, "[src.current.name] selected for law changes.")
- return
+ if(!current)
+ to_chat(user, "No active AIs detected.")
+ return
+ to_chat(user, "[current.name] selected for law changes.")
-/obj/machinery/computer/aiupload/attack_ghost(user as mob)
- return 1
+/obj/machinery/computer/aiupload/attack_ghost(user)
+ return TRUE
#undef AIUPLOAD_EMAG_COOLDOWN
@@ -129,11 +128,10 @@
circuit = /obj/item/circuitboard/borgupload
var/mob/living/silicon/robot/current = null
-
-/obj/machinery/computer/borgupload/attackby(obj/item/aiModule/module as obj, mob/user as mob, params)
+/obj/machinery/computer/borgupload/attackby(obj/item/aiModule/module, mob/user, params)
if(istype(module, /obj/item/aiModule))
if(!current)//no borg selected
- to_chat(user, "No borg selected. Please chose a target before proceeding with upload.")
+ to_chat(user, "No borg selected. Please chose a target before proceeding with upload.")
return
var/turf/T = get_turf(current)
if(!atoms_share_level(T, src))
@@ -144,21 +142,20 @@
return ..()
-/obj/machinery/computer/borgupload/attack_hand(mob/user as mob)
- if(src.stat & NOPOWER)
- to_chat(usr, "The upload computer has no power!")
+/obj/machinery/computer/borgupload/attack_hand(mob/user)
+ if(stat & NOPOWER)
+ to_chat(user, "The upload computer has no power!")
return
- if(src.stat & BROKEN)
- to_chat(usr, "The upload computer is broken!")
+ if(stat & BROKEN)
+ to_chat(user, "The upload computer is broken!")
return
- src.current = freeborg()
+ current = freeborg(user)
- if(!src.current)
- to_chat(usr, "No free cyborgs detected.")
- else
- to_chat(usr, "[src.current.name] selected for law changes.")
- return
+ if(!current)
+ to_chat(user, "No free cyborgs detected.")
+ return
+ to_chat(user, "[current.name] selected for law changes.")
-/obj/machinery/computer/borgupload/attack_ghost(user as mob)
- return 1
+/obj/machinery/computer/borgupload/attack_ghost(user)
+ return TRUE
diff --git a/code/game/machinery/computer/message_monitor.dm b/code/game/machinery/computer/message_monitor.dm
index 7216f6f1dce..c1713e3f3be 100644
--- a/code/game/machinery/computer/message_monitor.dm
+++ b/code/game/machinery/computer/message_monitor.dm
@@ -299,10 +299,10 @@
if(auth) linkedServer.active = !linkedServer.active
//Find a server
if(href_list["find"])
- if(GLOB.message_servers && GLOB.message_servers.len > 1)
- src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in GLOB.message_servers
+ if(GLOB.message_servers && length(GLOB.message_servers) > 1)
+ linkedServer = input(usr, "Please select a server.", "Select a server.", GLOB.message_servers)
message = "NOTICE: Server selected."
- else if(GLOB.message_servers && GLOB.message_servers.len > 0)
+ else if(GLOB.message_servers && length(GLOB.message_servers) > 0)
linkedServer = GLOB.message_servers[1]
message = "NOTICE: Only Single Server Detected - Server selected."
else
@@ -415,7 +415,7 @@
continue
sendPDAs += P
if(GLOB.PDAs && GLOB.PDAs.len > 0)
- customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortAtom(sendPDAs)
+ customrecepient = tgui_input_list(usr, "Select a PDA from the list.", buttons = sortAtom(sendPDAs))
else
customrecepient = null
diff --git a/code/game/machinery/computer/robot_control.dm b/code/game/machinery/computer/robot_control.dm
index 4f300363824..63adce49228 100644
--- a/code/game/machinery/computer/robot_control.dm
+++ b/code/game/machinery/computer/robot_control.dm
@@ -249,7 +249,7 @@
var/mob/living/silicon/robot/R = locateUID(params["uid"])
if(!can_hack(usr, R))
return
- var/choice = input("Really hack [R.name]? This cannot be undone.") in list("Yes", "No")
+ var/choice = alert(usr, "Really hack [R.name]? This cannot be undone.", "Do you want to hack this borg?", "Yes", "No")
if(choice != "Yes")
return
log_game("[key_name(usr)] emagged [key_name(R)] using robotic console!")
diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm
index 307a6f5b4e6..31d20c71ea3 100644
--- a/code/game/machinery/dance_machine.dm
+++ b/code/game/machinery/dance_machine.dm
@@ -146,7 +146,7 @@
var/list/available = list()
for(var/datum/track/S in songs)
available[S.song_name] = S
- var/selected = input(usr, "Choose your song", "Track:") as null|anything in available
+ var/selected = tgui_input_list(usr, "Select a new track", "Track:", available)
if(QDELETED(src) || !selected || !istype(available[selected], /datum/track))
return
selection = available[selected]
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index d7d7597f579..839adeeaf1d 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -107,7 +107,6 @@
if(patient)
temp = "
\[Occupant: [patient] ([patient.stat > 1 ? "*DECEASED*" : "Health: [patient.health]%"])\]
View stats|Eject"
return "[output] [temp]"
- return
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Topic(href,href_list)
..()
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index 264916894c8..d6496b0f723 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -13,7 +13,7 @@
. = ..()
if(can_buckle && has_buckled_mobs())
if(length(buckled_mobs) > 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 TRUE
else
@@ -33,8 +33,8 @@
. = ..()
if(can_buckle && has_buckled_mobs() && Adjacent(user)) // attack_robot is called on all ranges, so the Adjacent check is needed
if(length(buckled_mobs) > 1)
- var/unbuckled = input(user, "Who do you wish to unbuckle?", "Unbuckle Who?") as null|mob in buckled_mobs
- if(user_unbuckle_mob(unbuckled,user))
+ var/unbuckled = tgui_input_list(user, "Who do you wish to unbuckle?", "Unbuckle Who?", buckled_mobs)
+ if(user_unbuckle_mob(unbuckled, user))
return TRUE
else
if(user_unbuckle_mob(buckled_mobs[1], user))
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 7de0db3c1cc..903956bae37 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -306,8 +306,8 @@
..()
update_icon()
-/obj/item/toy/crayon/spraycan/attack_self(mob/living/user as mob)
- var/choice = input(user,"Spraycan options") in list("Toggle Cap","Change Drawing","Change Color")
+/obj/item/toy/crayon/spraycan/attack_self(mob/living/user)
+ var/choice = tgui_input_list(user, "Do you want to...", "Spraycan Options", list("Toggle Cap","Change Drawing", "Change Color"))
switch(choice)
if("Toggle Cap")
to_chat(user, "You [capped ? "remove" : "replace"] the cap of [src].")
diff --git a/code/game/objects/items/flag.dm b/code/game/objects/items/flag.dm
index 06d1149ed2b..e7afcbc4a9b 100644
--- a/code/game/objects/items/flag.dm
+++ b/code/game/objects/items/flag.dm
@@ -234,10 +234,11 @@
var/list/show_flag = list("EXIT" = null) + sortList(flag)
- var/input_flag = input(user, "Choose a flag to disguise as.", "Choose a flag.") in show_flag
-
- if(user && (src in user.contents))
+ var/input_flag = tgui_input_list(user, "Choose a flag to disguise this as.", "Choose a flag.", show_flag)
+ if(!input_flag)
+ return
+ if(user && (src in user.GetAllContents()))
var/obj/item/flag/chosen_flag = flag[input_flag]
if(chosen_flag && !used)
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 556839fdb0f..ac602adc0e5 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -389,7 +389,7 @@
if("Show")
return ..()
if("Edit")
- switch(input(user,"What would you like to edit on \the [src]?") in list("Name", "Photo", "Appearance", "Sex", "Age", "Occupation", "Money Account", "Blood Type", "DNA Hash", "Fingerprint Hash", "Reset Access", "Delete Card Information"))
+ switch(input(user, "What would you like to edit on \the [src]?", "Agent ID", list("Name", "Photo", "Appearance", "Sex", "Age", "Occupation", "Money Account", "Blood Type", "DNA Hash", "Fingerprint Hash", "Reset Access", "Delete Card Information")))
if("Name")
var/new_name = reject_bad_name(input(user,"What name would you like to put on this card?","Agent Card Name", ishuman(user) ? user.real_name : user.name), TRUE)
if(!Adjacent(user))
@@ -413,7 +413,7 @@
RebuildHTML()
if("Appearance")
- var/list/appearances = list(
+ var/static/list/appearances = list(
"data",
"id",
"gold",
@@ -464,7 +464,7 @@
"ERT_janitorial",
"ERT_paranormal",
)
- var/choice = input(user, "Select the appearance for this card.", "Agent Card Appearance") in appearances
+ var/choice = tgui_input_list(user, "Select the appearance for this card.", "Agent Card Appearance", appearances)
if(!Adjacent(user))
return
if(!choice)
@@ -508,7 +508,7 @@
RebuildHTML()
if("Occupation")
- var/list/departments = list(
+ var/static/list/departments = list(
"Assistant" = null,
"Engineering" = GLOB.engineering_positions,
"Medical" = GLOB.medical_positions,
@@ -520,13 +520,13 @@
"Custom" = null,
)
- var/department = input(user, "What job would you like to put on this card?\nChoose a department or a custom job title.\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in departments
+ var/department = tgui_input_list(user, "What job would you like to put on this card?\nChoose a department or a custom job title.\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", departments)
var/new_job = "Assistant"
if(department == "Custom")
new_job = sanitize(stripped_input(user,"Choose a custom job title:","Agent Card Occupation", "Assistant", MAX_MESSAGE_LEN))
else if(department != "Assistant" && !isnull(departments[department]))
- new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in departments[department]
+ new_job = tgui_input_list(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", departments[department])
if(!Adjacent(user))
return
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index 8213944e888..4503aa524c4 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -62,14 +62,12 @@
/obj/item/sign/screwdriver_act(mob/living/user, obj/item/I)
if(!isturf(user.loc)) // Why does this use user? This should just be loc.
return
+ . = TRUE // These return values gotta be true or we stab the sign
+ var/direction = tgui_input_list(user, "Which direction will this sign be moved?", "Select direction,", list("North", "East", "South", "West", "Cancel"))
+ if(direction == "Cancel" || QDELETED(src))
+ return
- var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
- if(direction == "Cancel")
- return TRUE // These gotta be true or we stab the sign
- if(QDELETED(src))
- return TRUE // Unsure about this, but stabbing something that doesnt exist seems like a bad idea
-
- var/obj/structure/sign/S = new(user.loc) //This is really awkward to use user.loc
+ var/obj/structure/sign/S = new(get_turf(user))
switch(direction)
if("North")
S.pixel_y = 32
@@ -80,13 +78,12 @@
if("West")
S.pixel_x = -32
else
- return TRUE // We dont want to stab it or place it, so we return
+ return
S.name = name
S.desc = desc
S.icon_state = sign_state
to_chat(user, "You fasten [S] with your [I].")
qdel(src)
- return TRUE
/obj/structure/sign/double/map
name = "station map"
diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm
index ef49a478bb2..c62d9d426ac 100644
--- a/code/game/objects/structures/statues.dm
+++ b/code/game/objects/structures/statues.dm
@@ -27,7 +27,6 @@
return
return ..()
-
/obj/structure/statue/welder_act(mob/user, obj/item/I)
if(anchored)
return
@@ -39,7 +38,6 @@
WELDER_SLICING_SUCCESS_MESSAGE
deconstruct(TRUE)
-
/obj/structure/statue/attack_hand(mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
add_fingerprint(user)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 04b98ffde47..f22e746da5c 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -161,7 +161,9 @@
anchored = TRUE
if("Rotate")
var/list/dir_choices = list("North" = NORTH, "East" = EAST, "South" = SOUTH, "West" = WEST)
- var/selected = input(user,"Select a direction for the connector.", "Connector Direction") in dir_choices
+ var/selected = tgui_input_list(user, "Select a direction for the connector.", "Connector Direction", dir_choices)
+ if(!selected)
+ return
dir = dir_choices[selected]
update_icon() //is this necessary? probably not
@@ -572,7 +574,9 @@
anchored = TRUE
if("Rotate")
var/list/dir_choices = list("North" = NORTH, "East" = EAST, "South" = SOUTH, "West" = WEST)
- var/selected = input(user, "Select a direction for the connector.", "Connector Direction") in dir_choices
+ var/selected = tgui_input_list(user, "Select a direction for the connector.", "Connector Direction", dir_choices)
+ if(!selected)
+ return
dir = dir_choices[selected]
update_icon() //is this necessary? probably not
diff --git a/code/modules/antagonists/_common/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm
index 687237e6674..ea6345143af 100644
--- a/code/modules/antagonists/_common/antag_spawner.dm
+++ b/code/modules/antagonists/_common/antag_spawner.dm
@@ -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")
diff --git a/code/modules/antagonists/vampire/vampire_powers/hemomancer_powers.dm b/code/modules/antagonists/vampire/vampire_powers/hemomancer_powers.dm
index efeeb109d5a..18572549056 100644
--- a/code/modules/antagonists/vampire/vampire_powers/hemomancer_powers.dm
+++ b/code/modules/antagonists/vampire/vampire_powers/hemomancer_powers.dm
@@ -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]
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
index e3a4780e213..b92c95fd713 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
@@ -140,7 +140,9 @@
to_chat(user, "Open the maintenance panel first.")
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
diff --git a/code/modules/awaymissions/mob_spawn.dm b/code/modules/awaymissions/mob_spawn.dm
index 67f2af1e0ea..c5fd92172cf 100644
--- a/code/modules/awaymissions/mob_spawn.dm
+++ b/code/modules/awaymissions/mob_spawn.dm
@@ -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, "The [name] is no longer usable!")
@@ -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]
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 0c9c3092b08..be4488ff62a 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -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, "You have moved too far away!")
return
if(!ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
to_chat(user, "You can't use your hands!")
return
-
+ if(!switchMode)
+ return
sensor_mode = modes.Find(switchMode) - 1
if(loc == user)
diff --git a/code/modules/events/blob/blob_powers.dm b/code/modules/events/blob/blob_powers.dm
index 0dc7c75625a..e52ea432f82 100644
--- a/code/modules/events/blob/blob_powers.dm
+++ b/code/modules/events/blob/blob_powers.dm
@@ -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"
diff --git a/code/modules/food_and_drinks/food/foods/pizza.dm b/code/modules/food_and_drinks/food/foods/pizza.dm
index d157b6067e3..4e8bd135f27 100644
--- a/code/modules/food_and_drinks/food/foods/pizza.dm
+++ b/code/modules/food_and_drinks/food/foods/pizza.dm
@@ -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, "Oh God, what wire do you cut?!")
- 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("[user] cuts the [chosen_wire] wire!", "You cut the [chosen_wire] wire!")
diff --git a/code/modules/food_and_drinks/kitchen_machinery/oven.dm b/code/modules/food_and_drinks/kitchen_machinery/oven.dm
index 40fad0fd59f..94ebc9c61bb 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/oven.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/oven.dm
@@ -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
diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm
index 85f29770978..17d1eb27cdb 100644
--- a/code/modules/mining/equipment/wormhole_jaunter.dm
+++ b/code/modules/mining/equipment/wormhole_jaunter.dm
@@ -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
diff --git a/code/modules/mob/dead/observer/observer_base.dm b/code/modules/mob/dead/observer/observer_base.dm
index 57ad0d7dc4a..8752f369856 100644
--- a/code/modules/mob/dead/observer/observer_base.dm
+++ b/code/modules/mob/dead/observer/observer_base.dm
@@ -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()
diff --git a/code/modules/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm
index 08afac8083c..ea2602ce9a4 100644
--- a/code/modules/mob/living/carbon/human/human_mob.dm
+++ b/code/modules/mob/living/carbon/human/human_mob.dm
@@ -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))
diff --git a/code/modules/mob/living/default_language.dm b/code/modules/mob/living/default_language.dm
index f6536f03fd0..61fa3addbff 100644
--- a/code/modules/mob/living/default_language.dm
+++ b/code/modules/mob/living/default_language.dm
@@ -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, "You will now speak [language] if you do not specify a language when speaking.")
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, "You are currently speaking [default_language] by default.")
+ 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, "You will now speak [language] if you do not specify a language when speaking.")
else
- to_chat(src, "Your current default language is your species or mob type default.")
+ to_chat(src, "You will now speak whatever your standard default language is if you do not specify one when speaking.")
+ default_language = language
diff --git a/code/modules/mob/living/silicon/ai/ai_mob.dm b/code/modules/mob/living/silicon/ai/ai_mob.dm
index 646216f2bba..83f50e3b4e2 100644
--- a/code/modules/mob/living/silicon/ai/ai_mob.dm
+++ b/code/modules/mob/living/silicon/ai/ai_mob.dm
@@ -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
diff --git a/code/modules/mob/living/silicon/robot/misc_robot_items.dm b/code/modules/mob/living/silicon/robot/misc_robot_items.dm
index 26d01c2c480..265ad4c16d5 100644
--- a/code/modules/mob/living/silicon/robot/misc_robot_items.dm
+++ b/code/modules/mob/living/silicon/robot/misc_robot_items.dm
@@ -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
diff --git a/code/modules/mob/living/silicon/silicon_mob.dm b/code/modules/mob/living/silicon/silicon_mob.dm
index a6d3d0009c9..82f699a69f6 100644
--- a/code/modules/mob/living/silicon/silicon_mob.dm
+++ b/code/modules/mob/living/silicon/silicon_mob.dm
@@ -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"
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 6a0b1072cd5..93086b08b2c 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -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)
diff --git a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm
index a54014b9fa3..00099deea27 100644
--- a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm
+++ b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm
@@ -127,11 +127,11 @@
continue
choices += H
- if(!choices.len)
+ if(!length(choices))
to_chat(src, "No suitable diona nearby.")
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, "No suitable blood donors nearby.")
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
diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
index 5ada8062c4f..087beb51584 100644
--- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
@@ -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, "No suitable dead prey or wrappable objects found nearby.")
return
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm
index 34a5ed2286d..4d4e048ce32 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm
@@ -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, "There is nothing nearby you can wrap.")
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm
index c1a6c438090..4c8524671b3 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm
@@ -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, "Cancelled.")
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm
index ba0d3f101a0..c642423c91b 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm
@@ -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, "Unrecognized egg type.")
- 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, "Eggs can only be laid while standing on a floor.")
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen_terror.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen_terror.dm
index 0966d7ed7c1..1f9a904953f 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen_terror.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen_terror.dm
@@ -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, "Too soon to lay another egg.")
return
if(!(eggtype in eggtypes))
to_chat(src, "Unrecognized egg type.")
- 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
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm
index b637b129f24..eb0bc99b7c2 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm
@@ -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)
diff --git a/code/modules/mob/living/simple_animal/slime/slime_powers.dm b/code/modules/mob/living/simple_animal/slime/slime_powers.dm
index 409365ba51b..21ee5c4c6c6 100644
--- a/code/modules/mob/living/simple_animal/slime/slime_powers.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime_powers.dm
@@ -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"
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index f456db71ddc..aee14dbb6f7 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -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
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 6092fc9f093..be99c7963af 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -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
diff --git a/code/modules/projectiles/guns/energy/telegun.dm b/code/modules/projectiles/guns/energy/telegun.dm
index 19228ba5fcd..e2a43b7a30f 100644
--- a/code/modules/projectiles/guns/energy/telegun.dm
+++ b/code/modules/projectiles/guns/energy/telegun.dm
@@ -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, "The [src] is now set to [desc].")
//Process the shot without draining the cell
diff --git a/code/modules/projectiles/guns/throw/crossbow.dm b/code/modules/projectiles/guns/throw/crossbow.dm
index 218d7e41254..77dc3dbd5ea 100644
--- a/code/modules/projectiles/guns/throw/crossbow.dm
+++ b/code/modules/projectiles/guns/throw/crossbow.dm
@@ -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
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index a818d35f26a..e4bbb6e6418 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -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
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index d7eecc20c1f..3c6fe91cd9d 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -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
diff --git a/code/modules/shuttle/assault_pod.dm b/code/modules/shuttle/assault_pod.dm
index 21251143302..68336212acd 100644
--- a/code/modules/shuttle/assault_pod.dm
+++ b/code/modules/shuttle/assault_pod.dm
@@ -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