mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Allows admins to set messages when they delay the round end (#29064)
* initial * fixes * changes * move to SSticker * logging * msg changes * fix * Jordie changes * remove span * change if * fix * cyberboss review
This commit is contained in:
@@ -34,6 +34,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
var/delay_end = 0 //if set true, the round will not restart on it's own
|
||||
|
||||
var/admin_delay_notice = "" //a message to display to anyone who tries to restart the world after a delay
|
||||
|
||||
var/triai = 0 //Global holder for Triumvirate
|
||||
var/tipped = 0 //Did we broadcast the tip of the day yet?
|
||||
var/selected_tip // What will be the tip of the day?
|
||||
|
||||
@@ -425,19 +425,27 @@
|
||||
var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)")
|
||||
if(world.RunningService())
|
||||
options += "Service Restart (Force restart DD)";
|
||||
var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
|
||||
if(result)
|
||||
SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
switch(result)
|
||||
if("Regular Restart")
|
||||
SSticker.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10)
|
||||
if("Hard Restart (No Delay, No Feeback Reason)")
|
||||
world.Reboot()
|
||||
if("Hardest Restart (No actions, just reboot)")
|
||||
world.Reboot(fast_track = TRUE)
|
||||
if("Service Restart (Force restart DD)")
|
||||
GLOB.reboot_mode = REBOOT_MODE_HARD
|
||||
world.ServiceReboot()
|
||||
|
||||
var/rebootconfirm
|
||||
if(SSticker.admin_delay_notice)
|
||||
if(alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") == "Yes")
|
||||
rebootconfirm = TRUE
|
||||
else
|
||||
rebootconfirm = TRUE
|
||||
if(rebootconfirm)
|
||||
var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
|
||||
if(result)
|
||||
SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
switch(result)
|
||||
if("Regular Restart")
|
||||
SSticker.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10)
|
||||
if("Hard Restart (No Delay, No Feeback Reason)")
|
||||
world.Reboot()
|
||||
if("Hardest Restart (No actions, just reboot)")
|
||||
world.Reboot(fast_track = TRUE)
|
||||
if("Service Restart (Force restart DD)")
|
||||
GLOB.reboot_mode = REBOOT_MODE_HARD
|
||||
world.ServiceReboot()
|
||||
|
||||
/datum/admins/proc/end_round()
|
||||
set category = "Server"
|
||||
|
||||
@@ -349,9 +349,15 @@
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if(!SSticker.delay_end)
|
||||
SSticker.admin_delay_notice = input(usr, "Enter a reason for delaying the round end", "Round Delay Reason") as null|text
|
||||
if(!SSticker.admin_delay_notice)
|
||||
return
|
||||
SSticker.delay_end = !SSticker.delay_end
|
||||
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("<span class='adminnotice'>[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].</span>")
|
||||
var/reason = SSticker.delay_end ? "for reason: [SSticker.admin_delay_notice]" : "."//laziness
|
||||
var/msg = "[SSticker.delay_end ? "delayed" : "undelayed"] the round end [reason]"
|
||||
log_admin("[key_name(usr)] [msg]")
|
||||
message_admins("[key_name_admin(usr)] [msg]")
|
||||
href_list["secrets"] = "check_antagonist"
|
||||
|
||||
else if(href_list["end_round"])
|
||||
|
||||
Reference in New Issue
Block a user