From e59a2b0bcbc4a4a26beb04d70d45093a1d3dffa6 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 30 Nov 2024 15:04:05 +0200 Subject: [PATCH] Update --- druid/widget/fps_panel/fps_panel.gui | 2 +- druid/widget/fps_panel/fps_panel.lua | 5 +++++ druid/widget/memory_panel/memory_panel.gui | 2 +- druid/widget/memory_panel/memory_panel.lua | 3 +++ druid/widget/properties_panel/properties_panel.lua | 4 ++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/druid/widget/fps_panel/fps_panel.gui b/druid/widget/fps_panel/fps_panel.gui index bf8b20b..5b85967 100644 --- a/druid/widget/fps_panel/fps_panel.gui +++ b/druid/widget/fps_panel/fps_panel.gui @@ -13,7 +13,7 @@ textures { nodes { size { x: 200.0 - y: 100.0 + y: 140.0 } type: TYPE_BOX id: "root" diff --git a/druid/widget/fps_panel/fps_panel.lua b/druid/widget/fps_panel/fps_panel.lua index 58d9ed5..c86c66b 100644 --- a/druid/widget/fps_panel/fps_panel.lua +++ b/druid/widget/fps_panel/fps_panel.lua @@ -11,6 +11,8 @@ if TARGET_FPS == 0 then end function M:init() + self.root = self:get_node("root") + self.delta_time = 0.1 -- in seconds self.collect_time = 3 -- in seconds self.collect_time_counter = 0 @@ -37,6 +39,9 @@ function M:init() self.timer_id = timer.delay(self.delta_time, true, function() self:push_fps_value() end) + + self.container = self.druid:new_container(self.root) + self.container:add_container(self.mini_graph.container) end diff --git a/druid/widget/memory_panel/memory_panel.gui b/druid/widget/memory_panel/memory_panel.gui index 99e8cf2..80b3b4a 100644 --- a/druid/widget/memory_panel/memory_panel.gui +++ b/druid/widget/memory_panel/memory_panel.gui @@ -13,7 +13,7 @@ textures { nodes { size { x: 200.0 - y: 100.0 + y: 140.0 } type: TYPE_BOX id: "root" diff --git a/druid/widget/memory_panel/memory_panel.lua b/druid/widget/memory_panel/memory_panel.lua index fad517c..3a72ae0 100644 --- a/druid/widget/memory_panel/memory_panel.lua +++ b/druid/widget/memory_panel/memory_panel.lua @@ -37,6 +37,9 @@ function M:init() self.timer_id = timer.delay(self.delta_time, true, function() self:push_next_value() end) + + self.container = self.druid:new_container(self.root) + self.container:add_container(self.mini_graph.container) end diff --git a/druid/widget/properties_panel/properties_panel.lua b/druid/widget/properties_panel/properties_panel.lua index a0e185a..b9c6563 100644 --- a/druid/widget/properties_panel/properties_panel.lua +++ b/druid/widget/properties_panel/properties_panel.lua @@ -249,12 +249,12 @@ end ---@private function M:add_property(widget) gui.set_enabled(widget.root, true) - self.layout:add(widget.root) - table.insert(self.properties, widget) local width = self.layout:get_content_size() widget.container:set_size(width) + self.layout:add(widget.root) + return widget end