/// <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 = "You don't really want to quit do you?"; MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(message, true); confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted; ScreenManager.AddScreen(confirmExitMessageBox, playerIndex); }
/// <summary> /// Event handler for when the Quit Game menu entry is selected. /// </summary> void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { const string message = "Do you want to return to the Main Menu?"; MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message, false); confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted; ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer); }