private void buttonSkip_Click(object sender, EventArgs e) { this.Close(); MessageBox.Show("Level One Skipped at " + Welcome.duration.ToString()); BreachTwo level2 = new BreachTwo(); level2.Show(); }
private void timerOne_Tick(object sender, EventArgs e) { //if (Welcome.duration.TotalSeconds <= 0) //{ // //if (Form.ActiveForm != this) // //{ // //MessageBox.Show("This"); // this.Close(); //} if (Welcome.duration.TotalSeconds > 0) { labelTimer.Text = Welcome.duration.ToString(); if (Data.phase1Correct[0] == 1) { button1.Enabled = false; button1.BackColor = Color.FromArgb(18, 23, 26); } if (Data.phase1Correct[1] == 1) { button2.Enabled = false; button2.BackColor = Color.FromArgb(18, 23, 26); } if (Data.phase1Correct[2] == 1) { button3.Enabled = false; button3.BackColor = Color.FromArgb(18, 23, 26); } if (Data.phase1Correct[3] == 1) { button4.Enabled = false; button4.BackColor = Color.FromArgb(18, 23, 26); } if (Data.phase1Correct[4] == 1) { button5.Enabled = false; button5.BackColor = Color.FromArgb(18, 23, 26); } if ((int)(Data.phase1Correct.Average()) == 1) { timerOne.Stop(); Welcome.activeSession.timerMain.Stop(); this.Close(); MessageBox.Show("Level One Completed at " + Welcome.duration.ToString()); BreachTwo phase2 = new BreachTwo(); Welcome.activeSession.timerMain.Start(); phase2.Show(); } } }