public void DoSpecialPreElements(Listing_TreeDefs listing) { if (obj == null) { return; } if (editWidgetsMethod != null) { WidgetRow widgetRow = listing.StartWidgetsRow(nestDepth); editWidgetsMethod.Invoke(obj, new object[1] { widgetRow }); } Editable editable = obj as Editable; if (editable == null) { return; } GUI.color = new Color(1f, 0.5f, 0.5f, 1f); foreach (string item in editable.ConfigErrors()) { listing.InfoText(item, nestDepth); } GUI.color = Color.white; }
public override void DoWindowContents(Rect inRect) { if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter || Event.current.keyCode == KeyCode.Escape)) { UI.UnfocusCurrentControl(); } Rect rect = new Rect(0f, 0f, inRect.width, 16f); this.labelColumnWidth = Widgets.HorizontalSlider(rect, this.labelColumnWidth, 0f, inRect.width, false, null, null, null, -1f); Rect outRect = inRect.AtZero(); outRect.yMin += 16f; Rect rect2 = new Rect(0f, 0f, outRect.width - 16f, this.viewHeight); Widgets.BeginScrollView(outRect, ref this.scrollPosition, rect2, true); Listing_TreeDefs listing_TreeDefs = new Listing_TreeDefs(this.labelColumnWidth); listing_TreeDefs.Begin(rect2); TreeNode_Editor node = EditTreeNodeDatabase.RootOf(this.def); listing_TreeDefs.ContentLines(node, 0); listing_TreeDefs.End(); if (Event.current.type == EventType.Layout) { this.viewHeight = listing_TreeDefs.CurHeight + 200f; } Widgets.EndScrollView(); }
public void DoSpecialPreElements(Listing_TreeDefs listing) { if (this.obj != null) { if (this.editWidgetsMethod != null) { WidgetRow widgetRow = listing.StartWidgetsRow(this.nestDepth); this.editWidgetsMethod.Invoke(this.obj, new object[] { widgetRow }); } Editable editable = this.obj as Editable; if (editable != null) { GUI.color = new Color(1f, 0.5f, 0.5f, 1f); foreach (string text in editable.ConfigErrors()) { listing.InfoText(text, this.nestDepth); } GUI.color = Color.white; } } }