/// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager,
            EventHandler<EventArgs> loadNextScreen,
            bool loadingIsSlow)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen();

            loadingScreen.loadingIsSlow = loadingIsSlow;
            loadingScreen.loadNextScreen = loadNextScreen;

            screenManager.AddScreen(loadingScreen);
        }
 /// <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 QuitMessageBoxAccepted(object sender, EventArgs e)
 {
     LoadingScreen.Load(ScreenManager, LoadMainMenuScreen, false);
 }
Exemple #3
0
 /// <summary>
 /// Event handler for when the Play Again menu entry is selected.
 /// </summary>
 void PlayAgainMenuEntrySelected(object sender, EventArgs e)
 {
     LoadingScreen.Load(ScreenManager, LoadGameplayScreen, true);
 }
Exemple #4
0
 /// <summary>
 /// Event handler for when the Return to Menu menu entry is selected.
 /// </summary>
 void ReturnToMenuMenuEntrySelected(object sender, EventArgs e)
 {
     LoadingScreen.Load(ScreenManager, LoadMainMenuScreen, false);
 }
Exemple #5
0
 protected override void OnCancel()
 {
     LoadingScreen.Load(ScreenManager, LoadMainMenuScreen, false);
 }