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:
Tacolizard
2017-07-10 07:55:17 -07:00
committed by Jordan Brown
parent c575839cab
commit 76edcf1c40
3 changed files with 31 additions and 15 deletions

View File

@@ -34,6 +34,8 @@ SUBSYSTEM_DEF(ticker)
var/delay_end = 0 //if set true, the round will not restart on it's own 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/triai = 0 //Global holder for Triumvirate
var/tipped = 0 //Did we broadcast the tip of the day yet? var/tipped = 0 //Did we broadcast the tip of the day yet?
var/selected_tip // What will be the tip of the day? var/selected_tip // What will be the tip of the day?

View File

@@ -425,6 +425,14 @@
var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)") var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)")
if(world.RunningService()) if(world.RunningService())
options += "Service Restart (Force restart DD)"; options += "Service Restart (Force restart DD)";
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 var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
if(result) 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! SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -349,9 +349,15 @@
if(!check_rights(R_SERVER)) if(!check_rights(R_SERVER))
return 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 SSticker.delay_end = !SSticker.delay_end
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].") var/reason = SSticker.delay_end ? "for reason: [SSticker.admin_delay_notice]" : "."//laziness
message_admins("<span class='adminnotice'>[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].</span>") 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" href_list["secrets"] = "check_antagonist"
else if(href_list["end_round"]) else if(href_list["end_round"])