Inline helper.is_enabled, remove unused code, documentation fixes, remove formats and druid_input files, add more tests

This commit is contained in:
Insality
2023-07-15 11:53:07 +03:00
parent c01ee189b4
commit 38c117b9d8
20 changed files with 275 additions and 134 deletions

View File

@@ -116,7 +116,7 @@ function Swipe.on_input(self, action_id, action)
return false
end
if not helper.is_enabled(self.node) then
if not gui.is_enabled(self.node, true) then
return false
end

View File

@@ -31,13 +31,19 @@
---
local Event = require("druid.event")
local formats = require("druid.helper.formats")
local helper = require("druid.helper")
local component = require("druid.component")
local Timer = 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
--- Component init function
-- @tparam Timer self @{Timer}
-- @tparam node node Gui text node
@@ -98,7 +104,7 @@ end
-- @tparam number set_to Value in seconds
function Timer.set_to(self, set_to)
self.last_value = set_to
gui.set_text(self.node, formats.second_string_min(set_to))
gui.set_text(self.node, second_string_min(set_to))
end