/// <summary>
 /// Event handler for when the Back menu entry is selected.
 /// </summary>
 void BackMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     if (comingFrom == "MainMenu")
     {
         BlankTransitionScreen.Load(ScreenManager, true, e.PlayerIndex, new BackgroundScreen(), new MainMenuScreen());
     }
     else if (comingFrom == "PauseMenu")
     {
         OnCancel(e.PlayerIndex);
     }
 }
 /// <summary>
 /// Overrides the OnCancel method so that we don't get stuck
 /// in the BlankTransitionScreen.
 /// </summary>
 protected override void OnCancel(PlayerIndex playerIndex)
 {
     if (comingFrom == "MainMenu")
     {
         BlankTransitionScreen.Load(ScreenManager, false, playerIndex, new BackgroundScreen(), new MainMenuScreen());
     }
     else if (comingFrom == "PauseMenu")
     {
         PauseMenuScreen.SetMenuText();
         base.OnCancel(playerIndex);
     }
 }
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager, bool loadingIsSlow,
                                PlayerIndex?controllingPlayer,
                                params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
            {
                screen.ExitScreen();
            }

            // Create and activate the loading screen.
            BlankTransitionScreen blankTransitionScreen = new BlankTransitionScreen(screenManager,
                                                                                    loadingIsSlow,
                                                                                    screensToLoad);

            screenManager.AddScreen(blankTransitionScreen, controllingPlayer);
        }
Esempio n. 4
0
        /// <summary>
        /// Overrides the OnCancel method to prevent the user from getting
        /// stuck in a blank screen.
        /// </summary>
        protected override void OnCancel(Microsoft.Xna.Framework.PlayerIndex playerIndex)
        {
            base.OnCancel(playerIndex);

            BlankTransitionScreen.Load(ScreenManager, false, playerIndex, new BackgroundScreen(), new MainMenuScreen());
        }
Esempio n. 5
0
 /// <summary>
 /// Event handler for when the Back menu entry is selected.
 /// </summary>
 void BackMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     BlankTransitionScreen.Load(ScreenManager, false, e.PlayerIndex, new BackgroundScreen(), new MainMenuScreen());
 }
Esempio n. 6
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     BlankTransitionScreen.Load(ScreenManager, true, e.PlayerIndex, new BackgroundScreen(), new OptionsMenuScreen(comingFrom));
 }