public void DoDraw(ref Vector3 cur, float width, DefView window = null, string drawLabel = null, List <FieldDesc> drawFieldDescs = null) { // Draw section header, if any if (!drawLabel.NullOrEmpty()) { Rect labelRect = new Rect(cur.x, cur.y, width, 20f); Widgets.Label(labelRect, drawLabel); cur.y += 35f - DefExplorerWindow.LineHeightOffset; } // respect tabs! cur.x += Inset; // make sure column widths have been calculated if (!WidthsSet) { SetColumnWidths(width - Inset); } // draw lines one by one if (!drawFieldDescs.NullOrEmpty()) { foreach (FieldDesc desc in drawFieldDescs) { desc.Draw(ref cur, ColumnWidths); } } // add some extra space, reset inset cur.y += DefExplorerWindow.ParagraphMargin; cur.x -= Inset; // done! }
public void Draw(ref Vector3 cur, float width, DefView window = null) { if (!initialized) { Initialize(); initialized = true; } DoDraw(ref cur, width, window, Label, FieldDescs); }
public void Draw(ref Vector3 cur, float width, DefView window = null) { if (!initialized) { Initialize(); initialized = true; } foreach (var section in sections) { section.Draw(ref cur, width, window); } }