Update private annotations

This commit is contained in:
Insality 2025-03-18 21:41:09 +02:00
parent 19ea7fcff9
commit 3c063313de
9 changed files with 36 additions and 11 deletions

View File

@ -94,13 +94,16 @@ function M:on_style_change(style)
end
---Remove default button style animations
---@return druid.button self The current button instance
function M:set_animations_disabled()
self.style.on_click = function() end
self.style.on_click_disabled = function() end
self.style.on_mouse_hover = function() end
self.style.on_hover = function() end
self.style.on_set_enabled = function() end
local empty_function = function() end
self.style.on_click = empty_function
self.style.on_hover = empty_function
self.style.on_mouse_hover = empty_function
self.style.on_set_enabled = empty_function
self.style.on_click_disabled = empty_function
return self
end
@ -117,6 +120,7 @@ function M:on_late_init()
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
@ -201,6 +205,7 @@ function M:on_input(action_id, action)
end
---@private
function M:on_input_interrupt()
self.can_action = false
self.hover:set_hover(false)

View File

@ -191,6 +191,10 @@ function M:init(template, nodes)
end
---@private
---@param action_id hash Action id from on_input
---@param action table Action table from on_input
---@return boolean is_consumed True if input was consumed
function M:on_input(action_id, action)
if action_id == const.ACTION_LSHIFT then
if action.pressed then

View File

@ -94,6 +94,7 @@ function M:init(node, mode, callback)
end
---@private
function M:on_late_init()
if not gui.get_parent(self.node) then
-- TODO: Scale issue here, in fit into window!
@ -102,6 +103,7 @@ function M:on_late_init()
end
---@private
function M:on_remove()
self:clear_draggable_corners()
end
@ -124,8 +126,8 @@ function M:set_pivot(pivot)
end
---Set the style of the container
---@param style druid.container.style The style to set
---@private
---@param style druid.container.style
function M:on_style_change(style)
self.style = {
DRAGGABLE_CORNER_SIZE = style.DRAGGABLE_CORNER_SIZE or vmath.vector3(24, 24, 0),
@ -231,6 +233,7 @@ function M:fit_into_window()
end
---@private
function M:on_window_resized()
local x_koef, y_koef = helper.get_screen_aspect_koef()
self.x_koef = x_koef

View File

@ -50,7 +50,7 @@ function M:init(scroll, grid, create_function)
end
---Druid System on_remove function
---@private
function M:on_remove()
self:clear()
self.scroll.on_scroll:unsubscribe(self._refresh, self)

View File

@ -34,6 +34,7 @@ function M:init(keys, callback, callback_argument)
end
---@private
---@param style druid.hotkey.style
function M:on_style_change(style)
self.style = {
@ -103,6 +104,7 @@ function M:is_processing()
end
---@private
function M:on_focus_gained()
for k, v in pairs(self._modificators) do
self._modificators[k] = false
@ -110,6 +112,7 @@ function M:on_focus_gained()
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

@ -230,11 +230,13 @@ function M:on_input(action_id, action)
end
---@private
function M:on_focus_lost()
self:unselect()
end
---@private
function M:on_input_interrupt()
--self:unselect()
end

View File

@ -30,6 +30,7 @@ function M:init(node, locale_id, adjust_type)
end
---@private
function M:on_language_change()
if self.last_locale then
self:translate(self.last_locale, unpack(self.last_locale_args))

View File

@ -45,6 +45,7 @@ function M:init(node, key, init_value)
end
---@private
---@param style druid.progress.style
function M:on_style_change(style)
self.style = {
@ -54,11 +55,13 @@ function M:on_style_change(style)
end
---@private
function M:on_layout_change()
self:set_to(self.last_value)
end
---@private
function M:on_remove()
gui.set_size(self.node, self.max_size)
end

View File

@ -43,17 +43,20 @@ function M:init(node, end_pos, callback)
end
---@private
function M:on_layout_change()
self:set(self.value)
end
---@private
function M:on_remove()
-- Return pin to start position
gui.set_position(self.node, self.start_pos)
end
---@private
function M:on_window_resized()
local x_koef, y_koef = helper.get_screen_aspect_koef()
self._x_koef = x_koef
@ -62,9 +65,10 @@ function M:on_window_resized()
end
---@param action_id number The action id
---@param action action The action table
---@return boolean is_consumed True if the input was consumed
---@private
---@param action_id hash Action id from on_input
---@param action table Action table from on_input
---@return boolean is_consumed True if input was consumed
function M:on_input(action_id, action)
if action_id ~= const.ACTION_TOUCH then
return false