Merge pull request #7150 from VOREStation/sscleanup/ticker

Refactor the gameticker controller into SSticker
This commit is contained in:
Leshana
2020-04-11 19:28:37 -04:00
committed by GitHub
12 changed files with 612 additions and 543 deletions
+21 -16
View File
@@ -871,21 +871,26 @@ var/datum/announcement/minor/admin_min_announcer = new
/datum/admins/proc/startnow()
set category = "Server"
set desc="Start the round RIGHT NOW"
set desc="Start the round ASAP"
set name="Start Now"
if(!ticker)
alert("Unable to start the game as it is not set up.")
if(!check_rights(R_SERVER|R_EVENT))
return
if(ticker.current_state == GAME_STATE_PREGAME)
ticker.current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
log_admin("[usr.key] has started the game.")
message_admins("<font color='blue'>[usr.key] has started the game.</font>")
feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return 1
else
if(SSticker.current_state > GAME_STATE_PREGAME)
to_chat(usr, "<font color='red'>Error: Start Now: Game has already started.</font>")
return 0
return
if(!SSticker.start_immediately)
SSticker.start_immediately = TRUE
var/msg = ""
if(SSticker.current_state == GAME_STATE_INIT)
msg = " (The server is still setting up, but the round will be started as soon as possible.)"
log_admin("[key_name(usr)] has started the game.[msg]")
message_admins("<font color='blue'>[key_name_admin(usr)] has started the game.[msg]</font>")
feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
else
SSticker.start_immediately = FALSE
to_chat(world, "<b>Immediate game start canceled. Normal startup resumed.</b>")
log_and_message_admins("cancelled immediate game start.")
/datum/admins/proc/toggleenter()
set category = "Server"
@@ -952,10 +957,10 @@ var/datum/announcement/minor/admin_min_announcer = new
set name="Delay"
if(!check_rights(R_SERVER|R_EVENT)) return
if (!ticker || ticker.current_state != GAME_STATE_PREGAME)
ticker.delay_end = !ticker.delay_end
log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
message_admins("<font color='blue'>[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].</font>", 1)
if (SSticker.current_state >= GAME_STATE_PLAYING)
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("<font color='blue'>[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].</font>", 1)
return //alert("Round end delayed", null, null, null, null, null)
round_progressing = !round_progressing
if (!round_progressing)