Replace tgalert with tgui_alert (#55157)

Adds TGUI-based alerts to replace the old tgalert system. Replaces all uses of tgalert with tgui_alert except for one, the 'Report Issue' button, as people were (understandably) concerned that this button using tgui will prevent a tgui bug from being easily reported.

These windows have a nice little progress bar indicator of how much time they have left, and will automatically close themselves after this time elapses.

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
Bobbahbrown
2020-11-25 22:46:19 +02:00
committed by GitHub
co-authored by Aleksej Komarov
parent 4e66e88ae8
commit 1b0b13a737
16 changed files with 309 additions and 33 deletions
+3 -3
View File
@@ -844,7 +844,7 @@
return
if (SSticker.HasRoundStarted())
if (askuser(usr, "The game has already started. Would you like to save this as the default mode effective next round?", "Save mode", "Yes", "Cancel", Timeout = null) == 1)
if (tgui_alert(usr, "The game has already started. Would you like to save this as the default mode effective next round?", "Save mode", list("Yes", "Cancel"), timeout = 0) == "Yes")
SSticker.save_mode(href_list["c_mode2"])
HandleCMode()
return
@@ -853,7 +853,7 @@
message_admins("<span class='adminnotice'>[key_name_admin(usr)] set the mode as [GLOB.master_mode].</span>")
to_chat(world, "<span class='adminnotice'><b>The mode is now: [GLOB.master_mode]</b></span>", confidential = TRUE)
Game() // updates the main game menu
if (askuser(usr, "Would you like to save this as the default mode for the server?", "Save mode", "Yes", "No", Timeout = null) == 1)
if (tgui_alert(usr, "Would you like to save this as the default mode for the server?", "Save mode", list("Yes", "No"), timeout = 0) == "Yes")
SSticker.save_mode(GLOB.master_mode)
HandleCMode()
@@ -2298,7 +2298,7 @@
to_chat(usr, "<span class='warning'>The round must be in progress to use this!</span>")
return
var/mob/heart_recepient = locate(href_list["admincommend"])
if(tgalert(usr, "Are you sure you'd like to anonymously commend [heart_recepient.ckey]? NOTE: This is logged, please use this sparingly and only for actual kind behavior, not as a reward for your friends.", "<3?", "Yes", "No") == "No")
if(tgui_alert(usr, "Are you sure you'd like to anonymously commend [heart_recepient.ckey]? NOTE: This is logged, please use this sparingly and only for actual kind behavior, not as a reward for your friends.", "<3?", list("Yes", "No")) == "No")
return
usr.nominate_heart(heart_recepient)
@@ -5,7 +5,7 @@
var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL items)
if(tgalert(src, "Are you sure you'd like to mass-modify every instance of the [var_name] variable?", "This can break everything if you do not know what you are doing.", "Yes", "No") != "Yes")
if(tgui_alert(src, "Are you sure you'd like to mass-modify every instance of the [var_name] variable? This can break everything if you do not know what you are doing.", "Slow down, chief!", list("Yes", "No")) != "Yes")
return
if(!check_rights(R_VAREDIT))