Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Nov 20, 2024
1 parent c0abfd3 commit 4ef6557
Show file tree
Hide file tree
Showing 12 changed files with 817 additions and 6 deletions.
5 changes: 5 additions & 0 deletions druid/widget/fps_panel/fps_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function M:init()
end


function M:on_remove()
timer.cancel(self.timer_id)
end


function M:update(dt)
if not self.previous_time then
self.previous_time = socket.gettime()
Expand Down
5 changes: 5 additions & 0 deletions druid/widget/memory_panel/memory_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ function M:init()
end


function M:on_remove()
timer.cancel(self.timer_id)
end


function M:set_low_memory_limit(limit)
self.memory_limit = limit
end
Expand Down
15 changes: 13 additions & 2 deletions druid/widget/mini_graph/mini_graph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,24 @@ function M:init()
end


function M:set_samples(samples)
self.samples = samples
function M:on_remove()
self:clear()
end


function M:clear()
self.layout:clear_layout()
for index = 1, #self.lines do
gui.delete_node(self.lines[index])
end

self.lines = {}
end


function M:set_samples(samples)
self.samples = samples
self:clear()

local line_width = self.layout:get_size().x / self.samples
for index = 1, self.samples do
Expand Down
4 changes: 2 additions & 2 deletions druid/widget/properties_panel/properties/property_button.gui
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ nodes {
}
type: TYPE_TEXT
text: "Button"
font: "text_bold"
font: "druid_text_bold"
id: "text_name"
pivot: PIVOT_W
outline {
Expand Down Expand Up @@ -134,7 +134,7 @@ nodes {
}
type: TYPE_TEXT
text: "Button"
font: "text_bold"
font: "druid_text_bold"
id: "text_button"
outline {
x: 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ nodes {
}
type: TYPE_TEXT
text: "Checkbox"
font: "text_bold"
font: "druid_text_bold"
id: "text_name"
pivot: PIVOT_W
outline {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ function M:init()

self.text_value = self.druid:new_text("text_value")
self.button_left = self.druid:new_button("button_left", self.on_button_left)
self.button_left.on_repeated_click:subscribe(self.on_button_left, self)

self.button_right = self.druid:new_button("button_right", self.on_button_right)
self.button_right.on_repeated_click:subscribe(self.on_button_right, self)

self.on_change_value = event.create()

Expand Down
5 changes: 5 additions & 0 deletions druid/widget/properties_panel/properties_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ function M:init()
end


function M:on_remove()
self:clear()
end


function M:on_drag_widget(dx, dy)
local position = self.container:get_position()
self.container:set_position(position.x + dx, position.y + dy)
Expand Down
Loading

0 comments on commit 4ef6557

Please sign in to comment.