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(); }
void Open() { canvasRect.gameObject.SetActive(true); UpdateTextInUI(); inputField.ActivateInputField(); hudManager.UpdateVerticalOffsetAsPercent(GetHeightInPercent()); }
// 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(); }
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(); }
private void Update() { if (Input.GetKeyDown(KeyCode.Tab)) { if (CoachField.isFocused) { PasswordField.ActivateInputField(); } else { CoachField.ActivateInputField(); }; } }
public void Init(string _header, WndManager.InputBoxCallback _callback, string _default = "") { lblHeader.text = _header; callBack = _callback; txtContent.text = _default; txtContent.ActivateInputField(); }
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(); }
// 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(); }
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(); } }
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)); } }
public void EditText() { inputField.ActivateInputField(); }
public void SelectCommandText() { tmInputField.Select(); tmInputField.ActivateInputField(); }
private void Start() { iField.ActivateInputField(); }
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; } }