public void PopOutExit() { const string message = "Are you sure you want to go back to Main Menu?"; PopUpScreen confirmExitMessageBox = new PopUpScreen(message, PopUpScreen.Style.YesNo); confirmExitMessageBox.Accepted += () => { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }; confirmExitMessageBox.Cancelled += () => { }; ScreenManager.AddScreen(confirmExitMessageBox, null); }
private void ShowQuitDialog() { const string message = "Are you sure you want to go back to Main Menu?"; PopUpScreen confirmExitMessageBox = new PopUpScreen( message, PopUpScreen.Style.YesNo ); confirmExitMessageBox.Accepted += Quit; confirmExitMessageBox.Cancelled += () => { }; ScreenManager.AddScreen( confirmExitMessageBox, null ); }
private void HandleError( MsgErrorCode err ) { string msg = ""; switch ( err ) { case MsgErrorCode.CannotCreateLobby: msg += "Can't create any more new lobbies yet."; break; case MsgErrorCode.LobbyFull: msg += "That lobby is full."; break; case MsgErrorCode.InvalidLobby: msg += "That lobby does not exist anymore."; break; } PopUpScreen popup = new PopUpScreen( msg, PopUpScreen.Style.OK ); ScreenManager.AddScreen( popup, null ); }
private void EndGame( Nullable<Team> winner ) { gameOver = true; // Set up the message to display to the user string endMsg = ""; if ( winner == null ) { endMsg += "Game Over!\nThe game ended in a tie."; } else { endMsg += (winner == playerChar.Team) ? "Victory!\n" : "Defeat :(\n"; switch ( winner ) { case Team.RED: endMsg += "The Red Team Wins!"; break; case Team.BLUE: endMsg += "The Blue Team Wins!"; break; } } // Popup the message PopUpScreen gameOverScreen = new PopUpScreen( endMsg, PopUpScreen.Style.OK ); gameOverScreen.Accepted += Quit; ScreenManager.AddScreen( gameOverScreen, null ); }