From 917a84fc94631cd42d26975036e2fd9a46b88718 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 30 Nov 2024 22:52:27 +0200 Subject: [PATCH] Update --- druid/widget/mini_graph/mini_graph.gui | 2 +- .../properties_panel/properties_panel.lua | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/druid/widget/mini_graph/mini_graph.gui b/druid/widget/mini_graph/mini_graph.gui index 161f0df..11ad730 100644 --- a/druid/widget/mini_graph/mini_graph.gui +++ b/druid/widget/mini_graph/mini_graph.gui @@ -67,7 +67,7 @@ nodes { } type: TYPE_TEXT text: "Mini Graph" - font: "druid_text_regular" + font: "druid_text_bold" id: "text_header" pivot: PIVOT_NW outline { diff --git a/druid/widget/properties_panel/properties_panel.lua b/druid/widget/properties_panel/properties_panel.lua index b9c6563..f19af12 100644 --- a/druid/widget/properties_panel/properties_panel.lua +++ b/druid/widget/properties_panel/properties_panel.lua @@ -99,7 +99,16 @@ end function M:clear_created_properties() for index = 1, #self.properties do - gui.delete_node(self.properties[index].root) + local property = self.properties[index] + + -- If prefab used clone nodes we can remove it + if property:get_nodes() then + gui.delete_node(property.root) + else + -- Probably we have component placed on scene directly + gui.set_enabled(property.root, false) + end + self.druid:remove(self.properties[index]) end self.properties = {} @@ -264,7 +273,15 @@ function M:remove(widget) if self.properties[index] == widget then self.druid:remove(widget) self.layout:remove(widget.root) - gui.delete_node(widget.root) + + -- If prefab used clone nodes we can remove it + if widget:get_nodes() then + gui.delete_node(widget.root) + else + -- Probably we have component placed on scene directly + gui.set_enabled(widget.root, false) + end + table.remove(self.properties, index) break end