Adds TGUI say and TGUI input. (#17471)

* i alone am the honoured one

* THROUGHOUT HEAVEN AND EARTH I ALONE AM THE HONOURED ONE

* hollow point

* nanana

* ssss

* tgsay final touches

* stuff

* tgui inputs

* help

* carpal tunnel syndrome

* ffff

* again and again and again and again

* hehehehe

* dsada

* readd sanitize

* whoops

* dsad

* nah fuck that

* sd

* fix

* ow

* remove prefs for testmerging

* oops

* oops 2

* fix that

* f

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-10-11 23:26:59 +02:00
committed by GitHub
co-authored by Matt Atlas
parent 518c843e00
commit 54dc8a0860
185 changed files with 2203 additions and 632 deletions
+1 -1
View File
@@ -74,7 +74,7 @@
/obj/structure/closet/body_bag/attackby(var/obj/item/W, mob/user as mob)
if (W.ispen())
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
var/t = tgui_input_text(user, "What would you like the label to be?", name)
if (user.get_active_hand() != W)
return TRUE
if (!in_range(src, user) && src.loc != user)
@@ -37,7 +37,7 @@
to_chat(user, SPAN_NOTICE("There are no warrants available at this time."))
return
var/temp
temp = input(usr, "Which warrant would you like to load?") as null|anything in storedwarrant
temp = tgui_input_list(usr, "Which warrant would you like to load?", storedwarrant)
for(var/datum/record/warrant/W in SSrecords.warrants)
if(W.name == temp)
activename = W.name
@@ -83,7 +83,7 @@
return cell
/obj/item/device/flashlight/proc/set_brightness(mob/user)
var/choice = input("Choose a brightness level.") as null|anything in brightness_levels
var/choice = tgui_input_list(user, "Choose a brightness level.", "Flashlight", brightness_levels)
if(choice)
brightness_level = choice
power_usage = brightness_levels[choice]
+1 -1
View File
@@ -355,7 +355,7 @@
src.looking_for_personality = 1
SSpai.findPAI(src, usr)
if(href_list["wipe"])
var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No")
var/confirm = tgui_alert(usr, "Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe", list("Yes", "No"))
if(confirm == "Yes")
for(var/mob/M in src)
to_chat(M, "<font color = #ff0000><h2>You feel yourself slipping away from reality.</h2></font>")
@@ -165,7 +165,7 @@
new painting_decal(F, painting_dir, painting_colour)
/obj/item/device/paint_sprayer/attack_self(var/mob/user)
var/choice = input("Do you wish to change the decal type, paint direction, or paint colour?") as null|anything in list("Decal","Direction", "Colour")
var/choice = tgui_alert(user, "Do you wish to change the decal type, paint direction, or paint colour?", "Paint Sprayer", list("Decal","Direction", "Colour"))
if(choice == "Decal")
choose_decal()
else if(choice == "Direction")
@@ -220,7 +220,7 @@
available_colors |= isnull(I.color) ? COLOR_WHITE : I.color
var/picked_color = available_colors[1]
if (available_colors.len > 1)
picked_color = input(user, "Which color do you wish to pick from?") as null|anything in available_colors
picked_color = tgui_input_list(user, "Which color do you wish to pick from?", "Paint Sprayer", available_colors)
if (user.incapacitated() || !user.Adjacent(F))
return FALSE
return picked_color
@@ -263,7 +263,7 @@
choices |= AIRLOCK_REGION_STRIPE
if (D.paintable & AIRLOCK_PAINTABLE_WINDOW)
choices |= AIRLOCK_REGION_WINDOW
choice = input(user, input_text) as null|anything in sortList(choices)
choice = tgui_input_list(user, input_text, "Paint Sprayer", sortList(choices))
if (!user.use_check_and_message() || !D || !user.Adjacent(D))
return FALSE
return choice
@@ -301,7 +301,7 @@
if(usr.incapacitated())
return
var/new_colour = input(usr, "Choose a colour.", "paintgun", paint_colour) as color|null
var/new_colour = input(usr, "Choose a colour.", "Paint Sprayer", paint_colour) as color|null
change_colour(new_colour, usr)
/obj/item/device/paint_sprayer/verb/choose_preset_colour()
@@ -326,7 +326,7 @@
if(usr.incapacitated())
return
var/new_decal = input("Select a decal.") as null|anything in decals
var/new_decal = tgui_input_list(usr, "Select a decal.", "Paint Sprayer", decals)
if(new_decal && !isnull(decals[new_decal]))
decal = new_decal
to_chat(usr, "<span class='notice'>You set \the [src] decal to '[decal]'.</span>")
@@ -340,7 +340,7 @@
if(usr.incapacitated())
return
var/new_dir = input("Select a direction.") as null|anything in paint_dirs
var/new_dir = tgui_input_list(usr, "Select a direction.", "Paint Sprayer", paint_dirs)
if(new_dir && !isnull(paint_dirs[new_dir]))
paint_dir = new_dir
to_chat(usr, "<span class='notice'>You set \the [src] direction to '[paint_dir]'.</span>")
@@ -29,7 +29,7 @@
P.color = pipe_colors[mode]
/obj/item/device/pipe_painter/attack_self(var/mob/user)
mode = input("Which colour do you want to use?", "Pipe painter", mode) in modes
mode = tgui_input_list(user, "Which colour do you want to use?", "Pipe Painter", modes, mode)
/obj/item/device/pipe_painter/examine(var/mob/user)
. = ..()
+1 -1
View File
@@ -104,7 +104,7 @@
operating = 1
while(selected_camera && Adjacent(user))
selected_camera = input("Select camera bug to view.") as null|anything in cameras
selected_camera = tgui_input_list(user, "Select camera bug to view.", "Spy Monitor", cameras)
selected_camera = null
operating = 0
+1 -1
View File
@@ -103,7 +103,7 @@
return 1
/obj/item/eightball/haunted/proc/get_ghost_answer(mob/user)
var/answer = input("Choose the answer.", "Magic eightball question") as null|anything in possible_answers
var/answer = tgui_input_list(user, "Choose the answer.", "Magic Eight-Ball", possible_answers)
if(answered)
return
+1 -1
View File
@@ -101,7 +101,7 @@
working = !working
if(working)
var/choice = input("You change the projector's hologram to display:","Change the projector's hologram.") as null|anything in worlds_selection
var/choice = tgui_input_list(user, "You change the projector's hologram to display:","Change the projector's hologram.", worlds_selection)
apply_world(choice)
START_PROCESSING(SSprocessing, src)
else
+2 -2
View File
@@ -30,10 +30,10 @@
/obj/item/spirit_board/proc/spirit_board_pick_letter(mob/M)
if(!spirit_board_checks(M))
return 0
planchette = input("Choose the letter.", "Seance!") as null|anything in list(
planchette = tgui_input_list(M, "Choose the letter.", "Seance!", list(
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
"YES", "NO", "GOODBYE")
"YES", "NO", "GOODBYE"))
if(!planchette || !Adjacent(M) || next_use > world.time)
return next_use = world.time + rand(30,50)
+1 -1
View File
@@ -13,7 +13,7 @@
working = !working
if(working)
var/choice = input("You change the projector's holographic viewfinder to display:","Change the projector's viewfinder.") as null|anything in worlds_selection
var/choice = tgui_input_list(user, "You change the projector's holographic viewfinder to display:", "Change the projector's viewfinder.", worlds_selection)
apply_world(choice)
first_message = TRUE
START_PROCESSING(SSprocessing, src)
+2 -2
View File
@@ -738,11 +738,11 @@
pipe_selection = aux_pipes
if(DEVICES)
pipe_selection = devices
pipe_examine = input(user, "Choose the pipe you want to deploy.", "Pipe Selection") in pipe_selection
pipe_examine = tgui_input_list(user, "Choose the pipe you want to deploy.", "Pipe Selection", pipe_selection, selected_pipe)
selected_pipe = pipe_selection[pipe_examine]
/obj/item/rfd/piping/AltClick(mob/user)
selected_mode = input(user, "Choose the category you want to change to.", "Pipe Categories") in modes
selected_mode = tgui_input_list(user, "Choose the category you want to change to.", "Pipe Categories", modes, selected_mode)
switch(selected_mode)
if(STANDARD_PIPE)
pipe_examine = "Pipe"
@@ -145,7 +145,7 @@
else if(href_list["set"])
switch(href_list["set"])
if("Age")
var/new_age = input(user,"What age would you like to put on this card?","Agent Card Age", age) as null|num
var/new_age = tgui_input_number(user, "What age would you like to put on this card?", "Agent Card Age", age, 1000, 0)
if(!isnull(new_age) && CanUseTopic(user, state))
if(new_age < 0)
age = initial(age)
@@ -154,14 +154,14 @@
to_chat(user, "<span class='notice'>Age has been set to '[age]'.</span>")
. = 1
if("Appearance")
var/datum/card_state/choice = input(user, "Select the appearance for this card.", "Agent Card Appearance") as null|anything in id_card_states()
var/datum/card_state/choice = tgui_input_list(user, "Select the appearance for this card.", "Agent Card Appearance", id_card_states(), icon_state)
if(choice && CanUseTopic(user, state))
src.icon_state = choice.icon_state
src.item_state = choice.item_state
to_chat(usr, "<span class='notice'>Appearance changed to [choice].</span>")
. = 1
if("Assignment")
var/new_job = sanitize(input(user,"What assignment would you like to put on this card?\nChanging assignment will not grant or remove any access levels.","Agent Card Assignment", assignment) as null|text)
var/new_job = tgui_input_text(user, "What assignment would you like to put on this card? Changing assignment will not grant or remove any access levels.", "Agent Card Assignment", assignment)
if(!isnull(new_job) && CanUseTopic(user, state))
src.assignment = new_job
to_chat(user, "<span class='notice'>Occupation changed to '[new_job]'.</span>")
@@ -147,7 +147,7 @@
if(use_check_and_message(user, USE_FORCE_SRC_IN_USER))
return
var/picked = input("What form would you like your obsidian relic to take?", "Reassembling your obsidian relic") as null|anything in nullchoices
var/picked = tgui_input_list(user, "What form would you like your obsidian relic to take?", "Reassembling your obsidian relic", nullchoices)
if(use_check_and_message(user, USE_FORCE_SRC_IN_USER))
return
@@ -38,14 +38,13 @@
/obj/item/implantcase/attackby(obj/item/I, mob/user)
if (I.ispen())
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null)
var/t = tgui_input_text(user, "What would you like the label to be?", name, name, MAX_NAME_LEN)
if (user.get_active_hand() != I)
return
if((!in_range(src, usr) && loc != user))
return
t = sanitizeSafe(t, MAX_NAME_LEN)
if(t)
src.name = text("implant case - '[]'", t)
src.name = "implant case - [t]"
desc = "An aluminium case, containing \a [t] implant."
else
src.name = "implant case"
@@ -69,23 +69,23 @@
if(href_list["code"])
var/adj = text2num(href_list["code"])
if(!adj)
code = input("Set radio activation code","Radio activation") as num
code = tgui_input_number(usr, "Set radio activation code.", "Radio Activation")
else
code += adj
code = clamp(code,1,100)
interact(usr)
if(href_list["mode"])
var/mod = input("Set explosion mode", "Explosion mode") as null|anything in possible_explosions
var/mod = tgui_input_list(usr, "Set explosion mode.", "Explosion Mode", possible_explosions)
if(mod)
elevel = mod
interact(usr)
if(href_list["msg"])
var/msg = input("Set tampering message, or leave blank for no broadcasting.", "Anti-tampering", warning_message) as text|null
var/msg = tgui_input_text(usr, "Set tampering message, or leave blank for no broadcasting.", "Anti-Tampering", warning_message)
if(msg)
warning_message = msg
interact(usr)
if(href_list["phrase"])
var/talk = input("Set activation phrase", "Audio activation", phrase) as text|null
var/talk = tgui_input_text(usr, "Set activation phrase", "Audio Activation", phrase)
if(talk)
phrase = sanitizePhrase(talk)
interact(usr)
@@ -25,7 +25,7 @@ This is the entity that the implantee will align their thoughts to benefit.<BR>
/obj/item/implant/mindshield/loyalty/Topic(href, href_list)
..()
if(href_list["loyal"])
var/entity = input("Set loyalty target.", "Loyalty", loyal_entity) as text|null
var/entity = tgui_input_text(usr, "Set loyalty target.", "Loyalty", loyal_entity)
if(entity)
loyal_entity = entity
interact(usr)
@@ -17,7 +17,7 @@
return
/obj/item/implant/uplink/implanted(mob/source)
activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
activation_emote = tgui_input_list(source, "Choose activation emote.", "Implant", list("blink", "blink_r", "eyebrow", "chuckle", "twitch", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink"))
source.mind.store_memory("Uplink implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
to_chat(source, "The implanted uplink implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.")
hidden_uplink.uplink_owner = source.mind
@@ -85,7 +85,7 @@
set category = "Object"
set src in usr
var/nsize = input("Bite Size","Pick the amount of reagents to pick up.") as null|anything in bite_sizes
var/nsize = tgui_input_list(usr, "Select the amount of reagents to pick up.", "Bite Size", bite_sizes, transfer_amt)
if(nsize)
transfer_amt = nsize
to_chat(usr, SPAN_NOTICE("\The [src] will now scoop up [transfer_amt] reagents."))
@@ -43,7 +43,7 @@
for(var/thing in H.organs)
var/obj/item/organ/external/O = thing
available_organs[capitalize_first_letters(O.name)] = O
var/choice = input(usr, "Select an external organ to extract any embedded or implanted item from.", "Organ Selection") as null|anything in available_organs
var/choice = tgui_input_list(usr, "Select an external organ to extract any embedded or implanted item from.", "Organ Selection", available_organs)
if(!choice)
return
@@ -65,7 +65,7 @@
if(user.mind && (user.mind.assigned_role == "Chaplain"))
SSticker.Bible_name = book_name
var/new_book_style = input(user,"Which bible style would you like?") in list("Generic", "Bible", "White Bible", "Melted Bible", "Quran", "Torah", "Holy Light", "Tome", "Scroll", "Guru", "The King in Yellow", "Ithaqua", "Trinary", "Stars", "Scrapbook", "Atheist", "Necronomicon")
var/new_book_style = tgui_input_list(user, "Which holy book style would you like?", "Holy Book", list("Generic", "Bible", "White Bible", "Melted Bible", "Quran", "Torah", "Holy Light", "Tome", "Scroll", "Guru", "The King in Yellow", "Ithaqua", "Trinary", "Stars", "Scrapbook", "Atheist", "Necronomicon"))
switch(new_book_style)
if("Bible")
icon_state = "bible"
@@ -239,7 +239,7 @@ Frequency:
else
teleport_options["[A.name] (Inactive)"] = P
teleport_options["None (Dangerous)"] = null
var/teleport_choice = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") as null|anything in teleport_options
var/teleport_choice = tgui_input_list(user, "Please select a teleporter to lock in on.", "Hand Teleporter", teleport_options)
if(!teleport_choice)
return
var/old_pad = linked_pad
+1 -1
View File
@@ -34,7 +34,7 @@
var/singleton/sign/double/B = GET_SINGLETON(sign)
sign_index["[B.name]"] = B
var/sign_choice = input("What should the sign be changed to?") as null|anything in sign_index
var/sign_choice = tgui_input_list(usr, "What should the sign be changed to?", "Bar Sign", sign_index)
if(!sign_choice)
return
var/singleton/sign/double/signselect = sign_index[sign_choice]
+1 -2
View File
@@ -94,12 +94,11 @@
/obj/structure/morgue/attackby(obj/P, mob/user)
if(P.ispen())
var/t = input(user, "What would you like the label to be?", name) as text
var/t = tgui_input_text(user, "What would you like the label to be?", "Morgue", "", MAX_NAME_LEN)
if(user.get_active_hand() != P)
return
if((!in_range(src, usr) > 1 && src.loc != user))
return
t = sanitizeSafe(t, MAX_NAME_LEN)
if(t)
name = "[initial(name)] - '[t]'"
else
+1 -1
View File
@@ -41,7 +41,7 @@
/obj/item/sign/attackby(obj/item/tool, mob/user) // Construction.
if(tool.isscrewdriver() && isturf(user.loc))
var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
var/direction = tgui_input_list(user, "In which direction?", "Select Direction", list("North", "East", "South", "West", "Cancel"))
if(direction == "Cancel") return
if(QDELETED(src)) //Prevents spawning multiple new signs with queued dialogues
return
+1 -2
View File
@@ -123,8 +123,7 @@
to_chat(user, "You must stand in whisper range of [H].")
return
text = input("What would you like to suggest?", "Hypnotic suggestion", null, null)
text = sanitize(text)
text = tgui_input_text(user, "What would you like to suggest?", "Hypnotic Suggestion")
if(!text)
return
@@ -71,7 +71,7 @@
var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[href_list["change_underwear"]]
if(!UWC)
return
var/datum/category_item/underwear/selected_underwear = input(H, "Choose underwear:", "Choose underwear", H.all_underwear[UWC.name]) as null|anything in UWC.items
var/datum/category_item/underwear/selected_underwear = tgui_input_list(H, "Choose your underwear.", "Choose Underwear", UWC.items, H.all_underwear[UWC.name])
if(selected_underwear && CanUseTopic(H, default_state))
H.all_underwear[UWC.name] = selected_underwear
H.hide_underwear[UWC.name] = FALSE
+1 -1
View File
@@ -410,7 +410,7 @@
set name = "Set transfer amount"
set category = "Object"
set src in view(1)
var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts
var/N = tgui_input_list(usr, "Set the amount to transfer from this.", "[src]", possible_transfer_amounts)
if (N)
amount_per_transfer_from_this = N