예제 #1
0
        /// <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);
        }
예제 #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 QuitMessageBoxAccepted(object sender, EventArgs e)
 {
     LoadingScreen.Load(ScreenManager, LoadMainMenuScreen, false);
 }
예제 #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);
 }
예제 #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);
 }
예제 #5
0
 protected override void OnCancel()
 {
     LoadingScreen.Load(ScreenManager, LoadMainMenuScreen, false);
 }