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

@@ -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")

View File

@@ -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"

View File

@@ -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, "<span class='notice'>Location marked as test subject release point.</span>")
/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

View File

@@ -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, "<span class='warning'>You decide against using the [name].</span>")
used = FALSE

View File

@@ -149,12 +149,11 @@
to_chat(guardian_user, "<span class='notice'>Surveillance trap deployed!</span>")
return TRUE
else
to_chat(guardian_user, "<span class='notice'>You have too many traps deployed. Delete one to place another.</span>")
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, "<span class='notice'>Snare disarmed.</span>")
to_chat(user, "<span class='notice'>Snare disarmed.</span>")
revert_cast()
/obj/effect/proc_holder/spell/choose_battlecry

View File

@@ -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, "<span class='notice'>You stopped expelling gas.</span>")

View File

@@ -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

View File

@@ -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)

View File

@@ -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, "<span class='warning'>The upload computer has no power!</span>")
return
if(src.stat & BROKEN)
to_chat(usr, "The upload computer is broken!")
if(stat & BROKEN)
to_chat(user, "<span class='warning'>The upload computer is broken!</span>")
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, "<span class='warning'>No active AIs detected.</span>")
return
to_chat(user, "<span class='notice'>[current.name] selected for law changes.</span>")
/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, "<span class='danger'>No borg selected. Please chose a target before proceeding with upload.")
to_chat(user, "<span class='danger'>No borg selected. Please chose a target before proceeding with upload.</span>")
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, "<span class='warning'>The upload computer has no power!</span>")
return
if(src.stat & BROKEN)
to_chat(usr, "The upload computer is broken!")
if(stat & BROKEN)
to_chat(user, "<span class='warning'>The upload computer is broken!</span>")
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, "<span class='warning'>No free cyborgs detected.</span>")
return
to_chat(user, "<span class='notice'>[current.name] selected for law changes.</span>")
/obj/machinery/computer/borgupload/attack_ghost(user as mob)
return 1
/obj/machinery/computer/borgupload/attack_ghost(user)
return TRUE

View File

@@ -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 = "<span class='alert'>NOTICE: Server selected.</span>"
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 = "<span class='notice'>NOTICE: Only Single Server Detected - Server selected.</span>"
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

View File

@@ -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!")

View File

@@ -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]

View File

@@ -107,7 +107,6 @@
if(patient)
temp = "<br />\[Occupant: [patient] ([patient.stat > 1 ? "*DECEASED*" : "Health: [patient.health]%"])\]<br /><a href='?src=[UID()];view_stats=1'>View stats</a>|<a href='?src=[UID()];eject=1'>Eject</a>"
return "[output] [temp]"
return
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Topic(href,href_list)
..()

View File

@@ -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))

View File

@@ -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, "<span class='notice'>You [capped ? "remove" : "replace"] the cap of [src].</span>")

View File

@@ -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)

View File

@@ -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

View File

@@ -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, "<span class='notice'>You fasten [S] with your [I].</span>")
qdel(src)
return TRUE
/obj/structure/sign/double/map
name = "station map"

View File

@@ -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)

View File

@@ -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