public void OnSubmit(string input)
    {
        response.text = "Could not parse command.";

        // handle the respond coming in and send it to the receiver
        string[] inputSplit = input.Split(' ');

        if (inputSplit.Length == 1)
        {
            receiver.SendMessage(inputSplit[0]);
            response.text = $"{input} >> done";
        }
        else if (inputSplit.Length == 2)
        {
            receiver.SendMessage(inputSplit[0], inputSplit[1]);
            response.text = $"{input} >> done";
        }
        else
        {
            response.text = "could not parse command.";
        }

        // update history
        historyIndex = -1;
        history.Insert(0, input);

        // empty the input and select it
        inputField.SetTextWithoutNotify("");
        inputField.ActivateInputField();
    }
 // Start is called before the first frame update
 void Start()
 {
     MenuStatus = "MainMenu";
     Debug.Log(MenuStatus);
     lobby = GameObject.FindGameObjectWithTag("OldLobby");
     roomname.ActivateInputField();
 }
Esempio n. 3
0
 void Open()
 {
     canvasRect.gameObject.SetActive(true);
     UpdateTextInUI();
     inputField.ActivateInputField();
     hudManager.UpdateVerticalOffsetAsPercent(GetHeightInPercent());
 }
Esempio n. 4
0
    // Start is called before the first frame update
    private async void Start()
    {
        StatusPanel.SetActive(false);

        CoachField.onSubmit.AddListener(v => { PasswordField.ActivateInputField(); });
        PasswordField.onSubmit.AddListener(v => { Login(); });

        FumbblApi.NewAuthResult  += OnNewAuthResult;
        FumbblApi.NewLoginResult += OnNewLoginResult;

        await TryAuth();
    }
Esempio n. 5
0
    private void Enable()
    {
        if (canvas == null)
        {
            canvas = Main.UISystem.SpawnCanvas("CheatConsole", CanvasSortOrder.CheatConsole);
        }
        consoleObject.transform.SetParent(canvas.transform, false);

        isEnabled = true;
        consoleObject.SetActive(true);
        inputField.ActivateInputField();
    }
Esempio n. 6
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Tab))
     {
         if (CoachField.isFocused)
         {
             PasswordField.ActivateInputField();
         }
         else
         {
             CoachField.ActivateInputField();
         };
     }
 }
Esempio n. 7
0
 public void Init(string _header, WndManager.InputBoxCallback _callback, string _default = "")
 {
     lblHeader.text = _header;
     callBack = _callback;
     txtContent.text = _default;
     txtContent.ActivateInputField();
 }
Esempio n. 8
0
 private void ReadyInput()
 {
     input.text         = "";
     input.readOnly     = false;
     input.interactable = true;
     input.ActivateInputField();
     //Debug.Log("ReadyInput");
 }
    // when the button is pressed on the Load Game canvas. The canvas transition is handled by the buttons themselves
    public void Rename()
    {
        if (SelectedBoard == null)
        {
            return;
        }

        ShowRename();
        RenameInput.text = SelectedBoard.Title.text;
        RenameInput.ActivateInputField();
    }
Esempio n. 10
0
    // when the button is pressed on the Load Game canvas. The canvas transition is handled by the buttons themselves
    public void Rename()
    {
        if (SelectedSaveFile == null || SelectedSaveFile.LegacySave)
        {
            return;
        }

        runmainmenu.ShowRenameGame();
        RenameInput.text = SelectedSaveFile.FileName;
        RenameInput.ActivateInputField();
    }
