/// <summary> /// Shows a dual text at the bottom of the terminal. /// </summary> public static void ShowDualText(GUIReferences data, string leftText, string rightText) { var dualTextObject = NGUITools.AddChild(data.TextTable.gameObject, data.DualText.gameObject); var dualText = dualTextObject.GetComponent <DualTextEntry>(); dualText.LeftTextComponent.text = leftText; dualText.RightTextComponent.text = rightText; dualText.transform.SetAsFirstSibling(); var widget = dualText.ParentWidget; widget.leftAnchor.target = data.ScrollView.transform; widget.rightAnchor.target = data.ScrollView.transform; dualTextObject.SetActive(true); var textEntry = new TerminalEntry(); textEntry.EntryType = TerminalEntryType.SingleText; textEntry.SceneObject = dualTextObject; SList.Push(DataHolder.TerminalData.AllEntries, textEntry); }
/// <summary> /// Updates the scroll view position and bounds. /// </summary> public static void UpdateScroll(GUIReferences data) { data.ScrollView.ResetPosition(); data.ScrollView.UpdatePosition(); data.ScrollView.UpdateScrollbars(true); }
/// <summary> /// Shows the given text on the input. /// </summary> public static void ShowTextOnInput(GUIReferences data, string text) { data.Input.value = text; }
/// <summary> /// Shows the command from the command buffer accordingly to the index on TerminalData. /// </summary> public static void ShowCommandFromBuffer(TerminalData data, GUIReferences references) { var command = data.CurrentCommandBuffer[data.CurrentCommandBufferIndex]; ShowTextOnInput(references, command); }
/// <summary> /// Calls reposition on the table. /// </summary> public static void UpdateTable(GUIReferences data) { data.TextTable.Reposition(); }