Ejemplo n.º 1
0
        /// <summary>
        /// When the user cancels the main menu, or when
        /// the Exit GAme menu entry is selected
        /// </summary>
        protected override void OnCancel()
        {
            //add a confirmation message box
            string lMessage = String.Empty;

            if (Session.IsActive)
            {
                lMessage = "Are you sure you want to exit? All unsaved progress will be lost.";
            }
            else
            {
                lMessage = "Are you sure you want to exit?";
            }
            MessageBoxScreen lConfirmExitMessageBox = new MessageBoxScreen(lMessage);

            lConfirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
            ScreenManager.AddScreen(lConfirmExitMessageBox);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Lets the game respond to player input. Unlike the update method,
        /// this will only be called when the gameplay screen is active.
        /// </summary>
        public override void HandleInput()
        {
            if (InputManager.isActionTriggered(InputManager.Action.MainMenu))
            {
                ScreenManager.AddScreen(new MainMenuScreen());
                return;
            }

            if (InputManager.isActionTriggered(InputManager.Action.ExitGame))
            {
                //confirmation message box
                const string lMessage = "Are you sure you want to exit? All unsaved progress will be lost.";
                MessageBoxScreen lConfirmExitMessageBox = new MessageBoxScreen(lMessage);
                lConfirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
                ScreenManager.AddScreen(lConfirmExitMessageBox);
                return;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Lets the game respond to player input. Unlike the update method,
        /// this will only be called when the gameplay screen is active.
        /// </summary>
        public override void HandleInput()
        {
            if (InputManager.isActionTriggered(InputManager.Action.MainMenu))
            {
                ScreenManager.AddScreen(new MainMenuScreen());
                return;
            }

            if (InputManager.isActionTriggered(InputManager.Action.ExitGame))
            {
                //confirmation message box
                const string     lMessage = "Are you sure you want to exit? All unsaved progress will be lost.";
                MessageBoxScreen lConfirmExitMessageBox = new MessageBoxScreen(lMessage);
                lConfirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
                ScreenManager.AddScreen(lConfirmExitMessageBox);
                return;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// When the user cancels the main menu, or when
 /// the Exit GAme menu entry is selected
 /// </summary>
 protected override void OnCancel()
 {
     //add a confirmation message box
     string lMessage = String.Empty;
     if (Session.IsActive)
     {
         lMessage = "Are you sure you want to exit? All unsaved progress will be lost.";
     }
     else
     {
         lMessage = "Are you sure you want to exit?";
     }
     MessageBoxScreen lConfirmExitMessageBox = new MessageBoxScreen(lMessage);
     lConfirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
     ScreenManager.AddScreen(lConfirmExitMessageBox);
 }