mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Rename type druid.base_component -> druid.component
This commit is contained in:
parent
3a559d7ac2
commit
ef86b387c2
@ -2,7 +2,7 @@ local event = require("event.event")
|
|||||||
local const = require("druid.const")
|
local const = require("druid.const")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.back_handler: druid.base_component
|
---@class druid.back_handler: druid.component
|
||||||
---@field on_back event Trigger on back handler action, fun(self, params)
|
---@field on_back event Trigger on back handler action, fun(self, params)
|
||||||
---@field params any|nil Custom args to pass in the callback
|
---@field params any|nil Custom args to pass in the callback
|
||||||
local M = component.create("back_handler")
|
local M = component.create("back_handler")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local const = require("druid.const")
|
local const = require("druid.const")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.blocker: druid.base_component
|
---@class druid.blocker: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field private _is_enabled boolean
|
---@field private _is_enabled boolean
|
||||||
local M = component.create("blocker")
|
local M = component.create("blocker")
|
||||||
|
@ -142,7 +142,7 @@ local helper = require("druid.helper")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---Clickable node with various interaction callbacks
|
---Clickable node with various interaction callbacks
|
||||||
---@class druid.button: druid.base_component
|
---@class druid.button: druid.component
|
||||||
---@field on_click event function(self, custom_args, button_instance)
|
---@field on_click event function(self, custom_args, button_instance)
|
||||||
---@field on_pressed event
|
---@field on_pressed event
|
||||||
---@field on_repeated_click event
|
---@field on_repeated_click event
|
||||||
|
@ -66,7 +66,7 @@ local component = require("druid.component")
|
|||||||
---@field DRAG_DEADZONE number Distance in pixels to start dragging. Default: 10
|
---@field DRAG_DEADZONE number Distance in pixels to start dragging. Default: 10
|
||||||
---@field NO_USE_SCREEN_KOEF boolean If screen aspect ratio affects on drag values. Default: false
|
---@field NO_USE_SCREEN_KOEF boolean If screen aspect ratio affects on drag values. Default: false
|
||||||
|
|
||||||
---@class druid.drag: druid.base_component
|
---@class druid.drag: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_touch_start event
|
---@field on_touch_start event
|
||||||
---@field on_touch_end event
|
---@field on_touch_end event
|
||||||
|
@ -21,7 +21,7 @@ local const = require("druid.const")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.hover: druid.base_component
|
---@class druid.hover: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_hover event
|
---@field on_hover event
|
||||||
---@field on_mouse_hover event
|
---@field on_mouse_hover event
|
||||||
|
@ -90,7 +90,7 @@ local const = require("druid.const")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.scroll: druid.base_component
|
---@class druid.scroll: druid.component
|
||||||
---@field node node The root node
|
---@field node node The root node
|
||||||
---@field click_zone node|nil Optional click zone to restrict scroll area
|
---@field click_zone node|nil Optional click zone to restrict scroll area
|
||||||
---@field on_scroll event Triggered on scroll move with (self, position)
|
---@field on_scroll event Triggered on scroll move with (self, position)
|
||||||
|
@ -82,7 +82,7 @@ local event = require("event.event")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.grid: druid.base_component
|
---@class druid.grid: druid.component
|
||||||
---@field on_add_item event
|
---@field on_add_item event
|
||||||
---@field on_remove_item event
|
---@field on_remove_item event
|
||||||
---@field on_change_items event
|
---@field on_change_items event
|
||||||
|
@ -83,7 +83,7 @@ local utf8_lua = require("druid.system.utf8")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local utf8 = utf8 or utf8_lua --[[@as utf8]]
|
local utf8 = utf8 or utf8_lua --[[@as utf8]]
|
||||||
|
|
||||||
---@class druid.text: druid.base_component
|
---@class druid.text: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_set_text event
|
---@field on_set_text event
|
||||||
---@field on_update_text_scale event
|
---@field on_update_text_scale event
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local const = require("druid.const")
|
local const = require("druid.const")
|
||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
|
|
||||||
---@class druid.base_component.meta
|
---@class druid.component.meta
|
||||||
---@field template string
|
---@field template string
|
||||||
---@field context table
|
---@field context table
|
||||||
---@field nodes table<hash, node>|nil
|
---@field nodes table<hash, node>|nil
|
||||||
@ -9,32 +9,32 @@ local helper = require("druid.helper")
|
|||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field input_enabled boolean
|
---@field input_enabled boolean
|
||||||
---@field children table
|
---@field children table
|
||||||
---@field parent druid.base_component|nil
|
---@field parent druid.component|nil
|
||||||
---@field instance_class table
|
---@field instance_class table
|
||||||
|
|
||||||
---@class druid.base_component.component
|
---@class druid.component.component
|
||||||
---@field name string
|
---@field name string
|
||||||
---@field input_priority number
|
---@field input_priority number
|
||||||
---@field default_input_priority number
|
---@field default_input_priority number
|
||||||
---@field _is_input_priority_changed boolean
|
---@field _is_input_priority_changed boolean
|
||||||
---@field _uid number
|
---@field _uid number
|
||||||
|
|
||||||
---@class druid.base_component
|
---@class druid.component
|
||||||
---@field druid druid.instance Druid instance to create inner components
|
---@field druid druid.instance Druid instance to create inner components
|
||||||
---@field init fun(self:druid.base_component, ...)|nil
|
---@field init fun(self:druid.component, ...)|nil
|
||||||
---@field update fun(self:druid.base_component, dt:number)|nil
|
---@field update fun(self:druid.component, dt:number)|nil
|
||||||
---@field on_remove fun(self:druid.base_component)|nil
|
---@field on_remove fun(self:druid.component)|nil
|
||||||
---@field on_input fun(self:druid.base_component, action_id:number, action:table)|nil
|
---@field on_input fun(self:druid.component, action_id:number, action:table)|nil
|
||||||
---@field on_message fun(self:druid.base_component, message_id:hash, message:table, sender:url)|nil
|
---@field on_message fun(self:druid.component, message_id:hash, message:table, sender:url)|nil
|
||||||
---@field on_late_init fun(self:druid.base_component)|nil
|
---@field on_late_init fun(self:druid.component)|nil
|
||||||
---@field on_focus_lost fun(self:druid.base_component)|nil
|
---@field on_focus_lost fun(self:druid.component)|nil
|
||||||
---@field on_focus_gained fun(self:druid.base_component)|nil
|
---@field on_focus_gained fun(self:druid.component)|nil
|
||||||
---@field on_style_change fun(self:druid.base_component, style: table)|nil
|
---@field on_style_change fun(self:druid.component, style: table)|nil
|
||||||
---@field on_layout_change fun(self:druid.base_component)|nil
|
---@field on_layout_change fun(self:druid.component)|nil
|
||||||
---@field on_window_resized fun(self:druid.base_component)|nil
|
---@field on_window_resized fun(self:druid.component)|nil
|
||||||
---@field on_language_change fun(self:druid.base_component)|nil
|
---@field on_language_change fun(self:druid.component)|nil
|
||||||
---@field private _component druid.base_component.component
|
---@field private _component druid.component.component
|
||||||
---@field private _meta druid.base_component.meta
|
---@field private _meta druid.component.meta
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local INTERESTS = {} -- Cache interests per component class in runtime
|
local INTERESTS = {} -- Cache interests per component class in runtime
|
||||||
@ -54,7 +54,7 @@ end
|
|||||||
---@param druid_style table|nil
|
---@param druid_style table|nil
|
||||||
---@return T self The component itself for chaining
|
---@return T self The component itself for chaining
|
||||||
function M:set_style(druid_style)
|
function M:set_style(druid_style)
|
||||||
---@cast self druid.base_component
|
---@cast self druid.component
|
||||||
|
|
||||||
self._meta.style = druid_style or {}
|
self._meta.style = druid_style or {}
|
||||||
local component_style = self._meta.style[self._component.name] or {}
|
local component_style = self._meta.style[self._component.name] or {}
|
||||||
@ -75,7 +75,7 @@ end
|
|||||||
---@param template string|nil
|
---@param template string|nil
|
||||||
---@return T self The component itself for chaining
|
---@return T self The component itself for chaining
|
||||||
function M:set_template(template)
|
function M:set_template(template)
|
||||||
---@cast self druid.base_component
|
---@cast self druid.component
|
||||||
|
|
||||||
template = template or ""
|
template = template or ""
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ end
|
|||||||
|
|
||||||
---Set current component nodes, returned from `gui.clone_tree` function.
|
---Set current component nodes, returned from `gui.clone_tree` function.
|
||||||
---@param nodes table<hash, node>
|
---@param nodes table<hash, node>
|
||||||
---@return druid.base_component
|
---@return druid.component
|
||||||
function M:set_nodes(nodes)
|
function M:set_nodes(nodes)
|
||||||
self._meta.nodes = nodes
|
self._meta.nodes = nodes
|
||||||
return self
|
return self
|
||||||
@ -176,7 +176,7 @@ end
|
|||||||
---Set component input priority, the bigger number processed first. Default value: 10
|
---Set component input priority, the bigger number processed first. Default value: 10
|
||||||
---@param value number
|
---@param value number
|
||||||
---@param is_temporary boolean|nil If true, the reset input priority will return to previous value
|
---@param is_temporary boolean|nil If true, the reset input priority will return to previous value
|
||||||
---@return druid.base_component self The component itself for chaining
|
---@return druid.component self The component itself for chaining
|
||||||
function M:set_input_priority(value, is_temporary)
|
function M:set_input_priority(value, is_temporary)
|
||||||
assert(value)
|
assert(value)
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Reset component input priority to it's default value, that was set in `create` function or `set_input_priority`
|
---Reset component input priority to it's default value, that was set in `create` function or `set_input_priority`
|
||||||
---@return druid.base_component self The component itself for chaining
|
---@return druid.component self The component itself for chaining
|
||||||
function M:reset_input_priority()
|
function M:reset_input_priority()
|
||||||
self:set_input_priority(self._component.default_input_priority)
|
self:set_input_priority(self._component.default_input_priority)
|
||||||
return self
|
return self
|
||||||
@ -219,7 +219,7 @@ end
|
|||||||
---If input is disabled, the component will not receive input events.
|
---If input is disabled, the component will not receive input events.
|
||||||
---Recursive for all children components.
|
---Recursive for all children components.
|
||||||
---@param state boolean
|
---@param state boolean
|
||||||
---@return druid.base_component self The component itself for chaining
|
---@return druid.component self The component itself for chaining
|
||||||
function M:set_input_enabled(state)
|
function M:set_input_enabled(state)
|
||||||
self._meta.input_enabled = state
|
self._meta.input_enabled = state
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Get parent component
|
---Get parent component
|
||||||
---@return druid.base_component|nil parent The parent component if exist or nil
|
---@return druid.component|nil parent The parent component if exist or nil
|
||||||
function M:get_parent_component()
|
function M:get_parent_component()
|
||||||
return self._meta.parent
|
return self._meta.parent
|
||||||
end
|
end
|
||||||
@ -243,7 +243,7 @@ end
|
|||||||
---@param context table Druid context. Usually it is self of script
|
---@param context table Druid context. Usually it is self of script
|
||||||
---@param style table Druid style module
|
---@param style table Druid style module
|
||||||
---@param instance_class table The component instance class
|
---@param instance_class table The component instance class
|
||||||
---@return druid.base_component BaseComponent itself
|
---@return druid.component BaseComponent itself
|
||||||
---@private
|
---@private
|
||||||
function M:setup_component(druid_instance, context, style, instance_class)
|
function M:setup_component(druid_instance, context, style, instance_class)
|
||||||
self._meta = {
|
self._meta = {
|
||||||
@ -254,7 +254,7 @@ function M:setup_component(druid_instance, context, style, instance_class)
|
|||||||
druid = druid_instance,
|
druid = druid_instance,
|
||||||
input_enabled = true,
|
input_enabled = true,
|
||||||
children = {},
|
children = {},
|
||||||
parent = type(context) ~= "userdata" and context --[[@as druid.base_component]],
|
parent = type(context) ~= "userdata" and context --[[@as druid.component]],
|
||||||
instance_class = instance_class
|
instance_class = instance_class
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Add child to component children list
|
---Add child to component children list
|
||||||
---@generic T: druid.base_component
|
---@generic T: druid.component
|
||||||
---@param child T The druid component instance
|
---@param child T The druid component instance
|
||||||
---@return T self The component itself for chaining
|
---@return T self The component itself for chaining
|
||||||
---@private
|
---@private
|
||||||
@ -332,7 +332,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Remove child from component children list
|
---Remove child from component children list
|
||||||
---@generic T: druid.base_component
|
---@generic T: druid.component
|
||||||
---@param child T The druid component instance
|
---@param child T The druid component instance
|
||||||
---@return boolean true if child was removed
|
---@return boolean true if child was removed
|
||||||
---@private
|
---@private
|
||||||
@ -367,7 +367,7 @@ end
|
|||||||
---Сreate a new component class, which will inherit from the base Druid component.
|
---Сreate a new component class, which will inherit from the base Druid component.
|
||||||
---@param name string|nil The name of the component
|
---@param name string|nil The name of the component
|
||||||
---@param input_priority number|nil The input priority. The bigger number processed first. Default value: 10
|
---@param input_priority number|nil The input priority. The bigger number processed first. Default value: 10
|
||||||
---@return druid.base_component
|
---@return druid.component
|
||||||
function M.create(name, input_priority)
|
function M.create(name, input_priority)
|
||||||
local new_class = setmetatable({}, {
|
local new_class = setmetatable({}, {
|
||||||
__index = M,
|
__index = M,
|
||||||
|
@ -43,7 +43,7 @@ local const = require("druid.const")
|
|||||||
local utf8_lua = require("druid.system.utf8")
|
local utf8_lua = require("druid.system.utf8")
|
||||||
local utf8 = utf8 or utf8_lua
|
local utf8 = utf8 or utf8_lua
|
||||||
|
|
||||||
---@class druid.rich_input: druid.base_component
|
---@class druid.rich_input: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field input druid.input
|
---@field input druid.input
|
||||||
---@field cursor node
|
---@field cursor node
|
||||||
|
@ -142,7 +142,7 @@ local rich_text = require("druid.custom.rich_text.module.rt")
|
|||||||
---@field offset_y number|nil
|
---@field offset_y number|nil
|
||||||
---@field node_size vector3|nil
|
---@field node_size vector3|nil
|
||||||
|
|
||||||
---@class druid.rich_text: druid.base_component
|
---@class druid.rich_text: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field text_prefab node
|
---@field text_prefab node
|
||||||
---@field private _last_value string
|
---@field private _last_value string
|
||||||
|
@ -15,7 +15,7 @@ local helper = require("druid.helper")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
|
|
||||||
---@class druid.container: druid.base_component
|
---@class druid.container: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field node_offset vector4
|
---@field node_offset vector4
|
||||||
|
@ -40,7 +40,7 @@ local helper = require("druid.helper")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
|
|
||||||
---@class druid.data_list: druid.base_component
|
---@class druid.data_list: druid.component
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
---@field grid druid.grid
|
---@field grid druid.grid
|
||||||
---@field on_scroll_progress_change event
|
---@field on_scroll_progress_change event
|
||||||
@ -187,7 +187,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Return all currenly created components in DataList
|
--- Return all currenly created components in DataList
|
||||||
---@return druid.base_component[] List of created nodes
|
---@return druid.component[] List of created nodes
|
||||||
function M:get_created_components()
|
function M:get_created_components()
|
||||||
local components = {}
|
local components = {}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ local helper = require("druid.helper")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
|
|
||||||
---@class druid.hotkey: druid.base_component
|
---@class druid.hotkey: druid.component
|
||||||
---@field on_hotkey_pressed event
|
---@field on_hotkey_pressed event
|
||||||
---@field on_hotkey_released event
|
---@field on_hotkey_released event
|
||||||
---@field style table
|
---@field style table
|
||||||
|
@ -87,7 +87,7 @@ local component = require("druid.component")
|
|||||||
local utf8_lua = require("druid.system.utf8")
|
local utf8_lua = require("druid.system.utf8")
|
||||||
local utf8 = utf8 or utf8_lua
|
local utf8 = utf8 or utf8_lua
|
||||||
|
|
||||||
---@class druid.input: druid.base_component
|
---@class druid.input: druid.component
|
||||||
---@field on_input_select event
|
---@field on_input_select event
|
||||||
---@field on_input_unselect event
|
---@field on_input_unselect event
|
||||||
---@field on_input_text event
|
---@field on_input_text event
|
||||||
|
@ -32,7 +32,7 @@ local event = require("event.event")
|
|||||||
local settings = require("druid.system.settings")
|
local settings = require("druid.system.settings")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.lang_text: druid.base_component
|
---@class druid.lang_text: druid.component
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_change event
|
---@field on_change event
|
||||||
|
@ -19,7 +19,7 @@ local component = require("druid.component")
|
|||||||
---@field nodes_height table<node, number>
|
---@field nodes_height table<node, number>
|
||||||
---@field rows druid.layout.row_data[]>
|
---@field rows druid.layout.row_data[]>
|
||||||
|
|
||||||
---@class druid.layout: druid.base_component
|
---@class druid.layout: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field rows_data druid.layout.rows_data Last calculated rows data
|
---@field rows_data druid.layout.rows_data Last calculated rows data
|
||||||
---@field is_dirty boolean
|
---@field is_dirty boolean
|
||||||
|
@ -49,7 +49,7 @@ local const = require("druid.const")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.progress: druid.base_component
|
---@class druid.progress: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_change event
|
---@field on_change event
|
||||||
---@field style table
|
---@field style table
|
||||||
|
@ -42,7 +42,7 @@ local helper = require("druid.helper")
|
|||||||
local const = require("druid.const")
|
local const = require("druid.const")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.slider: druid.base_component
|
---@class druid.slider: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_change_value event
|
---@field on_change_value event
|
||||||
---@field style table
|
---@field style table
|
||||||
|
@ -25,7 +25,7 @@ local const = require("druid.const")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.swipe: druid.base_component
|
---@class druid.swipe: druid.component
|
||||||
---@field node node
|
---@field node node
|
||||||
---@field on_swipe event function(side, dist, dt), side - "left", "right", "up", "down"
|
---@field on_swipe event function(side, dist, dt), side - "left", "right", "up", "down"
|
||||||
---@field style table
|
---@field style table
|
||||||
|
@ -2,7 +2,7 @@ local event = require("event.event")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.timer: druid.base_component
|
---@class druid.timer: druid.component
|
||||||
---@field on_tick event
|
---@field on_tick event
|
||||||
---@field on_set_enabled event
|
---@field on_set_enabled event
|
||||||
---@field on_timer_end event
|
---@field on_timer_end event
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---@class druid.widget: druid.base_component
|
---@class druid.widget: druid.component
|
||||||
---@field druid druid.instance Ready to use druid instance
|
---@field druid druid.instance Ready to use druid instance
|
||||||
---@field root node
|
---@field root node Is it really needed?
|
||||||
|
|
||||||
---@class GUITextMetrics
|
---@class GUITextMetrics
|
||||||
---@field width number
|
---@field width number
|
||||||
|
@ -7,19 +7,19 @@ local settings = require("druid.system.settings")
|
|||||||
local base_component = require("druid.component")
|
local base_component = require("druid.component")
|
||||||
|
|
||||||
---@class druid.instance
|
---@class druid.instance
|
||||||
---@field components_all druid.base_component[] All created components
|
---@field components_all druid.component[] All created components
|
||||||
---@field components_interest table<string, druid.base_component[]> All components sorted by interest
|
---@field components_interest table<string, druid.component[]> All components sorted by interest
|
||||||
---@field url url
|
---@field url url
|
||||||
---@field private _context table Druid context
|
---@field private _context table Druid context
|
||||||
---@field private _style table Druid style table
|
---@field private _style table Druid style table
|
||||||
---@field private _deleted boolean
|
---@field private _deleted boolean
|
||||||
---@field private _is_late_remove_enabled boolean
|
---@field private _is_late_remove_enabled boolean
|
||||||
---@field private _late_remove druid.base_component[]
|
---@field private _late_remove druid.component[]
|
||||||
---@field private _input_blacklist druid.base_component[]|nil
|
---@field private _input_blacklist druid.component[]|nil
|
||||||
---@field private _input_whitelist druid.base_component[]|nil
|
---@field private _input_whitelist druid.component[]|nil
|
||||||
---@field private input_inited boolean
|
---@field private input_inited boolean
|
||||||
---@field private _late_init_timer_id number
|
---@field private _late_init_timer_id number
|
||||||
---@field private _input_components druid.base_component[]
|
---@field private _input_components druid.component[]
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local MSG_ADD_FOCUS = hash("acquire_input_focus")
|
local MSG_ADD_FOCUS = hash("acquire_input_focus")
|
||||||
@ -81,7 +81,7 @@ local WIDGET_METATABLE = { __index = base_component }
|
|||||||
|
|
||||||
---Create the Druid component instance
|
---Create the Druid component instance
|
||||||
---@param self druid.instance
|
---@param self druid.instance
|
||||||
---@param widget_class druid.base_component
|
---@param widget_class druid.component
|
||||||
local function create_widget(self, widget_class)
|
local function create_widget(self, widget_class)
|
||||||
local instance = setmetatable({}, {
|
local instance = setmetatable({}, {
|
||||||
__index = setmetatable(widget_class, WIDGET_METATABLE)
|
__index = setmetatable(widget_class, WIDGET_METATABLE)
|
||||||
@ -148,7 +148,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Check whitelists and blacklists for input components
|
---Check whitelists and blacklists for input components
|
||||||
---@param component druid.base_component
|
---@param component druid.component
|
||||||
---@return boolean
|
---@return boolean
|
||||||
function M:_can_use_input_component(component)
|
function M:_can_use_input_component(component)
|
||||||
local can_by_whitelist = true
|
local can_by_whitelist = true
|
||||||
@ -224,7 +224,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Create new Druid component instance
|
---Create new Druid component instance
|
||||||
---@generic T: druid.base_component
|
---@generic T: druid.component
|
||||||
---@param component T
|
---@param component T
|
||||||
---@vararg any
|
---@vararg any
|
||||||
---@return T
|
---@return T
|
||||||
@ -264,7 +264,7 @@ end
|
|||||||
--- Remove created component from Druid instance.
|
--- Remove created component from Druid instance.
|
||||||
--
|
--
|
||||||
-- Component `on_remove` function will be invoked, if exist.
|
-- Component `on_remove` function will be invoked, if exist.
|
||||||
---@generic T: druid.base_component
|
---@generic T: druid.component
|
||||||
---@param component T Component instance
|
---@param component T Component instance
|
||||||
---@return boolean True if component was removed
|
---@return boolean True if component was removed
|
||||||
function M:remove(component)
|
function M:remove(component)
|
||||||
@ -420,7 +420,7 @@ end
|
|||||||
---Set whitelist components for input processing.
|
---Set whitelist components for input processing.
|
||||||
---If whitelist is not empty and component not contains in this list,
|
---If whitelist is not empty and component not contains in this list,
|
||||||
---component will be not processed on input step
|
---component will be not processed on input step
|
||||||
---@param whitelist_components table|druid.base_component[] The array of component to whitelist
|
---@param whitelist_components table|druid.component[] The array of component to whitelist
|
||||||
---@return druid.instance
|
---@return druid.instance
|
||||||
function M:set_whitelist(whitelist_components)
|
function M:set_whitelist(whitelist_components)
|
||||||
if whitelist_components and whitelist_components._component then
|
if whitelist_components and whitelist_components._component then
|
||||||
@ -440,7 +440,7 @@ end
|
|||||||
---Set blacklist components for input processing.
|
---Set blacklist components for input processing.
|
||||||
---If blacklist is not empty and component contains in this list,
|
---If blacklist is not empty and component contains in this list,
|
||||||
---component will be not processed on input step DruidInstance
|
---component will be not processed on input step DruidInstance
|
||||||
---@param blacklist_components table|druid.base_component[] The array of component to blacklist
|
---@param blacklist_components table|druid.component[] The array of component to blacklist
|
||||||
---@return druid.instance
|
---@return druid.instance
|
||||||
function M:set_blacklist(blacklist_components)
|
function M:set_blacklist(blacklist_components)
|
||||||
if blacklist_components and blacklist_components._component then
|
if blacklist_components and blacklist_components._component then
|
||||||
@ -472,7 +472,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Create new Druid widget instance
|
---Create new Druid widget instance
|
||||||
---@generic T: druid.base_component
|
---@generic T: druid.component
|
||||||
---@param widget T
|
---@param widget T
|
||||||
---@param template string|nil The template name used by widget
|
---@param template string|nil The template name used by widget
|
||||||
---@param nodes table<hash, node>|node|nil The nodes table from gui.clone_tree or prefab node to use for clone
|
---@param nodes table<hash, node>|node|nil The nodes table from gui.clone_tree or prefab node to use for clone
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class new_component: druid.base_component
|
---@class new_component: druid.component
|
||||||
local M = component.create("new_component")
|
local M = component.create("new_component")
|
||||||
|
|
||||||
-- Component constructor. Template name and nodes are optional. Pass it if you use it in your component
|
-- Component constructor. Template name and nodes are optional. Pass it if you use it in your component
|
||||||
|
@ -3,7 +3,7 @@ local component = require("druid.component")
|
|||||||
|
|
||||||
local druid_logo_panthera = require("example.components.druid_logo.druid_logo_panthera")
|
local druid_logo_panthera = require("example.components.druid_logo.druid_logo_panthera")
|
||||||
|
|
||||||
---@class druid_logo: druid.base_component
|
---@class druid_logo: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_description druid.text
|
---@field text_description druid.text
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class example_scene: druid.base_component
|
---@class example_scene: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_debug_info druid.text
|
---@field text_debug_info druid.text
|
||||||
---@field text_gui_path druid.text
|
---@field text_gui_path druid.text
|
||||||
|
@ -4,7 +4,7 @@ local storage = require("saver.storage")
|
|||||||
|
|
||||||
local examples_list_view_item = require("example.components.examples_list_view.examples_list_view_item")
|
local examples_list_view_item = require("example.components.examples_list_view.examples_list_view_item")
|
||||||
|
|
||||||
---@class examples_list_view: druid.base_component
|
---@class examples_list_view: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class examples_list_view_item: druid.base_component
|
---@class examples_list_view_item: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text druid.lang_text
|
---@field text druid.lang_text
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class output_list: druid.base_component
|
---@class output_list: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_header druid.text
|
---@field text_header druid.text
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
|
@ -3,7 +3,7 @@ local helper = require("druid.helper")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
|
|
||||||
---@class panel_druid_profiler: druid.base_component
|
---@class panel_druid_profiler: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("panel_druid_profiler")
|
local M = component.create("panel_druid_profiler")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local lang = require("lang.lang")
|
local lang = require("lang.lang")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class panel_information: druid.base_component
|
---@class panel_information: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_header druid.lang_text
|
---@field text_header druid.lang_text
|
||||||
---@field rich_text druid.rich_text
|
---@field rich_text druid.rich_text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class property_button: druid.base_component
|
---@class property_button: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field text_name druid.lang_text
|
---@field text_name druid.lang_text
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class property_checkbox: druid.base_component
|
---@class property_checkbox: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_name druid.lang_text
|
---@field text_name druid.lang_text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class property_slider: druid.base_component
|
---@class property_slider: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_name druid.lang_text
|
---@field text_name druid.lang_text
|
||||||
|
@ -4,7 +4,7 @@ local property_checkbox = require("example.components.properties_panel.propertie
|
|||||||
local property_slider = require("example.components.properties_panel.properties.property_slider")
|
local property_slider = require("example.components.properties_panel.properties.property_slider")
|
||||||
local property_button = require("example.components.properties_panel.properties.property_button")
|
local property_button = require("example.components.properties_panel.properties.property_button")
|
||||||
|
|
||||||
---@class properties_panel: druid.base_component
|
---@class properties_panel: druid.component
|
||||||
---@field root druid.container
|
---@field root druid.container
|
||||||
---@field text_no_properties druid.lang_text
|
---@field text_no_properties druid.lang_text
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_back_handler: druid.base_component
|
---@class basic_back_handler: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("basic_back_handler")
|
local M = component.create("basic_back_handler")
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_blocker: druid.base_component
|
---@class basic_blocker: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field blocker druid.blocker
|
---@field blocker druid.blocker
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_button: druid.base_component
|
---@class basic_button: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
local M = component.create("basic_button")
|
local M = component.create("basic_button")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_button_double_click: druid.base_component
|
---@class basic_button_double_click: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
local M = component.create("basic_button_double_click")
|
local M = component.create("basic_button_double_click")
|
||||||
|
@ -3,7 +3,7 @@ local panthera = require("panthera.panthera")
|
|||||||
|
|
||||||
local animation = require("example.examples.basic.button.basic_button_hold_panthera")
|
local animation = require("example.examples.basic.button.basic_button_hold_panthera")
|
||||||
|
|
||||||
---@class basic_button_hold: druid.base_component
|
---@class basic_button_hold: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
local M = component.create("basic_button_hold")
|
local M = component.create("basic_button_hold")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
|
|
||||||
---@class checkbox: druid.base_component
|
---@class checkbox: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
local M = component.create("checkbox")
|
local M = component.create("checkbox")
|
||||||
|
@ -4,7 +4,7 @@ local component = require("druid.component")
|
|||||||
-- Require checkbox component from checkbox example
|
-- Require checkbox component from checkbox example
|
||||||
local checkbox = require("example.examples.basic.checkbox.checkbox")
|
local checkbox = require("example.examples.basic.checkbox.checkbox")
|
||||||
|
|
||||||
---@class checkbox_group: druid.base_component
|
---@class checkbox_group: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
local M = component.create("checkbox_group")
|
local M = component.create("checkbox_group")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class drag: druid.base_component
|
---@class drag: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("drag")
|
local M = component.create("drag")
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class drag_to_node: druid.base_component
|
---@class drag_to_node: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("drag_to_node")
|
local M = component.create("drag_to_node")
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class grid: druid.base_component
|
---@class grid: druid.component
|
||||||
---@field grid druid.grid
|
---@field grid druid.grid
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_hotkey: druid.base_component
|
---@class basic_hotkey: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class hover: druid.base_component
|
---@class hover: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field hover druid.hover
|
---@field hover druid.hover
|
||||||
---@field hover_pressed druid.hover
|
---@field hover_pressed druid.hover
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_input: druid.base_component
|
---@class basic_input: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field input druid.input
|
---@field input druid.input
|
||||||
local M = component.create("basic_input")
|
local M = component.create("basic_input")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class input_password: druid.base_component
|
---@class input_password: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
local M = component.create("input_password")
|
local M = component.create("input_password")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class rich_input: druid.base_component
|
---@class rich_input: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field rich_input druid.rich_input
|
---@field rich_input druid.rich_input
|
||||||
local M = component.create("rich_input")
|
local M = component.create("rich_input")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_progress_bar: druid.base_component
|
---@class basic_progress_bar: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field progress druid.progress
|
---@field progress druid.progress
|
||||||
local M = component.create("basic_progress_bar")
|
local M = component.create("basic_progress_bar")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_progress_bar_slice9: druid.base_component
|
---@class basic_progress_bar_slice9: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field progress druid.progress
|
---@field progress druid.progress
|
||||||
local M = component.create("basic_progress_bar_slice9")
|
local M = component.create("basic_progress_bar_slice9")
|
||||||
|
@ -4,7 +4,7 @@ local event = require("event.event")
|
|||||||
-- Require checkbox component from checkbox example
|
-- Require checkbox component from checkbox example
|
||||||
local checkbox = require("example.examples.basic.checkbox.checkbox")
|
local checkbox = require("example.examples.basic.checkbox.checkbox")
|
||||||
|
|
||||||
---@class radio_group: druid.base_component
|
---@class radio_group: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field button druid.button
|
---@field button druid.button
|
||||||
local M = component.create("radio_group")
|
local M = component.create("radio_group")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_rich_text: druid.base_component
|
---@class basic_rich_text: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field rich_text druid.rich_text
|
---@field rich_text druid.rich_text
|
||||||
local M = component.create("basic_rich_text")
|
local M = component.create("basic_rich_text")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
|
|
||||||
---@class rich_text_tags: druid.base_component
|
---@class rich_text_tags: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field rich_text druid.rich_text
|
---@field rich_text druid.rich_text
|
||||||
local M = component.create("rich_text_tags")
|
local M = component.create("rich_text_tags")
|
||||||
|
@ -2,7 +2,7 @@ local component = require("druid.component")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
|
|
||||||
---@class rich_text_tags_custom: druid.base_component
|
---@class rich_text_tags_custom: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field rich_text druid.rich_text
|
---@field rich_text druid.rich_text
|
||||||
local M = component.create("rich_text_tags_custom")
|
local M = component.create("rich_text_tags_custom")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class scroll: druid.base_component
|
---@class scroll: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class scroll_bind_grid: druid.base_component
|
---@class scroll_bind_grid: druid.component
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
---@field grid druid.grid
|
---@field grid druid.grid
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class scroll_bind_grid_horizontal: druid.base_component
|
---@class scroll_bind_grid_horizontal: druid.component
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
---@field grid druid.grid
|
---@field grid druid.grid
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class scroll_bind_grid_points: druid.base_component
|
---@class scroll_bind_grid_points: druid.component
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
---@field grid druid.grid
|
---@field grid druid.grid
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class scroll_slider: druid.base_component
|
---@class scroll_slider: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field scroll druid.scroll
|
---@field scroll druid.scroll
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_slider: druid.base_component
|
---@class basic_slider: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_slider_stepped: druid.base_component
|
---@class basic_slider_stepped: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_slider_vertical: druid.base_component
|
---@class basic_slider_vertical: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_swipe: druid.base_component
|
---@class basic_swipe: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("basic_swipe")
|
local M = component.create("basic_swipe")
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_text: druid.base_component
|
---@class basic_text: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
local M = component.create("basic_text")
|
local M = component.create("basic_text")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class multiline_text: druid.base_component
|
---@class multiline_text: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("multiline_text")
|
local M = component.create("multiline_text")
|
||||||
|
@ -2,7 +2,7 @@ local event = require("event.event")
|
|||||||
|
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class basic_timer: druid.base_component
|
---@class basic_timer: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class data_list_add_remove_clear: druid.base_component
|
---@class data_list_add_remove_clear: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field data_list druid.data_list
|
---@field data_list druid.data_list
|
||||||
local M = component.create("data_list_add_remove_clear")
|
local M = component.create("data_list_add_remove_clear")
|
||||||
@ -31,7 +31,7 @@ end
|
|||||||
|
|
||||||
---@param item_data table
|
---@param item_data table
|
||||||
---@param index number
|
---@param index number
|
||||||
---@return node, druid.base_component
|
---@return node, druid.component
|
||||||
function M:create_item_callback(item_data, index)
|
function M:create_item_callback(item_data, index)
|
||||||
local nodes = gui.clone_tree(self.prefab)
|
local nodes = gui.clone_tree(self.prefab)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local event = require("event.event")
|
local event = require("event.event")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class data_list_basic: druid.base_component
|
---@class data_list_basic: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("data_list_basic")
|
local M = component.create("data_list_basic")
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ end
|
|||||||
|
|
||||||
---@param item_data table
|
---@param item_data table
|
||||||
---@param index number
|
---@param index number
|
||||||
---@return node, druid.base_component
|
---@return node, druid.component
|
||||||
function M:create_item_callback(item_data, index)
|
function M:create_item_callback(item_data, index)
|
||||||
local nodes = gui.clone_tree(self.prefab)
|
local nodes = gui.clone_tree(self.prefab)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class data_list_horizontal_basic: druid.base_component
|
---@class data_list_horizontal_basic: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("data_list_horizontal_basic")
|
local M = component.create("data_list_horizontal_basic")
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class button_component: druid.base_component
|
---@class button_component: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field text druid.text
|
---@field text druid.text
|
||||||
|
@ -3,7 +3,7 @@ local component = require("druid.component")
|
|||||||
|
|
||||||
local button_component = require("example.examples.data_list.cache_with_component.button_component")
|
local button_component = require("example.examples.data_list.cache_with_component.button_component")
|
||||||
|
|
||||||
---@class data_list_cache_with_component: druid.base_component
|
---@class data_list_cache_with_component: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("data_list_cache_with_component")
|
local M = component.create("data_list_cache_with_component")
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ end
|
|||||||
|
|
||||||
---@param item_data table
|
---@param item_data table
|
||||||
---@param index number
|
---@param index number
|
||||||
---@return node, druid.base_component
|
---@return node, druid.component
|
||||||
function M:create_item_callback(item_data, index)
|
function M:create_item_callback(item_data, index)
|
||||||
local nodes = gui.clone_tree(self.prefab)
|
local nodes = gui.clone_tree(self.prefab)
|
||||||
|
|
||||||
|
@ -18,11 +18,11 @@ local M = {}
|
|||||||
---@field root string
|
---@field root string
|
||||||
---@field template string|nil
|
---@field template string|nil
|
||||||
---@field code_url string|nil @URL to the source code
|
---@field code_url string|nil @URL to the source code
|
||||||
---@field component_class druid.base_component|nil
|
---@field component_class druid.component|nil
|
||||||
---@field widget_class druid.widget|nil New way to create components
|
---@field widget_class druid.widget|nil New way to create components
|
||||||
---@field on_create fun(instance: druid.base_component|druid.widget, output_list: output_list)|nil
|
---@field on_create fun(instance: druid.component|druid.widget, output_list: output_list)|nil
|
||||||
---@field get_debug_info (fun(instance: druid.base_component):string)|nil
|
---@field get_debug_info (fun(instance: druid.component):string)|nil
|
||||||
---@field properties_control (fun(instance: druid.base_component, properties_panel: properties_panel))|nil
|
---@field properties_control (fun(instance: druid.component, properties_panel: properties_panel))|nil
|
||||||
---@field information_text_id string|nil
|
---@field information_text_id string|nil
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class gamepad_tester: druid.base_component
|
---@class gamepad_tester: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field buttons druid.button
|
---@field buttons druid.button
|
||||||
---@field buttons_system druid.button
|
---@field buttons_system druid.button
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local on_screen_input = require("example.examples.gamepad.on_screen_control.on_screen_input")
|
local on_screen_input = require("example.examples.gamepad.on_screen_control.on_screen_input")
|
||||||
|
|
||||||
---@class on_screen_control: druid.base_component
|
---@class on_screen_control: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field on_screen_input on_screen_input
|
---@field on_screen_input on_screen_input
|
||||||
local M = component.create("on_screen_control")
|
local M = component.create("on_screen_control")
|
||||||
|
@ -3,7 +3,7 @@ local event = require("event.event")
|
|||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class on_screen_input: druid.base_component
|
---@class on_screen_input: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field on_action event @()
|
---@field on_action event @()
|
||||||
---@field on_movement event @(x: number, y: number, dt: number) X/Y values are in range -1..1
|
---@field on_movement event @(x: number, y: number, dt: number) X/Y values are in range -1..1
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local panthera = require("panthera.panthera")
|
local panthera = require("panthera.panthera")
|
||||||
|
|
||||||
---@class how_to_use_example: druid.base_component
|
---@class how_to_use_example: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
local M = component.create("how_to_use_example")
|
local M = component.create("how_to_use_example")
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ local component = require("druid.component")
|
|||||||
local panthera = require("panthera.panthera")
|
local panthera = require("panthera.panthera")
|
||||||
local intro_panthera = require("example.examples.intro.intro.intro_panthera")
|
local intro_panthera = require("example.examples.intro.intro.intro_panthera")
|
||||||
|
|
||||||
---@class intro: druid.base_component
|
---@class intro: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
local M = component.create("intro")
|
local M = component.create("intro")
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ local helper = require("druid.helper")
|
|||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
local layout = require("druid.extended.layout")
|
local layout = require("druid.extended.layout")
|
||||||
|
|
||||||
---@class basic_layout: druid.base_component
|
---@class basic_layout: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
local M = component.create("basic_layout")
|
local M = component.create("basic_layout")
|
||||||
|
@ -5,7 +5,7 @@ local event = require("event.event")
|
|||||||
|
|
||||||
local character_animation_blend = require("example.examples.panthera.animation_blend.character_animation_blend")
|
local character_animation_blend = require("example.examples.panthera.animation_blend.character_animation_blend")
|
||||||
|
|
||||||
---@class animation_blend: druid.base_component
|
---@class animation_blend: druid.component
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("animation_blend")
|
local M = component.create("animation_blend")
|
||||||
|
@ -3,7 +3,7 @@ local component = require("druid.component")
|
|||||||
|
|
||||||
local basic_animation_panthera = require("example.examples.panthera.basic_animation.basic_animation_panthera")
|
local basic_animation_panthera = require("example.examples.panthera.basic_animation.basic_animation_panthera")
|
||||||
|
|
||||||
---@class basic_animation: druid.base_component
|
---@class basic_animation: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("basic_animation")
|
local M = component.create("basic_animation")
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ local helper = require("druid.helper")
|
|||||||
local druid_const = require("druid.const")
|
local druid_const = require("druid.const")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class hover_hint: druid.base_component
|
---@class hover_hint: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field panel_hint node
|
---@field panel_hint node
|
||||||
|
@ -2,7 +2,7 @@ local hover_hint = require("example.examples.widgets.hover_hint.hover_hint")
|
|||||||
|
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
---@class hover_hint_example: druid.base_component
|
---@class hover_hint_example: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
local M = component.create("hover_hint_example")
|
local M = component.create("hover_hint_example")
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ local panthera = require("panthera.panthera")
|
|||||||
|
|
||||||
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
||||||
|
|
||||||
---@class window_confirmation: druid.base_component
|
---@class window_confirmation: druid.component
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
---@field text_header druid.lang_text
|
---@field text_header druid.lang_text
|
||||||
---@field text_button_accept druid.lang_text
|
---@field text_button_accept druid.lang_text
|
||||||
|
@ -3,7 +3,7 @@ local panthera = require("panthera.panthera")
|
|||||||
|
|
||||||
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
||||||
|
|
||||||
---@class window_info: druid.base_component
|
---@class window_info: druid.component
|
||||||
---@field text_header druid.lang_text
|
---@field text_header druid.lang_text
|
||||||
---@field text_button_accept druid.lang_text
|
---@field text_button_accept druid.lang_text
|
||||||
---@field text_description druid.lang_text
|
---@field text_description druid.lang_text
|
||||||
|
@ -6,7 +6,7 @@ local panthera = require("panthera.panthera")
|
|||||||
|
|
||||||
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
||||||
|
|
||||||
---@class window_language: druid.base_component
|
---@class window_language: druid.component
|
||||||
---@field text_header druid.text
|
---@field text_header druid.text
|
||||||
---@field button_close druid.button
|
---@field button_close druid.button
|
||||||
---@field druid druid.instance
|
---@field druid druid.instance
|
||||||
|
Loading…
x
Reference in New Issue
Block a user