Example #1
0
 public void EndEditOnEnter()
 {
     if (KeyboardInputManager.IsEnterPressed())
     {
         BtnOk();
     }
 }
Example #2
0
 void UpdateMe()
 {
     if (isUsingScrollBar)
     {
         DetermineScrollRate();
     }
     if (inputField.IsFocused && KeyboardInputManager.IsEnterPressed())
     {
         OnInputSubmit();
     }
 }
Example #3
0
    private void Update()
    {
        // TODO add events to inventory slot changes to trigger channel refresh
        if (chatInputWindow.activeInHierarchy && !isChannelListUpToDate())
        {
            Logger.Log("Channel list is outdated!", Category.Chat);
            RefreshChannelPanel();
        }

        if (KeyboardInputManager.IsEnterPressed() && !windowCoolDown && chatInputWindow.activeInHierarchy)
        {
            if (UIManager.IsInputFocus)
            {
                parsedInput = Chat.ParsePlayerInput(InputFieldChat.text, chatContext);
                if (Chat.IsValidToSend(parsedInput.ClearMessage))
                {
                    PlayerSendChat(parsedInput.ClearMessage);
                }

                CloseChatWindow();
            }
        }

        if (!chatInputWindow.activeInHierarchy)
        {
            return;
        }
        if (KeyboardInputManager.IsEscapePressed())
        {
            CloseChatWindow();
        }

        if (InputFieldChat.isFocused)
        {
            return;
        }
        if (KeyboardInputManager.IsMovementPressed() || KeyboardInputManager.IsEscapePressed())
        {
            CloseChatWindow();
        }
    }
Example #4
0
    public void Update()
    {
        if (channelPanel.gameObject.activeInHierarchy && !isChannelListUpToDate())
        {
            RefreshChannelPanel();
        }

        if (UIManager.IsInputFocus)
        {
            if (!string.IsNullOrEmpty(InputFieldChat.text.Trim()) &&
                KeyboardInputManager.IsEnterPressed())
            {
                PlayerSendChat();
                CloseChatWindow();
            }
        }

        if (chatInputWindow.activeInHierarchy)
        {
            if (KeyboardInputManager.IsEscapePressed())
            {
                CloseChatWindow();
            }

            if (!InputFieldChat.isFocused)
            {
                if (KeyboardInputManager.IsMovementPressed() || KeyboardInputManager.IsEscapePressed())
                {
                    CloseChatWindow();
                }

                if (!string.IsNullOrEmpty(InputFieldChat.text.Trim()) &&
                    KeyboardInputManager.IsEnterPressed())
                {
                    PlayerSendChat();
                    CloseChatWindow();
                }
            }
        }
    }
Example #5
0
    private void Update()
    {
        // TODO add events to inventory slot changes to trigger channel refresh
        if (chatInputWindow.activeInHierarchy && !isChannelListUpToDate())
        {
            Logger.Log("Channel list is outdated!", Category.UI);
            RefreshChannelPanel();
        }

        if (KeyboardInputManager.IsEnterPressed() && !windowCoolDown)
        {
            if (UIManager.IsInputFocus)
            {
                if (!string.IsNullOrEmpty(InputFieldChat.text.Trim()))
                {
                    PlayerSendChat();
                }

                CloseChatWindow();
            }
        }

        if (!chatInputWindow.activeInHierarchy)
        {
            return;
        }
        if (KeyboardInputManager.IsEscapePressed())
        {
            CloseChatWindow();
        }

        if (InputFieldChat.isFocused)
        {
            return;
        }
        if (KeyboardInputManager.IsMovementPressed() || KeyboardInputManager.IsEscapePressed())
        {
            CloseChatWindow();
        }
    }