[MIRROR] default tgui alert input handling (#8891)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
CHOMPStation2
2024-09-01 15:28:35 -07:00
committed by GitHub
parent ec8834f9e5
commit 9f42148ab1
106 changed files with 675 additions and 178 deletions

View File

@@ -196,7 +196,7 @@
if(!occupant)
return
if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) == "No")
if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) != "Yes")
return
if(avatar)
@@ -233,7 +233,7 @@
avatar = occupant.vr_link
// If they've already enterred VR, and are reconnecting, prompt if they want a new body
if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) == "No")
if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) != "Yes")
// Delink the mob
occupant.vr_link = null
avatar = null

View File

@@ -194,7 +194,7 @@
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)

View File

@@ -75,7 +75,7 @@
if(self_bind)
var/choice = tgui_alert(usr,"This will bind YOUR mind to the target! You may not be able to go back without help. Continue?","Confirmation",list("Continue","Cancel"))
if(choice == "Cancel") return
if(!choice || choice == "Cancel") return
choice = tgui_alert(usr,"No really. You cannot OOC Escape this. Are you sure?","Confirmation",list("Yes I'm sure","Cancel"))
if(choice == "Yes I'm sure" && usr.get_active_hand() == src && usr.Adjacent(target))
usr.visible_message("<span class='warning'>[usr] presses [src] against [target]. The device beginning to let out a series of beeps!</span>","<span class='notice'>You begin to bind yourself into [target]!</span>")
@@ -119,7 +119,7 @@
if(self_bind)
var/choice = tgui_alert(usr,"This will bind YOUR mind to the target! You will not be able to go back without help. Continue?","Confirmation",list("Continue","Cancel"))
if(choice == "Cancel") return
if(!choice || choice == "Cancel") return
choice = tgui_alert(usr,"No really. You cannot OOC Escape this. Are you sure?","Confirmation",list("Yes I'm sure","Cancel"))
if(choice == "Yes I'm sure" && usr.get_active_hand() == src && usr.Adjacent(item))
log_and_message_admins("attempted to bind themselves to \an [item] with a Mind Binder.")

View File

@@ -27,7 +27,10 @@
feedback_add_details("admin_verb","Mentorhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(current_ticket)
if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No")
var/input = tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No"))
if(!input)
return
if(input == "Yes")
if(current_ticket)
log_admin("Mentorhelp: [key_name(src)]: [msg]")
current_ticket.MessageNoRecipient(msg)
@@ -95,7 +98,10 @@
feedback_add_details("admin_verb","Adminhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(current_ticket)
if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No")
var/input = tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No"))
if(!input)
return
if(input == "Yes")
if(current_ticket)
current_ticket.MessageNoRecipient(msg)
to_chat(usr, "<span class='adminnotice'>PM to-<b>Admins</b>: [msg]</span>")
@@ -159,7 +165,7 @@
to_chat(usr, "<span class='danger'>Error: You cannot request spice (muted from adminhelps).</span>")
return
if(tgui_alert(usr, "Are you sure you want to request the admins spice things up for you? You accept the consequences if you do.","Spicy!",list("Yes","No")) != "No")
if(tgui_alert(usr, "Are you sure you want to request the admins spice things up for you? You accept the consequences if you do.","Spicy!",list("Yes","No")) == "Yes")
message_admins("[ADMIN_FULLMONTY(usr)] has requested the round be spiced up a little.")
to_chat(usr, "<span class='notice'>You have requested some more spice in your round.</span>")
else

View File

@@ -132,7 +132,10 @@
feedback_add_details("admin_verb","Admincreatedticket") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(player.current_ticket)
if(tgui_alert(usr, "The player already has a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No")
var/input = tgui_alert(usr, "The player already has a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No"))
if(!input)
return
if(input == "Yes")
if(player.current_ticket)
player.current_ticket.MessageNoRecipient(ticket_text)
to_chat(usr, "<span class='adminnotice'>PM to-<b>Admins</b>: [ticket_text]</span>")

View File

@@ -459,11 +459,12 @@
if(is_taken_over()) return
if(!istype(M) || !gem) return
if(!gem.owner) return
if((tgui_alert(gem.owner, "Do you want to allow [owner] to transfer [selected_soul] to your soulcatcher?", "Allow Transfer", list("No", "Yes")) == "Yes"))
if(!in_range(gem.owner, owner))
return
if(!(gem.owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TRANSFER))
return
if((tgui_alert(gem.owner, "Do you want to allow [owner] to transfer [selected_soul] to your soulcatcher?", "Allow Transfer", list("No", "Yes")) != "Yes"))
return
if(!in_range(gem.owner, owner))
return
if(!(gem.owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TRANSFER))
return
if(M.mind == own_mind)
own_mind = null
brainmobs -= M