コード例 #1
0
        private void _joinGame(MsgTickerJoinGame message)
        {
            if (_tickerState == TickerState.InGame)
            {
                return;
            }

            _tickerState = TickerState.InGame;

            if (_lobby != null)
            {
                _lobby.Chat.TextSubmitted -= _chatConsole.ParseChatMessage;
                _chatConsole.AddString    -= _lobby.Chat.AddLine;
                _lobby.Dispose();
                _lobby = null;
            }

            _inputManager.SetInputCommand(EngineKeyFunctions.FocusChat,
                                          InputCmdHandler.FromDelegate(session => { _gameChat.Input.GrabKeyboardFocus(); }));

            _gameChat = new Chatbox();
            _userInterfaceManager.StateRoot.AddChild(_gameChat);
            _gameChat.TextSubmitted    += _chatConsole.ParseChatMessage;
            _chatConsole.AddString     += _gameChat.AddLine;
            _gameChat.DefaultChatFormat = "say \"{0}\"";
        }
コード例 #2
0
        private void _joinGame(MsgTickerJoinGame message)
        {
            if (_tickerState == TickerState.InGame)
            {
                return;
            }

            _tickerState = TickerState.InGame;

            if (_lobby != null)
            {
                _lobby.Dispose();
                _lobby = null;
            }

            _gameChat = new ChatBox();
            _userInterfaceManager.StateRoot.AddChild(_gameChat);
            _userInterfaceManager.StateRoot.AddChild(_gameHud.RootControl);
            _chatManager.SetChatBox(_gameChat);
            _gameChat.DefaultChatFormat = "say \"{0}\"";
            _gameChat.Input.PlaceHolder = _localization.GetString("Say something! [ for OOC");

            _inputManager.SetInputCommand(ContentKeyFunctions.FocusChat,
                                          InputCmdHandler.FromDelegate(s => _focusChat(_gameChat)));
        }
コード例 #3
0
        private void _joinGame(MsgTickerJoinGame message)
        {
            if (_tickerState == TickerState.InGame)
            {
                return;
            }

            _tickerState = TickerState.InGame;

            if (_lobby != null)
            {
                _lobby.Dispose();
                _lobby = null;
            }

            _inputManager.SetInputCommand(ContentKeyFunctions.FocusChat,
                                          InputCmdHandler.FromDelegate(session =>
            {
                _gameChat.Input.IgnoreNext = true;
                _gameChat.Input.GrabKeyboardFocus();
            }));

            _gameChat = new ChatBox();
            _userInterfaceManager.StateRoot.AddChild(_gameChat);
            _chatManager.SetChatBox(_gameChat);
            _gameChat.DefaultChatFormat = "say \"{0}\"";
        }
コード例 #4
0
        private void _joinGame(MsgTickerJoinGame message)
        {
            if (_tickerState == TickerState.InGame)
            {
                return;
            }

            _tickerState = TickerState.InGame;

            if (_lobby != null)
            {
                _lobby.Dispose();
                _lobby = null;
            }

            _inputManager.SetInputCommand(ContentKeyFunctions.FocusChat,
                                          InputCmdHandler.FromDelegate(session =>
            {
                _gameChat.Input.IgnoreNext = true;
                _gameChat.Input.GrabKeyboardFocus();
            }));

            _gameChat = new ChatBox();
            _userInterfaceManager.StateRoot.AddChild(_gameChat);
            _chatManager.SetChatBox(_gameChat);
            _tutorialButton = new TutorialButton();
            _userInterfaceManager.StateRoot.AddChild(_tutorialButton);
            _tutorialButton.SetAnchorAndMarginPreset(Control.LayoutPreset.BottomLeft, Control.LayoutPresetMode.MinSize, 50);
            _gameChat.DefaultChatFormat = "say \"{0}\"";
        }
コード例 #5
0
        public override void Shutdown()
        {
            _playerManager.PlayerListUpdated     -= PlayerManagerOnPlayerListUpdated;
            _clientGameTicker.InfoBlobUpdated    -= UpdateLobbyUi;
            _clientGameTicker.LobbyStatusUpdated -= UpdateLobbyUi;

            _lobby.Dispose();
            _characterSetup.Dispose();
        }
コード例 #6
0
        public override void Shutdown()
        {
            _playerManager.PlayerListUpdated       -= PlayerManagerOnPlayerListUpdated;
            _gameTicker.InfoBlobUpdated            -= UpdateLobbyUi;
            _gameTicker.LobbyStatusUpdated         -= LobbyStatusUpdated;
            _gameTicker.LobbyLateJoinStatusUpdated -= LobbyLateJoinStatusUpdated;

            _lobby?.Dispose();
            _characterSetup?.Dispose();
            _lobby          = null;
            _characterSetup = null;
        }
コード例 #7
0
        private void BaseClientOnRunLevelChanged(object sender, RunLevelChangedEventArgs e)
        {
            if (e.NewLevel != ClientRunLevel.Initialize)
            {
                return;
            }

            _tickerState = TickerState.Unset;
            _lobby?.Dispose();
            _lobby = null;
            _gameChat?.Dispose();
            _gameChat = null;
        }
コード例 #8
0
        private void BaseClientOnRunLevelChanged(object sender, RunLevelChangedEventArgs e)
        {
            if (e.NewLevel != ClientRunLevel.Initialize)
            {
                _inputManager.SetInputCommand(ContentKeyFunctions.FocusChat, null);
                return;
            }

            _tickerState = TickerState.Unset;
            _lobby?.Dispose();
            _lobby = null;
            _gameChat?.Dispose();
            _gameChat = null;
            _gameHud.RootControl.Orphan();
        }
コード例 #9
0
 public override void Shutdown()
 {
     _playerManager.PlayerListUpdated -= PlayerManagerOnPlayerListUpdated;
     _lobby.Dispose();
     _characterSetup.Dispose();
 }