default tgui alert input handling (#16241)

* default handling

* do not push that

* fix

* .

* .
This commit is contained in:
Kashargul
2024-09-02 04:27:26 +10:00
committed by GitHub
parent 6d0077890c
commit 2f19f66cc5
99 changed files with 248 additions and 173 deletions
+2 -2
View File
@@ -617,7 +617,7 @@
return
var/confirm = tgui_alert(creator, "Are you sure you want to change [oldA.name] into a new area named [str]?", "READ CAREFULLY", list("No", "Yes"))
if(confirm == "No")
if(confirm != "Yes")
to_chat(creator, "<span class='warning'>No changes made.</span>")
return
@@ -626,7 +626,7 @@
newA.has_gravity = oldA.has_gravity
else
var/confirm = tgui_alert(creator, "Are you sure you want to change [oldA.name] into [area_choice]?", "READ CAREFULLY", list("No", "Yes"))
if(confirm == "No")
if(confirm != "Yes")
to_chat(creator, "<span class='warning'>No changes made.</span>")
return
newA = area_choice //They selected to turn the area they're standing on into the selected area.
@@ -287,7 +287,7 @@
return //something is terribly wrong
var/confirm = tgui_alert(src, "Would you like to talk as [src.client.prefs.real_name], over a communicator? This will reset your respawn timer, if someone answers.", "Join as Voice?", list("Yes","No"))
if(confirm == "No")
if(confirm != "Yes")
return
if(config.antag_hud_restricted && has_enabled_antagHUD == 1)
+1 -1
View File
@@ -24,7 +24,7 @@
return
else
var/answer = tgui_alert(user, "Would you like to activate this personal emergency beacon?","\The [src]", list("Yes", "No"))
if(answer == "No")
if(answer != "Yes")
return
else if(do_after(user, (3 SECONDS))) //short delay, so they can still abort if they want to
user.visible_message("<span class='warning'>[user] activates \the [src]!</span>","<span class='warning'>You activate \the [src], spiking it into the ground!</span>")
+3 -3
View File
@@ -34,9 +34,6 @@
/obj/item/device/multitool/attack_self(mob/living/user)
var/choice = tgui_alert(usr, "What do you want to do with \the [src]?", "Multitool Menu", list("Switch Mode", "Clear Buffers", "Cancel"))
switch(choice)
if("Cancel")
to_chat(user,"<span class='notice'>You lower \the [src].</span>")
return
if("Clear Buffers")
to_chat(user,"<span class='notice'>You clear \the [src]'s memory.</span>")
buffer = null
@@ -48,6 +45,9 @@
accepting_refs = 1
if("Switch Mode")
mode_switch(user)
else
to_chat(user,"<span class='notice'>You lower \the [src].</span>")
return
update_icon()
+1 -1
View File
@@ -77,7 +77,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
return
var/choice = tgui_alert(user, "You sure you want to inhabit this PAI, or submit yourself to being recruited?", "Confirmation", list("Inhabit", "Recruit", "Cancel"))
if(choice == "Cancel")
if(!choice || choice == "Cancel")
return ..()
if(choice == "Recruit")
paiController.recruitWindow(user)
@@ -32,11 +32,11 @@
opposite_catastasis = "BROAD"
catastasis = "STANDARD"
switch( tgui_alert(usr, "Current receiver spectrum is set to: [catastasis]","Multitool-Circuitboard interface",list("Switch to [opposite_catastasis]","Cancel")) )
switch(tgui_alert(usr, "Current receiver spectrum is set to: [catastasis]","Multitool-Circuitboard interface",list("Switch to [opposite_catastasis]","Cancel")))
if("Switch to STANDARD","Switch to BROAD")
src.contraband_enabled = !src.contraband_enabled
if("Cancel")
if("Cancel", null)
return
else
to_chat(user, "DERP! BUG! Report this (And what you were doing to cause it) to Agouri")
@@ -38,7 +38,9 @@
if(!registered_user && register_user(user))
to_chat(user, "<span class='notice'>The microscanner marks you as its owner, preventing others from accessing its internals.</span>")
if(registered_user == user)
switch(tgui_alert(usr, "Would you like edit the ID, or show it?","Show or Edit?", list("Edit","Show")))
switch(tgui_alert(usr, "Would you like to edit the ID, or show it?","Show or Edit?", list("Edit","Show")))
if(null)
return
if("Edit")
agentcard_module.tgui_interact(user)
if("Show")
+3 -1
View File
@@ -13,9 +13,11 @@
if(tgui_alert(user, "Should this portal shrink people who are over the limit, or grow people who are under the limit?", "Change portal size settings", list("Shrink","Grow")) == "Shrink")
shrinking = TRUE
our_message = "What should the size limit be? Anyone over this limit will be shrunk to this size. (1 = 100%, etc)"
else
else if (our_message == "Grow")
shrinking = FALSE
our_message = "What should the size limit be? Anyone under this limit will be grown to this size. (1 = 100%, etc)"
else
return ..()
size_limit = tgui_input_number(user, our_message, "Pick a Size", 1, round_value=FALSE)
+3 -3
View File
@@ -103,7 +103,7 @@
/obj/item/canvas/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/paint_palette))
var/choice = tgui_alert(user, "Adjusting the base color of this canvas will replace ALL pixels with the selected color. Are you sure?", "Confirm Color Fill", list("Yes", "No"))
if(choice == "No")
if(choice != "Yes")
return
var/basecolor = input(user, "Select a base color for the canvas:", "Base Color", canvas_color) as null|color
if(basecolor && Adjacent(user) && user.get_active_hand() == I)
@@ -550,7 +550,7 @@
Author's Name: [author_name]. \n \
Author's CKey: [author_ckey]"))
if(tgui_alert(usr, "Check your chat log (if filtering for notices, check where you don't) for painting details.",
"Is this the painting you want?", list("Yes", "No")) == "No")
"Is this the painting you want?", list("Yes", "No")) != "Yes")
return 0
if(!fexists("data/persistent/paintings/[persistence_id]/[painting["md5"]].png"))
to_chat(usr, span_warning("Chosen painting could not be loaded! Incident was logged, but no action taken at this time"))
@@ -589,7 +589,7 @@
if(tgui_alert(usr, "No painting list ID was given. You may obtain such by debugging SSPersistence and checking the all_paintings entry. \
If you do not wish to do that, you may request a list to be generated of painting titles. This might be resource intensive. \
Proceed? It will likely have over 500 entries", "Generate list?", list("Proceed!", "Cancel")) == "Cancel")
Proceed? It will likely have over 500 entries", "Generate list?", list("Proceed!", "Cancel")) != "Proceed!")
return
log_debug("[usr] generated list of paintings from SSPersistence")
@@ -87,7 +87,7 @@
if (not_has_ooc_text(M))
return
while(finalized == "No" && M.client)
while(finalized != "Yes" && M.client)
choice = tgui_input_list(M, "What type of predator do you want to play as?", "Maintpred Choice", possible_mobs)
if(!choice) //We probably pushed the cancel button on the mob selection. Let's just put the ghost pod back in the list.
to_chat(M, "<span class='notice'>No mob selected, cancelling.</span>")
@@ -53,7 +53,7 @@
/obj/structure/ghost_pod/manual/attack_hand(var/mob/living/user)
if(!used)
if(confirm_before_open)
if(tgui_alert(user, "Are you sure you want to touch \the [src]?", "Confirm", list("No", "Yes")) == "No")
if(tgui_alert(user, "Are you sure you want to touch \the [src]?", "Confirm", list("No", "Yes")) != "Yes")
return
trigger()
// VOREStation Addition Start
@@ -51,7 +51,7 @@
return
var/confirm = tgui_alert(usr, "Do you want to try to rotate \the [src]?", "[name]", list("Yes", "No"))
if(confirm == "No")
if(confirm != "Yes")
visible_message(\
"<span class='notice'>[user.name] decides not to try turning \the [src].</span>",\
"<span class='notice'>You decide not to try turning \the [src].</span>")
@@ -157,7 +157,7 @@
..()
var/confirm = tgui_alert(usr, "Do you want to try to rotate \the [src]?", "[name]", list("Yes", "No"))
if(confirm == "No")
if(confirm != "Yes")
visible_message(\
"<span class='notice'>[user.name] decides not to try turning \the [src].</span>",\
"<span class='notice'>You decide not to try turning \the [src].</span>")
@@ -186,7 +186,7 @@
new_bearing = round(compass_directions[choice])
confirm = tgui_alert(usr, "Are you certain you want to rotate \the [src]?", "[name]", list("Yes", "No"))
if(confirm == "No")
if(confirm != "Yes")
visible_message(\
"<span class='notice'>[user.name] decides not to try turning \the [src].</span>",\
"<span class='notice'>You decide not to try turning \the [src].</span>")