mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Rename locale -> lang_text
This commit is contained in:
@@ -16,6 +16,26 @@ local function on_button_hover(self, hover_state)
|
||||
self.style.on_hover(self, self.anim_node, hover_state)
|
||||
end
|
||||
|
||||
|
||||
local function on_button_release(self)
|
||||
if not self.disabled then
|
||||
if not self.stub and self.can_action then
|
||||
self.can_action = false
|
||||
if self.style.on_click then
|
||||
self.style.on_click(self, self.anim_node)
|
||||
end
|
||||
self.callback(self:get_context(), self.params, self)
|
||||
end
|
||||
return true
|
||||
else
|
||||
if self.style.on_click_disabled then
|
||||
self.style.on_click_disabled(self, self.anim_node)
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
-- @function button:init
|
||||
-- @tparam table self Component instance
|
||||
@@ -44,25 +64,6 @@ function M.init(self, node, callback, params, anim_node, event)
|
||||
end
|
||||
|
||||
|
||||
local function on_button_release(self)
|
||||
if not self.disabled then
|
||||
if not self.stub and self.can_action then
|
||||
self.can_action = false
|
||||
if self.style.on_click then
|
||||
self.style.on_click(self, self.anim_node)
|
||||
end
|
||||
self.callback(self:get_context(), self.params, self)
|
||||
end
|
||||
return true
|
||||
else
|
||||
if self.style.on_click_disabled then
|
||||
self.style.on_click_disabled(self, self.anim_node)
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function M.on_input(self, action_id, action)
|
||||
if action_id ~= const.ACTION_TOUCH then
|
||||
return false
|
||||
|
Reference in New Issue
Block a user