From 3781027e06fe4f5cdccf216c64c09f910fbcf1af Mon Sep 17 00:00:00 2001 From: Lubos Lenco Date: Thu, 3 Jun 2021 14:43:04 +0200 Subject: [PATCH] Prevent recursive node groups --- Sources/arm/ui/UINodes.hx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sources/arm/ui/UINodes.hx b/Sources/arm/ui/UINodes.hx index 2ad095e7..16e05a7c 100644 --- a/Sources/arm/ui/UINodes.hx +++ b/Sources/arm/ui/UINodes.hx @@ -754,10 +754,8 @@ class UINodes { } if (isGroupCategory) { 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.enabled = canPlaceGroup(g.canvas.name); if (ui.button(" " + g.canvas.name, Left)) { pushUndo(); var canvas = getCanvas(true); @@ -767,6 +765,7 @@ class UINodes { nodes.nodesSelected = [node]; nodes.nodesDrag = true; } + ui.enabled = true; } } @@ -791,6 +790,14 @@ class UINodes { if (groupStack.length > 0 && groupName == groupStack[groupStack.length - 1].canvas.name) { return false; } + // Recursive node groups + if (groupStack.length > 0) { + for (g in groupStack) { + if (g.canvas.name == groupName) { + return false; + } + } + } // Group was deleted / renamed var groupExists = false; for (group in Project.materialGroups) {