Exemplo n.º 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);
        }
Exemplo n.º 2
0
        private void JoinSelectedServer()
        {
            var selectedRow = m_gamesTable.SelectedRow;

            if (selectedRow == null)
            {
                return;
            }

            MyJoinGameHelper.JoinGame((GameServerItem)selectedRow.UserData);
        }
Exemplo n.º 3
0
        private void JoinSelectedLobby()
        {
            var selectedRow = m_gamesTable.SelectedRow;

            if (selectedRow == null)
            {
                return;
            }

            Lobby selectedLobby = (Lobby)selectedRow.UserData;

            MyJoinGameHelper.JoinGame(selectedLobby);
        }
Exemplo n.º 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);
            }
        }