Example #1
0
        /// <summary>
        /// When the user cancels the main menu, ask if they want to exit the sample.
        /// </summary>
        protected override void OnCancel(PlayerIndex playerIndex)
        {
            const string message = "Are you sure you want to exit?";

            MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(message);

            confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmExitMessageBox, playerIndex);
        }
Example #2
0
        void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            const string message = "Are you sure you want to quit this game?";

            MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);

            confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
        }
Example #3
0
 void UpgradeWeaponMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     string message;
     if (MenuEntries[0].Selectable)
     {
         message = "Upgrade Weapon?";
         MessageBoxScreen confirmMessageBox = new MessageBoxScreen(message);
         confirmMessageBox.Accepted += ConfirmUpgradeWeaponMessageBoxAccepted;
         ScreenManager.AddScreen(confirmMessageBox, ControllingPlayer);
     }
     else
     {
         if(Player.ScoreSystem.RunningScore < 500)
             message = "You don't have enough points to upgrade that item!";
         else
             message = "Can only upgrade this part once per Shop Screen!";
         MessageBoxScreen messageBox = new MessageBoxScreen(message);
         ScreenManager.AddScreen(messageBox, ControllingPlayer);
     }
 }
Example #4
0
        void OkayMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            const string message = "Try to beat your High Score!";

            MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);

            confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;

            ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
        }