Renamed class functions

This commit is contained in:
Insality
2020-09-29 23:09:37 +03:00
parent b9f8fc95f5
commit 0d07deb23a
19 changed files with 176 additions and 175 deletions

View File

@@ -14,13 +14,13 @@ local Event = require("druid.event")
local const = require("druid.const")
local component = require("druid.component")
local M = component.create("blocker", { const.ON_INPUT })
local Blocker = component.create("blocker", { const.ON_INPUT })
--- Component init function
-- @function blocker:init
-- @tparam node node Gui node
function M.init(self, node)
function Blocker:init(node)
self.node = self:get_node(node)
self.on_click = Event()
@@ -28,7 +28,7 @@ function M.init(self, node)
end
function M.on_input(self, action_id, action)
function Blocker:on_input(action_id, action)
if action_id ~= const.ACTION_TOUCH and
action_id ~= const.ACTION_MULTITOUCH and
action_id ~= nil then
@@ -50,7 +50,7 @@ end
--- Set enabled blocker component state
-- @function blocker:set_enabled
-- @tparam bool state Enabled state
function M.set_enabled(self, state)
function Blocker:set_enabled(state)
gui.set_enabled(self.node, state)
end
@@ -58,9 +58,9 @@ end
--- Return blocked enabled state
-- @function blocker:is_enabled
-- @treturn bool True, if blocker is enabled
function M.is_enabled(self, state)
function Blocker:is_enabled(state)
return gui.is_enabled(self.node)
end
return M
return Blocker