mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Add private annotation
This commit is contained in:
parent
1bc916e187
commit
19ea7fcff9
@ -17,6 +17,7 @@ function M:init(callback, params)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param action_id hash The action id
|
---@param action_id hash The action id
|
||||||
---@param action table The action table
|
---@param action table The action table
|
||||||
---@return boolean is_consumed True if the input was consumed
|
---@return boolean is_consumed True if the input was consumed
|
||||||
|
@ -14,6 +14,7 @@ function M:init(node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param action_id string The action id
|
---@param action_id string The action id
|
||||||
---@param action table The action table
|
---@param action table The action table
|
||||||
---@return boolean is_consumed True if the input was consumed
|
---@return boolean is_consumed True if the input was consumed
|
||||||
|
@ -106,6 +106,7 @@ function M:set_animations_disabled()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_late_init()
|
function M:on_late_init()
|
||||||
if not self.click_zone then
|
if not self.click_zone then
|
||||||
local stencil_node = helper.get_closest_stencil_node(self.node)
|
local stencil_node = helper.get_closest_stencil_node(self.node)
|
||||||
|
@ -72,6 +72,7 @@ function M:init(node_or_node_id, on_drag_callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.drag.style The style of Drag component
|
---@param style druid.drag.style The style of Drag component
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {
|
self.style = {
|
||||||
@ -94,6 +95,7 @@ function M:set_drag_cursors(is_enabled)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_late_init()
|
function M:on_late_init()
|
||||||
if not self.click_zone then
|
if not self.click_zone then
|
||||||
local stencil_node = helper.get_closest_stencil_node(self.node)
|
local stencil_node = helper.get_closest_stencil_node(self.node)
|
||||||
@ -104,6 +106,7 @@ function M:on_late_init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_window_resized()
|
function M:on_window_resized()
|
||||||
local x_koef, y_koef = helper.get_screen_aspect_koef()
|
local x_koef, y_koef = helper.get_screen_aspect_koef()
|
||||||
self._x_koef = x_koef
|
self._x_koef = x_koef
|
||||||
@ -112,6 +115,7 @@ function M:on_window_resized()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_input_interrupt()
|
function M:on_input_interrupt()
|
||||||
if self.is_drag or self.is_touch then
|
if self.is_drag or self.is_touch then
|
||||||
self:_end_touch()
|
self:_end_touch()
|
||||||
@ -119,6 +123,7 @@ function M:on_input_interrupt()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param action_id hash Action id from on_input
|
---@param action_id hash Action id from on_input
|
||||||
---@param action table Action from on_input
|
---@param action table Action from on_input
|
||||||
---@return boolean is_consumed True if the input was consumed
|
---@return boolean is_consumed True if the input was consumed
|
||||||
|
@ -21,6 +21,7 @@ local component = require("druid.component")
|
|||||||
local M = component.create("hover")
|
local M = component.create("hover")
|
||||||
|
|
||||||
|
|
||||||
|
---The constructor for the hover component
|
||||||
---@param node node Gui node
|
---@param node node Gui node
|
||||||
---@param on_hover_callback function Hover callback
|
---@param on_hover_callback function Hover callback
|
||||||
---@param on_mouse_hover function On mouse hover callback
|
---@param on_mouse_hover function On mouse hover callback
|
||||||
@ -37,6 +38,7 @@ function M:init(node, on_hover_callback, on_mouse_hover)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_late_init()
|
function M:on_late_init()
|
||||||
if not self.click_zone then
|
if not self.click_zone then
|
||||||
local stencil_node = helper.get_closest_stencil_node(self.node)
|
local stencil_node = helper.get_closest_stencil_node(self.node)
|
||||||
@ -47,6 +49,7 @@ function M:on_late_init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.hover.style
|
---@param style druid.hover.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {}
|
self.style = {}
|
||||||
@ -55,9 +58,10 @@ function M:on_style_change(style)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---@param action_id hash
|
---@private
|
||||||
---@param action table
|
---@param action_id hash Action id from on_input
|
||||||
---@return boolean
|
---@param action table Action from on_input
|
||||||
|
---@return boolean is_consumed True if the input was consumed
|
||||||
function M:on_input(action_id, action)
|
function M:on_input(action_id, action)
|
||||||
if action_id ~= const.ACTION_TOUCH and action_id ~= nil then
|
if action_id ~= const.ACTION_TOUCH and action_id ~= nil then
|
||||||
return false
|
return false
|
||||||
@ -92,6 +96,7 @@ function M:on_input(action_id, action)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_input_interrupt()
|
function M:on_input_interrupt()
|
||||||
self:set_hover(false)
|
self:set_hover(false)
|
||||||
end
|
end
|
||||||
|
@ -87,6 +87,7 @@ function M:init(view_node, content_node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.scroll.style
|
---@param style druid.scroll.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {}
|
self.style = {}
|
||||||
@ -111,6 +112,7 @@ function M:on_style_change(style)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_late_init()
|
function M:on_late_init()
|
||||||
if not self.click_zone then
|
if not self.click_zone then
|
||||||
local stencil_node = helper.get_closest_stencil_node(self.node)
|
local stencil_node = helper.get_closest_stencil_node(self.node)
|
||||||
@ -121,11 +123,13 @@ function M:on_late_init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_layout_change()
|
function M:on_layout_change()
|
||||||
gui.set_position(self.content_node, self.position)
|
gui.set_position(self.content_node, self.position)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:update(dt)
|
function M:update(dt)
|
||||||
if self.is_animate then
|
if self.is_animate then
|
||||||
self.position.x = gui.get(self.content_node, "position.x") --[[@as number]]
|
self.position.x = gui.get(self.content_node, "position.x") --[[@as number]]
|
||||||
@ -141,11 +145,13 @@ function M:update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_input(action_id, action)
|
function M:on_input(action_id, action)
|
||||||
return self:_process_scroll_wheel(action_id, action)
|
return self:_process_scroll_wheel(action_id, action)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_remove()
|
function M:on_remove()
|
||||||
self:bind_grid(nil)
|
self:bind_grid(nil)
|
||||||
end
|
end
|
||||||
|
@ -62,6 +62,7 @@ function M:init(parent, element, in_row)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.grid.style
|
---@param style druid.grid.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {
|
self.style = {
|
||||||
@ -122,6 +123,7 @@ function M:get_index_by_node(node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_layout_change()
|
function M:on_layout_change()
|
||||||
self:_update(true)
|
self:_update(true)
|
||||||
end
|
end
|
||||||
|
@ -53,6 +53,7 @@ function M:init(node, value, adjust_type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.text.style
|
---@param style druid.text.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {
|
self.style = {
|
||||||
@ -64,6 +65,7 @@ function M:on_style_change(style)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_layout_change()
|
function M:on_layout_change()
|
||||||
self:set_text(self.last_value)
|
self:set_text(self.last_value)
|
||||||
end
|
end
|
||||||
|
@ -91,6 +91,7 @@ function M:init(text_node, value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_layout_change()
|
function M:on_layout_change()
|
||||||
if self._last_value then
|
if self._last_value then
|
||||||
self:set_text(self._last_value)
|
self:set_text(self._last_value)
|
||||||
@ -98,6 +99,7 @@ function M:on_layout_change()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.rich_text.style
|
---@param style druid.rich_text.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {
|
self.style = {
|
||||||
|
@ -113,6 +113,7 @@ function M:init(click_node, text_node, keyboard_type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.input.style
|
---@param style druid.input.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {
|
self.style = {
|
||||||
@ -127,6 +128,7 @@ function M:on_style_change(style)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param action_id hash|nil The action id
|
---@param action_id hash|nil The action id
|
||||||
---@param action action The action
|
---@param action action The action
|
||||||
---@return boolean is_consume True if the action is consumed
|
---@return boolean is_consume True if the action is consumed
|
||||||
|
@ -36,6 +36,7 @@ function M:init(node_or_node_id, on_swipe_callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_late_init()
|
function M:on_late_init()
|
||||||
if not self.click_zone then
|
if not self.click_zone then
|
||||||
local stencil_node = helper.get_closest_stencil_node(self.node)
|
local stencil_node = helper.get_closest_stencil_node(self.node)
|
||||||
@ -46,6 +47,7 @@ function M:on_late_init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param style druid.swipe.style
|
---@param style druid.swipe.style
|
||||||
function M:on_style_change(style)
|
function M:on_style_change(style)
|
||||||
self.style = {
|
self.style = {
|
||||||
@ -56,6 +58,7 @@ function M:on_style_change(style)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
---@param action_id hash The action id
|
---@param action_id hash The action id
|
||||||
---@param action action The action table
|
---@param action action The action table
|
||||||
---@return boolean is_consumed True if the input was consumed
|
---@return boolean is_consumed True if the input was consumed
|
||||||
@ -90,6 +93,7 @@ function M:on_input(action_id, action)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_input_interrupt()
|
function M:on_input_interrupt()
|
||||||
self:_reset_swipe()
|
self:_reset_swipe()
|
||||||
end
|
end
|
||||||
|
@ -42,6 +42,7 @@ function M:init(node, seconds_from, seconds_to, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:update(dt)
|
function M:update(dt)
|
||||||
if not self.is_on then
|
if not self.is_on then
|
||||||
return
|
return
|
||||||
@ -65,6 +66,7 @@ function M:update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@private
|
||||||
function M:on_layout_change()
|
function M:on_layout_change()
|
||||||
self:set_to(self.last_value)
|
self:set_to(self.last_value)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user