Esempio n. 11
0
    IEnumerator SelectInputField()
    {
        yield return(new WaitForEndOfFrame());

        nameField.ActivateInputField();
        // nameField.Select();

        // EventSystemManager.currentSystem.SetSelectedGameObject(nameField.gameObject, null);
        // nameField.OnPointerClick (null);
        // EventSystem.current.SetSelectedGameObject(nameField.gameObject, null);
        // nameField.OnPointerClick(new PointerEventData(EventSystem.current));
    }
    // Update is called once per frame
    void Update()
    {
        if ((Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !isOnLeaderboard)
        {
            // Premuto enter
            if (!isInserting)
            {
                PlayerPrefs.SetString("Name", nameInputField.text);
                PlayerPrefs.Save();
                SceneManager.LoadScene("GameScene");
            }
            else
            {
                Debug.Log(nameInputField.text);
                isInserting = false;
            }
        }

        //Accendiamo la leaderboard
        if (Input.GetKeyDown(KeyCode.H) && !isInserting)
        {
            if (!isOnLeaderboard)
            {
                oggettiDaSpegnere1.SetActive(false);
                oggettiDaSpegnere2.SetActive(false);
                leaderBoardObj.SetActive(true);
                isOnLeaderboard = true;
            }
            else
            {
                oggettiDaSpegnere1.SetActive(true);
                oggettiDaSpegnere2.SetActive(true);
                leaderBoardObj.SetActive(false);
                isOnLeaderboard = false;
            }
        }


        if (Input.GetKeyDown(KeyCode.L) && !isInserting)
        {
            isInserting = true;
            nameInputField.Select();
            Debug.Log("Escape Pressed");
            nameInputField.text = "";
        }

        if (isInserting)
        {
            nameInputField.ActivateInputField();
        }
    }
Esempio n. 13
0
 static int ActivateInputField(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         TMPro.TMP_InputField obj = (TMPro.TMP_InputField)ToLua.CheckObject(L, 1, typeof(TMPro.TMP_InputField));
         obj.ActivateInputField();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 14
0
 public void EditText()
 {
     inputField.ActivateInputField();
 }
Esempio n. 15
0
 public void SelectCommandText()
 {
     tmInputField.Select();
     tmInputField.ActivateInputField();
 }
Esempio n. 16
0
 private void Start()
 {
     iField.ActivateInputField();
 }
Esempio n. 17
0
    public void Tick(ChatSystemClient chatSystem)
    {
        // Handle outgoing messages
        foreach (var l in m_ChatLinesToSend)
        {
            if (chatSystem != null)
            {
                chatSystem.SendMessage(l);
            }
            else
            {
                AddLine(l);
            }
        }
        m_ChatLinesToSend.Clear();

        // Handle incoming messages
        if (chatSystem != null)
        {
            while (chatSystem.incomingMessages.Count > 0)
            {
                var message = chatSystem.incomingMessages.Dequeue();
                AddLine(message);
            }
        }

        if (m_MoveToEnd)
        {
            field.MoveTextEnd(true);
            m_MoveToEnd = false;
        }
        if (!m_IsOpen && Game.Input.GetKeyDown(activationKey))
        {
            field.textComponent.enabled = true;
            field.interactable          = true;

            field.ActivateInputField();
            m_MoveToEnd = true;

            m_IsOpen = true;
            Game.Input.SetBlock(Game.Input.Blocker.Chat, true);

            FadeBackgrounds(1.0f, 0.2f);

            foreach (var line in m_Lines)
            {
                line.Show();
            }
        }
        else if (m_IsOpen && !field.isFocused)
        {
            m_IsOpen = false;
            Game.Input.SetBlock(Game.Input.Blocker.Chat, false);
            field.interactable = false;

            FadeBackgrounds(0.0f, 0.7f);

            foreach (var line in m_Lines)
            {
                line.changeTime = Time.time;
            }
        }
        else if (m_IsOpen && Input.GetKeyDown(KeyCode.Tab))
        {
            var text = field.text;
            for (int i = 0, l = messagePrefixes.Length; i < l; ++i)
            {
                var prefixMatch = text.PrefixMatch(messagePrefixes[i]);
                if (prefixMatch > 1)
                {
                    var oldCaretReverse = field.text.Length - field.caretPosition;
                    defaultPrefix       = messagePrefixes[(i + 1) % l];
                    field.text          = defaultPrefix + text.Substring(prefixMatch);
                    field.caretPosition = field.text.Length - oldCaretReverse;
                    break;
                }
            }
        }

        if (!m_IsOpen)
        {
            // Fade out old lines
            foreach (var line in m_Lines)
            {
                if (Time.time - line.changeTime > 4.0f)
                {
                    line.Hide();
                }
            }
            field.textComponent.enabled = false;
        }
    }