private void BreakTimer_Tick(object sender, EventArgs e) { if (minutesLeft <= 0 && secondsLeft <= 0) { BreakTimer.Stop(); PreFocusPage preFocus = new PreFocusPage(); preFocus.Show(); preFocus.SetDesktopLocation(this.Bounds.X, this.Bounds.Y); preFocus.Activate(); if (hideTaskbar) { Taskbar.Hide(); } this.Hide(); } if (minutesLeft != 0 && secondsLeft == 0) { minutesLeft--; secondsLeft = 59; } else { secondsLeft--; } BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0'); }
private void BreakPage_Load(object sender, EventArgs e) { Taskbar.Show(); BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0'); BreakTimer.Start(); }
public void Stop() { Timer.Stop(); BreakTimer.Stop(); IsRunning = false; }
private void SetupButton_Click(object sender, EventArgs e) { SetupPage setup = new SetupPage(); setup.Show(); setup.SetDesktopLocation(this.Bounds.X, this.Bounds.Y); BreakTimer.Stop(); this.Hide(); }
/// <summary> /// Initialize all variables needed for this script to run. /// </summary> void Start () { timer = GetComponent<Timer>(); timer.SetLengthOfTimer(halfLength + 1); timer.Pause(); referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); scoreKeeper = gameController.GetComponent<ScoreKeeper>(); ballReset = gameController.GetComponent<BallReset>(); breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); }
/// <summary> /// Retrieve the necessary object and script references /// </summary> void Start() { GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); gameTimer = gameController.GetComponent<GameTimer>(); scoreKeeper = gameController.GetComponent<ScoreKeeper>(); referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); timer = gameObject.GetComponent<Timer>(); timer.SetLengthOfTimer(announcementPauseLength); }
/// <summary> /// Gets the objects and initializes the variables to their proper values. /// </summary> void Start () { if (isServer) { BlueTeamScore = 0; RedTeamScore = 0; } GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); GT = gameController.GetComponent<GameTimer>(); BR = gameController.GetComponent<BallReset>(); Ref = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); BT = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); }
private void CompleteBreak() { BreakTimer.Stop(); CurrentPosition++; Timer.Interval = Doros[CurrentPosition].Duration; Timer.Start(); IsBreak = false; DoroStartTime = DateTime.Now; Tick(new DoroTimerEvent(DoroTimerEvent.STARTED_DORO, Doros[CurrentPosition])); }
/// <summary> /// Load user configuration from disk. /// </summary> public void LoadUserConfiguration() { BreakTimer configuration = UserConfigurationManager.Load <BreakTimer>(); if (configuration == null) { BreakTimer defaultConfiguration = new BreakTimer { Frequency = 0, Length = 0, IdleResetTime = 0 }; BreakTimer = defaultConfiguration; } else { BreakTimer = configuration; } }
/// <summary> /// Initializes all of the objects and variables needed for this script. /// </summary> void Start () { GameObject GameController = GameObject.FindGameObjectWithTag("GameController"); REF = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); BR = GameController.GetComponent<BallReset>(); GT = GameController.GetComponent<GameTimer>(); BT = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); ballPossession = ball.GetComponent<Possession>(); ballLocation = ball.GetComponent<ListObjectLocation>(); timer = gameObject.AddComponent<Timer>(); timer.SetLengthOfTimer(TimerFoulTime); timer.Resume(); DeadBallTimer = gameObject.AddComponent<Timer>(); DeadBallTimer.SetLengthOfTimer(DeadBallTime); DeadBallTimer.Pause(); }
private void CompleteDoro() { Timer.Stop(); Tick(new DoroTimerEvent(DoroTimerEvent.FINISHED_DORO, Doros[CurrentPosition])); if (CurrentPosition + 1 == Doros.Count) { Tick(new DoroTimerEvent(DoroTimerEvent.FINISHED, null)); IsRunning = false; return; } BreakStartTime = DateTime.Now; BreakTimer.Interval = Doros[CurrentPosition].BreakDuration; BreakTimer.Start(); IsBreak = true; }