コード例 #1
0
        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);
        }
コード例 #2
0
        private void JoinSelectedServer()
        {
            var selectedRow = m_gamesTable.SelectedRow;

            if (selectedRow == null)
            {
                return;
            }

            MyJoinGameHelper.JoinGame((GameServerItem)selectedRow.UserData);
        }
コード例 #3
0
        private void JoinSelectedLobby()
        {
            var selectedRow = m_gamesTable.SelectedRow;

            if (selectedRow == null)
            {
                return;
            }

            Lobby selectedLobby = (Lobby)selectedRow.UserData;

            MyJoinGameHelper.JoinGame(selectedLobby);
        }
コード例 #4
0
        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);
            }
        }