Rename back hold_click -> hold_callback

This commit is contained in:
Insality 2020-03-22 15:24:47 +03:00
parent 959f367dd7
commit 696622b42b
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ Basic Druid input component
- **on_click** - basic button callback
- **on_repeated_click** - repeated click callback, while holding the button, don't trigger if callback is empty
- **on_long_click** - callback on long button tap, don't trigger if callback is empty
- **on_hold_click** - hold callback, before long_click trigger, don't trigger if callback is empty
- **on_hold_callback** - hold callback, before long_click trigger, don't trigger if callback is empty
- **on_double_click** - different callback, if tap button 2+ in row, don't trigger if callback is empty
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use `button:set_click_zone` to restrict button click zone
- Button can have key trigger to use then by key: `button:set_key_trigger`

View File

@ -7,7 +7,7 @@
-- @tfield druid_event on_repeated_click On repeated action button callback
-- @tfield druid_event on_long_click On long tap button callback
-- @tfield druid_event on_double_click On double tap button callback
-- @tfield druid_event on_hold_click On button hold before long_click callback
-- @tfield druid_event on_hold_callback On button hold before long_click callback
--- Component fields
-- @table Fields
@ -100,7 +100,7 @@ end
local function on_button_hold(self, press_time)
self.on_hold_click:trigger(self:get_context(), self.params, self, press_time)
self.on_hold_callback:trigger(self:get_context(), self.params, self, press_time)
end
@ -168,7 +168,7 @@ function M.init(self, node, callback, params, anim_node, event)
self.on_repeated_click = Event()
self.on_long_click = Event()
self.on_double_click = Event()
self.on_hold_click = Event()
self.on_hold_callback = Event()
end