/// <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);
        }
 void InstructionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new InstructionsScreen(), e.PlayerIndex);
 }
 //void DislayOptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 //{
 //    Console.WriteLine(OptionsMenuScreen.getOptions[0]);
 //}
 void CreditsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new CreditsMenuScreen(), e.PlayerIndex);
 }
 /// <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();
 }
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
                        new GameplayScreen(OptionsMenuScreen.getOptions));
 }
示例#6
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);
 }
        void gameTimeMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentGameTime = (currentGameTime + 1) % gameTimes.Length;

            SetMenuEntryText();
        }
        void spawnIntervalsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentSpawnInterval = (currentSpawnInterval + 1) % spawnIntervals.Length;

            SetMenuEntryText();
        }
        void playerSpeedMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentPlayerSpeed = (currentPlayerSpeed + 1) % playerSpeeds.Length;

            SetMenuEntryText();
        }
示例#10
0
        /// <summary>
        /// Event handler for when the Language menu entry is selected.
        /// </summary>
        void playerNumberMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentPlayerNumber = (currentPlayerNumber + 1) % playerNumber.Length;

            SetMenuEntryText();
        }
        void themeMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentTheme = (currentTheme + 1) % themes.Length;

            SetMenuEntryText();
        }
 /// <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());
 }