Beispiel #1
0
        /// <summary>
        /// Event handler for when the Quit Game menu entry is selected.
        /// </summary>
        void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            const string message = "Are you sure you want to quit this game?";

            MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);

            confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
        }
Beispiel #2
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to quit" message box. This uses the loading screen to
 /// transition from the game back to the main menu screen.
 /// </summary>
 void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(),
                                                    new MainMenuScreen());
 }
Beispiel #3
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(optionsMenu, e.PlayerIndex);
 }
Beispiel #4
0
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 void pongMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen(optionsMenu.hand, optionsMenu.difficulty, optionsMenu.gameplay));
 }
Beispiel #5
0
 void HowToMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(howToScreen, e.PlayerIndex);
 }
Beispiel #6
0
 void Level3MenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new Level3Screen(optionsMenu.hand, optionsMenu.difficulty));
 }
Beispiel #7
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
        void PlayersMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentPlayability++;
            gameplay++;

            if (currentPlayability > Players.TwoPlayer)
            {
                currentPlayability = 0;
                gameplay = 0;
            }
            SetMenuEntryText();
        }
        /// <summary>
        /// Event handler for when the Ungulate menu entry is selected.
        /// </summary>
        void HandednessMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentUngulate++;
            if (hand == true)
                hand = false;
            else
                hand = true;

            if (currentUngulate > Handedness.Right)
                currentUngulate = 0;

            SetMenuEntryText();
        }
        void DifficultyMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentDifficulty++;
            difficulty++;

            if (currentDifficulty > Difficulty.Expert)
            {
                currentDifficulty = 0;
                difficulty = 0;
            }

            SetMenuEntryText();
        }
Beispiel #11
0
 /// <summary>
 /// Helper overload makes it easy to use OnCancel as a MenuEntry event handler.
 /// </summary>
 protected void OnCancel(object sender, PlayerIndexEventArgs e)
 {
     OnCancel(e.PlayerIndex);
 }