/// <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>
        /// Responds to user input, accepting or cancelling the message box.
        /// </summary>
        public override void HandleInput(InputState input)
        {
            if (input.MenuCancel)
            {
                ExitScreen();
            }

            if (input.MenuSelect && World.ShipManager.SelectedPlayers.Any())
            {
                var arenaSelection = new ArenaSelectionScreen
                {
                    ScreenManager = this.ScreenManager
                };
                arenaSelection.Initialize();
                ScreenManager.AddScreen(arenaSelection);
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.One))
            {
                if (input.IsNewButtonPress(Buttons.DPadUp) || input.IsNewButtonPress(Buttons.LeftThumbstickUp))
                {
                    ChangePlayerColour(PlayerIndex.One);
                }

                if (input.IsNewButtonPress(Buttons.RightShoulder))
                {
                    ChangePlayerShip(PlayerIndex.One);
                }
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.Two))
            {
                if (input.IsNewButtonPress(Buttons.DPadUp) || input.IsNewButtonPress(Buttons.LeftThumbstickUp))
                {
                    ChangePlayerColour(PlayerIndex.Two);
                }

                if (input.IsNewButtonPress(Buttons.RightShoulder))
                {
                    ChangePlayerShip(PlayerIndex.Two);
                }
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.Three))
            {
                if (input.IsNewKeyPress(Keys.W))
                {
                    ChangePlayerColour(PlayerIndex.Three);
                }

                if (input.IsNewKeyPress(Keys.Tab))
                {
                    ChangePlayerShip(PlayerIndex.Three);
                }
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.Four))
            {
                if (input.IsNewKeyPress(Keys.Up))
                {
                    ChangePlayerColour(PlayerIndex.Four);
                }

                if (input.IsNewKeyPress(Keys.RightAlt))
                {
                    ChangePlayerShip(PlayerIndex.Four);
                }
            }
        }
示例#3
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen());
 }
示例#4
0
 private void CreditsMenuEntrySelected(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new CreditsMenuScreen());
 }
示例#5
0
 private void AboutMenuEntrySelected(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new AboutMenuScreen());
 }
示例#6
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 void LoadMainMenuScreen(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new BackgroundScreen());
     ScreenManager.AddScreen(new MainMenuScreen());
 }