private void MainMenu_ButtonClicked(object sender, ButtonClickedEventArgs eventargs) { switch (eventargs.Button) { case ButtonNames.Play: var newGameState = new GameState(StateManager.CurrentState, eventargs.Time); newGameState.LoadButtons(); StateManager.CurrentState = newGameState; break; case ButtonNames.Solve: var newSolveState = new SolveState(StateManager.CurrentState); newSolveState.LoadButtons(); StateManager.CurrentState = newSolveState; break; case ButtonNames.Help: var newHelpState = new HelpState(StateManager.CurrentState); newHelpState.LoadButtons(); StateManager.CurrentState = newHelpState; break; case ButtonNames.About: var newAboutState = new AboutState(StateManager.CurrentState); newAboutState.LoadButtons(); StateManager.CurrentState = newAboutState; break; } }
private void button1_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you really sure you want to close this Daj?") == DialogResult.OK) { aboutState = AboutState.FadingOut; } }
private void timer1_Tick(object sender, EventArgs e) { switch (aboutState) { case AboutState.FadingIn: this.Opacity += .20; if (this.Opacity == 1.0) { aboutState = AboutState.Running; timer1.Interval = 50; } break; case AboutState.Showing: aboutState = AboutState.FadingOut; timer1.Interval = 50; break; case AboutState.FadingOut: this.Opacity -= .10; if (this.Opacity == 0.0) { this.Close(); } break; } }
public static void Initialize(Scene scene) { Scene = scene; menuState = new MenuState(); settingState = new SettingState(); aboutState = new AboutState(); overwriteState = new OverwriteState(); gameState = new PlayState(); pauseState = new PauseState(); restartState = new RestartState(); winningState = new WinningState(); winAllState = new WinAllState(); exitGameState = new ExitGameState(); exitAppState = new ExitAppState(); InitializeGame(); }
private void About_MouseDown(object sender, MouseEventArgs e) { aboutState = AboutState.FadingOut; }
private void About_KeyDown(object sender, KeyEventArgs e) { aboutState = AboutState.FadingOut; }
private void aboutText_MouseClick(object sender, MouseEventArgs e) { aboutState = AboutState.FadingOut; }
private void pictureBox1_Click(object sender, EventArgs e) { aboutState = AboutState.FadingOut; }