Add private annotation

This commit is contained in:
Insality 2025-03-18 21:32:11 +02:00
parent 1bc916e187
commit 19ea7fcff9
12 changed files with 36 additions and 3 deletions

View File

@ -17,6 +17,7 @@ function M:init(callback, params)
end
---@private
---@param action_id hash The action id
---@param action table The action table
---@return boolean is_consumed True if the input was consumed

View File

@ -14,6 +14,7 @@ function M:init(node)
end
---@private
---@param action_id string The action id
---@param action table The action table
---@return boolean is_consumed True if the input was consumed

View File

@ -106,6 +106,7 @@ function M:set_animations_disabled()
end
---@private
function M:on_late_init()
if not self.click_zone then
local stencil_node = helper.get_closest_stencil_node(self.node)

View File

@ -72,6 +72,7 @@ function M:init(node_or_node_id, on_drag_callback)
end
---@private
---@param style druid.drag.style The style of Drag component
function M:on_style_change(style)
self.style = {
@ -94,6 +95,7 @@ function M:set_drag_cursors(is_enabled)
end
---@private
function M:on_late_init()
if not self.click_zone then
local stencil_node = helper.get_closest_stencil_node(self.node)
@ -104,6 +106,7 @@ function M:on_late_init()
end
---@private
function M:on_window_resized()
local x_koef, y_koef = helper.get_screen_aspect_koef()
self._x_koef = x_koef
@ -112,6 +115,7 @@ function M:on_window_resized()
end
---@private
function M:on_input_interrupt()
if self.is_drag or self.is_touch then
self:_end_touch()
@ -119,6 +123,7 @@ function M:on_input_interrupt()
end
---@private
---@param action_id hash Action id from on_input
---@param action table Action from on_input
---@return boolean is_consumed True if the input was consumed

View File

@ -21,6 +21,7 @@ local component = require("druid.component")
local M = component.create("hover")
---The constructor for the hover component
---@param node node Gui node
---@param on_hover_callback function 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
---@private
function M:on_late_init()
if not self.click_zone then
local stencil_node = helper.get_closest_stencil_node(self.node)
@ -47,6 +49,7 @@ function M:on_late_init()
end
---@private
---@param style druid.hover.style
function M:on_style_change(style)
self.style = {}
@ -55,9 +58,10 @@ function M:on_style_change(style)
end
---@param action_id hash
---@param action table
---@return boolean
---@private
---@param action_id hash Action id from on_input
---@param action table Action from on_input
---@return boolean is_consumed True if the input was consumed
function M:on_input(action_id, action)
if action_id ~= const.ACTION_TOUCH and action_id ~= nil then
return false
@ -92,6 +96,7 @@ function M:on_input(action_id, action)
end
---@private
function M:on_input_interrupt()
self:set_hover(false)
end

View File

@ -87,6 +87,7 @@ function M:init(view_node, content_node)
end
---@private
---@param style druid.scroll.style
function M:on_style_change(style)
self.style = {}
@ -111,6 +112,7 @@ function M:on_style_change(style)
end
---@private
function M:on_late_init()
if not self.click_zone then
local stencil_node = helper.get_closest_stencil_node(self.node)
@ -121,11 +123,13 @@ function M:on_late_init()
end
---@private
function M:on_layout_change()
gui.set_position(self.content_node, self.position)
end
---@private
function M:update(dt)
if self.is_animate then
self.position.x = gui.get(self.content_node, "position.x") --[[@as number]]
@ -141,11 +145,13 @@ function M:update(dt)
end
---@private
function M:on_input(action_id, action)
return self:_process_scroll_wheel(action_id, action)
end
---@private
function M:on_remove()
self:bind_grid(nil)
end

View File

@ -62,6 +62,7 @@ function M:init(parent, element, in_row)
end
---@private
---@param style druid.grid.style
function M:on_style_change(style)
self.style = {
@ -122,6 +123,7 @@ function M:get_index_by_node(node)
end
---@private
function M:on_layout_change()
self:_update(true)
end

View File

@ -53,6 +53,7 @@ function M:init(node, value, adjust_type)
end
---@private
---@param style druid.text.style
function M:on_style_change(style)
self.style = {
@ -64,6 +65,7 @@ function M:on_style_change(style)
end
---@private
function M:on_layout_change()
self:set_text(self.last_value)
end

View File

@ -91,6 +91,7 @@ function M:init(text_node, value)
end
---@private
function M:on_layout_change()
if self._last_value then
self:set_text(self._last_value)
@ -98,6 +99,7 @@ function M:on_layout_change()
end
---@private
---@param style druid.rich_text.style
function M:on_style_change(style)
self.style = {

View File

@ -113,6 +113,7 @@ function M:init(click_node, text_node, keyboard_type)
end
---@private
---@param style druid.input.style
function M:on_style_change(style)
self.style = {
@ -127,6 +128,7 @@ function M:on_style_change(style)
end
---@private
---@param action_id hash|nil The action id
---@param action action The action
---@return boolean is_consume True if the action is consumed

View File

@ -36,6 +36,7 @@ function M:init(node_or_node_id, on_swipe_callback)
end
---@private
function M:on_late_init()
if not self.click_zone then
local stencil_node = helper.get_closest_stencil_node(self.node)
@ -46,6 +47,7 @@ function M:on_late_init()
end
---@private
---@param style druid.swipe.style
function M:on_style_change(style)
self.style = {
@ -56,6 +58,7 @@ function M:on_style_change(style)
end
---@private
---@param action_id hash The action id
---@param action action The action table
---@return boolean is_consumed True if the input was consumed
@ -90,6 +93,7 @@ function M:on_input(action_id, action)
end
---@private
function M:on_input_interrupt()
self:_reset_swipe()
end

View File

@ -42,6 +42,7 @@ function M:init(node, seconds_from, seconds_to, callback)
end
---@private
function M:update(dt)
if not self.is_on then
return
@ -65,6 +66,7 @@ function M:update(dt)
end
---@private
function M:on_layout_change()
self:set_to(self.last_value)
end