diff --git a/druid/base/back_handler.lua b/druid/base/back_handler.lua index ff9b3e2..68ce45b 100644 --- a/druid/base/back_handler.lua +++ b/druid/base/back_handler.lua @@ -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 diff --git a/druid/base/blocker.lua b/druid/base/blocker.lua index 9859a90..e1cc854 100644 --- a/druid/base/blocker.lua +++ b/druid/base/blocker.lua @@ -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 diff --git a/druid/base/button.lua b/druid/base/button.lua index eafe4cd..120d651 100755 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -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) diff --git a/druid/base/drag.lua b/druid/base/drag.lua index f2148df..65a3674 100644 --- a/druid/base/drag.lua +++ b/druid/base/drag.lua @@ -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 diff --git a/druid/base/hover.lua b/druid/base/hover.lua index be8cc4f..315316d 100644 --- a/druid/base/hover.lua +++ b/druid/base/hover.lua @@ -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 diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index ee46037..82c18f2 100755 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -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 diff --git a/druid/base/static_grid.lua b/druid/base/static_grid.lua index 5d38ced..155dd18 100644 --- a/druid/base/static_grid.lua +++ b/druid/base/static_grid.lua @@ -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 diff --git a/druid/base/text.lua b/druid/base/text.lua index 4fe2ad6..2b4d78e 100755 --- a/druid/base/text.lua +++ b/druid/base/text.lua @@ -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 diff --git a/druid/custom/rich_text/rich_text.lua b/druid/custom/rich_text/rich_text.lua index 3f36ee2..b5d5183 100644 --- a/druid/custom/rich_text/rich_text.lua +++ b/druid/custom/rich_text/rich_text.lua @@ -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 = { diff --git a/druid/extended/input.lua b/druid/extended/input.lua index 3a521fd..693142e 100755 --- a/druid/extended/input.lua +++ b/druid/extended/input.lua @@ -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 diff --git a/druid/extended/swipe.lua b/druid/extended/swipe.lua index 0a3aa73..203126e 100644 --- a/druid/extended/swipe.lua +++ b/druid/extended/swipe.lua @@ -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 diff --git a/druid/extended/timer.lua b/druid/extended/timer.lua index 557c8e3..f39fbd7 100644 --- a/druid/extended/timer.lua +++ b/druid/extended/timer.lua @@ -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