Copy improved outliner
This commit is contained in:
@@ -20,8 +20,11 @@ class TabOutliner {
|
||||
if (o.name.charAt(0) == ".") return; // Hidden
|
||||
if (Std.is(o, MeshObject) && cast(o, MeshObject).force_context != null) return; // Show mesh context only
|
||||
var b = false;
|
||||
if (i % 2 == 0) {
|
||||
ui.fill(-ui._x, 0, ui._windowW, ui.t.ELEMENT_H, ui.t.SEPARATOR_COL);
|
||||
}
|
||||
if (Context.object == o) {
|
||||
ui.fill(0, 0, ui._windowW, ui.t.ELEMENT_H, ui.t.HIGHLIGHT_COL);
|
||||
ui.fill(-ui._x, 0, ui._windowW, ui.t.ELEMENT_H, ui.t.HIGHLIGHT_COL);
|
||||
}
|
||||
if (o.children.length > 0) {
|
||||
ui.row([1 / 13, 12 / 13]);
|
||||
@@ -30,6 +33,10 @@ class TabOutliner {
|
||||
}
|
||||
else {
|
||||
ui._x += 18; // Sign offset
|
||||
|
||||
// Draw line that shows parent relations
|
||||
ui.fill(-14 / ui.SCALE(), ui.t.ELEMENT_H / 2, 14, 1, ui.t.ACCENT_COL);
|
||||
|
||||
ui.text(o.name);
|
||||
ui._x -= 18;
|
||||
}
|
||||
@@ -40,16 +47,24 @@ class TabOutliner {
|
||||
}
|
||||
i++;
|
||||
if (b) {
|
||||
var currentY = ui._y;
|
||||
for (c in o.children) {
|
||||
ui.indent();
|
||||
drawList(h, c);
|
||||
ui.unindent();
|
||||
}
|
||||
|
||||
// Draw line that shows parent relations
|
||||
var h = (ui._y - currentY - ui.ELEMENT_H() / 2) / ui.SCALE();
|
||||
ui.fill(14, -h - ui.t.ELEMENT_H / 2, 1, h, ui.t.ACCENT_COL);
|
||||
}
|
||||
}
|
||||
var _ELEMENT_OFFSET = ui.t.ELEMENT_OFFSET;
|
||||
ui.t.ELEMENT_OFFSET = 0;
|
||||
for (c in Scene.active.root.children) {
|
||||
drawList(Id.handle(), c);
|
||||
}
|
||||
ui.t.ELEMENT_OFFSET = _ELEMENT_OFFSET;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user