Prevent recursive node groups
This commit is contained in:
@@ -754,10 +754,8 @@ class UINodes {
|
|||||||
}
|
}
|
||||||
if (isGroupCategory) {
|
if (isGroupCategory) {
|
||||||
for (g in Project.materialGroups) {
|
for (g in Project.materialGroups) {
|
||||||
if (!canPlaceGroup(g.canvas.name)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ui.fill(0, 1, ui._w / ui.SCALE(), ui.t.BUTTON_H + 2, ui.t.ACCENT_SELECT_COL);
|
ui.fill(0, 1, ui._w / ui.SCALE(), ui.t.BUTTON_H + 2, ui.t.ACCENT_SELECT_COL);
|
||||||
|
ui.enabled = canPlaceGroup(g.canvas.name);
|
||||||
if (ui.button(" " + g.canvas.name, Left)) {
|
if (ui.button(" " + g.canvas.name, Left)) {
|
||||||
pushUndo();
|
pushUndo();
|
||||||
var canvas = getCanvas(true);
|
var canvas = getCanvas(true);
|
||||||
@@ -767,6 +765,7 @@ class UINodes {
|
|||||||
nodes.nodesSelected = [node];
|
nodes.nodesSelected = [node];
|
||||||
nodes.nodesDrag = true;
|
nodes.nodesDrag = true;
|
||||||
}
|
}
|
||||||
|
ui.enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -791,6 +790,14 @@ class UINodes {
|
|||||||
if (groupStack.length > 0 && groupName == groupStack[groupStack.length - 1].canvas.name) {
|
if (groupStack.length > 0 && groupName == groupStack[groupStack.length - 1].canvas.name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Recursive node groups
|
||||||
|
if (groupStack.length > 0) {
|
||||||
|
for (g in groupStack) {
|
||||||
|
if (g.canvas.name == groupName) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Group was deleted / renamed
|
// Group was deleted / renamed
|
||||||
var groupExists = false;
|
var groupExists = false;
|
||||||
for (group in Project.materialGroups) {
|
for (group in Project.materialGroups) {
|
||||||
|
|||||||
Reference in New Issue
Block a user