public void ShowReconnectMessageBox() { var messageBox = MyGuiSandbox.CreateMessageBox( buttonType : MyMessageBoxButtonsType.YES_NO, messageText : MyTexts.Get(MySpaceTexts.MessageBoxTextAreYouSureYouWantToReconnect), messageCaption : MyTexts.Get(MySpaceTexts.MessageBoxCaptionPleaseConfirm), callback : delegate(MyGuiScreenMessageBox.ResultEnum callbackReturn) { if (callbackReturn == MyGuiScreenMessageBox.ResultEnum.YES) { if (MyMultiplayer.Static is MyMultiplayerLobby) { var lobbyId = MyMultiplayer.Static.LobbyId; MyGuiScreenMainMenu.UnloadAndExitToMenu(); MyJoinGameHelper.JoinGame(lobbyId); } else if (MyMultiplayer.Static is MyMultiplayerClient) { var server = (MyMultiplayer.Static as MyMultiplayerClient).Server; MyGuiScreenMainMenu.UnloadAndExitToMenu(); MyJoinGameHelper.JoinGame(server); } } }); messageBox.SkipTransition = true; messageBox.CloseBeforeCallback = true; MyGuiSandbox.AddScreen(messageBox); }
private void JoinSelectedServer() { var selectedRow = m_gamesTable.SelectedRow; if (selectedRow == null) { return; } MyJoinGameHelper.JoinGame((GameServerItem)selectedRow.UserData); }
private void JoinSelectedLobby() { var selectedRow = m_gamesTable.SelectedRow; if (selectedRow == null) { return; } Lobby selectedLobby = (Lobby)selectedRow.UserData; MyJoinGameHelper.JoinGame(selectedLobby); }
private void JoinSelectedLobby() { var selectedRow = m_gamesTable.SelectedRow; if (selectedRow == null) { return; } Lobby selectedLobby = (Lobby)selectedRow.UserData; bool isBattle = MyMultiplayerLobby.GetLobbyBattle(selectedLobby); if (MyFakes.ENABLE_BATTLE_SYSTEM && isBattle) { MyJoinGameHelper.JoinBattleGame(selectedLobby); } else { MyJoinGameHelper.JoinGame(selectedLobby); } }