mirror of
https://github.com/Insality/druid
synced 2025-06-27 02:17:52 +02:00
Update
This commit is contained in:
parent
46223f0bb8
commit
72692f5efc
@ -14,13 +14,6 @@ local component = require("druid.component")
|
||||
local M = component.create("timer")
|
||||
|
||||
|
||||
local function second_string_min(sec)
|
||||
local mins = math.floor(sec / 60)
|
||||
local seconds = math.floor(sec - mins * 60)
|
||||
return string.format("%.2d:%.2d", mins, seconds)
|
||||
end
|
||||
|
||||
|
||||
---@param node node Gui text node
|
||||
---@param seconds_from number|nil Start timer value in seconds
|
||||
---@param seconds_to number|nil End timer value in seconds
|
||||
@ -80,7 +73,7 @@ end
|
||||
---@return druid.timer self
|
||||
function M:set_to(set_to)
|
||||
self.last_value = set_to
|
||||
gui.set_text(self.node, second_string_min(set_to))
|
||||
gui.set_text(self.node, self:_second_string_min(set_to))
|
||||
|
||||
return self
|
||||
end
|
||||
@ -111,4 +104,11 @@ function M:set_interval(from, to)
|
||||
end
|
||||
|
||||
|
||||
function M:_second_string_min(sec)
|
||||
local mins = math.floor(sec / 60)
|
||||
local seconds = math.floor(sec - mins * 60)
|
||||
return string.format("%.2d:%.2d", mins, seconds)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
@ -9,7 +9,9 @@ function M.get_text(text_id, ...)
|
||||
return "[Druid]: locales not inited"
|
||||
end
|
||||
|
||||
|
||||
function M.play_sound(sound_id)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
@ -10,6 +10,7 @@ if TARGET_FPS == 0 then
|
||||
TARGET_FPS = 60
|
||||
end
|
||||
|
||||
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
|
||||
|
@ -5,6 +5,7 @@ local mini_graph = require("druid.widget.mini_graph.mini_graph")
|
||||
---@field root node
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
self.delta_time = 0.1
|
||||
|
@ -9,6 +9,7 @@ local color = require("druid.color")
|
||||
---@field druid druid.instance
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
self.text_name = self.druid:new_text("text_name")
|
||||
|
Loading…
x
Reference in New Issue
Block a user