[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
+4 -5
View File
@@ -600,7 +600,7 @@ var/global/floorIsLava = 0
if (!usr.client.holder)
return
var/confirm = alert(usr, "Restart the game world?", "Restart", "Yes", "Cancel") // Not tgui_alert for safety
if(confirm == "Cancel")
if(!confirm || confirm == "Cancel")
return
if(confirm == "Yes")
to_world("<span class='danger'>Restarting world!</span> <span class='notice'>Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!</span>")
@@ -995,7 +995,7 @@ var/datum/announcement/minor/admin_min_announcer = new
set desc="Reboots the server post haste"
set name="Immediate Reboot"
if(!usr.client.holder) return
if(alert(usr, "Reboot server?","Reboot!","Yes","No") == "No") // Not tgui_alert for safety
if(alert(usr, "Reboot server?","Reboot!","Yes","No") != "Yes") // Not tgui_alert for safety
return
to_world("[span_red("<b>Rebooting world!</b>")] [span_blue("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!")]")
log_admin("[key_name(usr)] initiated an immediate reboot.")
@@ -1532,9 +1532,8 @@ var/datum/announcement/minor/admin_min_announcer = new
var/shouldStamp = 1
if(!P.sender) // admin initiated
switch(tgui_alert(usr, "Would you like the fax stamped?","Stamped?", list("Yes", "No")))
if("No")
shouldStamp = 0
if(tgui_alert(usr, "Would you like the fax stamped?","Stamped?", list("Yes", "No")) != "Yes")
shouldStamp = 0
if(shouldStamp)
P.stamps += "<hr><i>This paper has been stamped by the [P.origin] Quantum Relay.</i>"