//Factory internal static GUIListNode CreateListNode1Lvl(List <string[]> allNodes, DoButtonPress Action = null) { GUIListNode rootNode = new GUIListNode(new string[] { "" }, false, null, false, 0, true); foreach (var value in allNodes) { rootNode.AddNode(new GUIListNode(value, Action != null, Action, false, 1)); } return(rootNode); }
internal GUITextBox(string _labelLft = "", string _text = "", string _labelRt = "", int _textWidth = 100, int _totalWidth = 200, DoButtonPress _enter = null) { LabelLeft = _labelLft; LabelRight = _labelRt; Text = _text; NewText = _text; TextWidth = _textWidth; TotalWidth = _totalWidth; EnterPressedAction = _enter; }
internal GUIListNode(string[] _titles, bool _hasAction, DoButtonPress buttonAction, bool _isCollapsed, int _depth, bool _isRoot = false, int _width = 100) { Nodes = new List <GUIListNode>(); SetIcons("+ ", "- "); Titles = _titles; isRoot = _isRoot; isCollapsed = _isCollapsed; hasAction = _hasAction; levelDepth = _depth; FullText = string.Join(" ", Titles); ActionButton = new GUIButton(Titles[Titles.Length - 1], buttonAction ?? ToggleCollapsed, new GUILayoutOption[] { GUILayout.Width(_width), GUILayout.ExpandWidth(true) }); ActionButton.Parent = this; levelStyle = null; }
internal static GUIListNode CreateListNode2Lvl(Dictionary <string[], List <string[]> > allNodes, DoButtonPress lvl2Action = null, DoButtonPress lvl1Action = null) { GUIListNode rootNode = new GUIListNode(new string[] { "" }, false, null, false, 0, true); foreach (var lvl1Pair in allNodes) { var lvl1Node = new GUIListNode(lvl1Pair.Key, true, lvl1Action, true, 1); foreach (var value in lvl1Pair.Value) { lvl1Node.AddNode(new GUIListNode(value, lvl2Action != null, lvl2Action, false, 2)); } rootNode.AddNode(lvl1Node); } return(rootNode); }
internal GUIButton(string _title, DoButtonPress _action, params GUILayoutOption[] _options) { Title = _title; Action = _action ?? EmptyButtonPress; Options = _options ?? new GUILayoutOption[0]; }