mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Inline helper.is_enabled, remove unused code, documentation fixes, remove formats and druid_input files, add more tests
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user