Allows you to cancel TGUI alerts (#61072)

This was requested by someone downstream. Some TGUI alerts offer two options e.g. (Kill Bob, Kill Janice), In byond alerts you'd be able to cancel by pressing the X, but tgui alerts don't support this. I've added an option to enable the normal X in the top right, so you can cancel out of alerts if you enable it.
This commit is contained in:
AMonkeyThatCodes
2021-08-29 13:09:16 +03:00
committed by GitHub
parent 42a75013d0
commit a0e9bbea35
5 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -1208,7 +1208,7 @@
return
if(href_list[VV_HK_DEADCHAT_PLAYS] && check_rights(R_FUN))
if(tgui_alert(usr, "Allow deadchat to control [src] via chat commands?", "Deadchat Plays [src]", list("Allow", "Cancel")) == "Cancel")
if(tgui_alert(usr, "Allow deadchat to control [src] via chat commands?", "Deadchat Plays [src]", list("Allow", "Cancel")) != "Allow")
return
// Alert is async, so quick sanity check to make sure we should still be doing this.
@@ -221,7 +221,7 @@
return
current_pad.display_name = new_name
if("remove")
if(usr && tgui_alert(usr, "Are you sure?", "Unlink Launchpad", list("I'm Sure", "Abort")) != "Abort")
if(usr && tgui_alert(usr, "Are you sure?", "Unlink Launchpad", list("I'm Sure", "Abort")) == "I'm Sure")
launchpads -= current_pad
selected_id = null
. = TRUE
@@ -154,7 +154,7 @@
return
current_pad.display_name = new_name
if("remove")
if(usr && tgui_alert(usr, "Are you sure?", "Unlink Orbital Pad", list("I'm Sure", "Abort")) != "Abort")
if(usr && tgui_alert(usr, "Are you sure?", "Unlink Orbital Pad", list("I'm Sure", "Abort")) == "I'm Sure")
mechpads -= current_pad
LAZYREMOVE(current_pad.consoles, src)
selected_id = null
+1 -1
View File
@@ -385,7 +385,7 @@
our_pad.display_name = new_name
if("remove")
. = TRUE
if(usr && tgui_alert(usr, "Are you sure?", "Unlink Launchpad", list("I'm Sure", "Abort")) != "Abort")
if(usr && tgui_alert(usr, "Are you sure?", "Unlink Launchpad", list("I'm Sure", "Abort")) == "I'm Sure")
our_pad = null
if("launch")
sending = TRUE
+1 -2
View File
@@ -71,8 +71,7 @@ export class AlertModal extends Component {
<Window
title={title}
width={350}
height={150}
canClose={timeout > 0}>
height={150}>
{timeout && <Loader value={timeout} />}
<Window.Content
onFocus={focusCurrentButton}