mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user