예제 #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(this.game, message, true);

            confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
        }
예제 #2
0
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(this.game, ScreenManager, true, e.PlayerIndex,
                        new GameplayScreen(this.game));
 }
예제 #3
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen(this.game), e.PlayerIndex);
 }
예제 #4
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();
 }
예제 #5
0
        /// <summary>
        /// Event handler for when the Frobnicate menu entry is selected.
        /// </summary>
        void CheatsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            cheats = !cheats;

            SetMenuEntryText();
        }
예제 #6
0
        /// <summary>
        /// Event handler for when the Elf menu entry is selected.
        /// </summary>
        void VolumeMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            volume++;

            SetMenuEntryText();
        }
예제 #7
0
        /// <summary>
        /// Event handler for when the screen menu entry is selected.
        /// This handles switching between fullscreen and windowed mode.
        /// </summary>
        void ScreenMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentDisplayType++;

            if (currentDisplayType > DisplayType.Windowed)
                currentDisplayType = 0;

            SetMenuEntryText();
        }
예제 #8
0
        /// <summary>
        /// Event handler for when the Language menu entry is selected.
        /// </summary>
        void LanguageMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentLanguage = (currentLanguage + 1) % languages.Length;

            SetMenuEntryText();
        }
예제 #9
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);
 }
예제 #10
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(this.game, ScreenManager, false, null, new BackgroundScreen(this.game),
                                                    new MainMenuScreen(this.game));
 }