[MIRROR] Replace tgalert with tgui_alert, a new TGUI-based alert system (#1833)

* Replace tgalert with tgui_alert, a new TGUI-based alert system

* a

* a

Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2020-11-26 08:05:45 +00:00
committed by GitHub
co-authored by Bobbahbrown Gandalf
parent 890295bb7d
commit 89a21458b5
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))