mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Rename type druid_instance to druid.instance
This commit is contained in:
@@ -6,7 +6,7 @@ local helper = require("druid.helper")
|
||||
---@field context table
|
||||
---@field nodes table<hash, node>|nil
|
||||
---@field style table|nil
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
---@field input_enabled boolean
|
||||
---@field children table
|
||||
---@field parent druid.base_component|nil
|
||||
@@ -20,7 +20,7 @@ local helper = require("druid.helper")
|
||||
---@field _uid number
|
||||
|
||||
---@class druid.base_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 update fun(self:druid.base_component, dt:number)|nil
|
||||
---@field on_remove fun(self:druid.base_component)|nil
|
||||
@@ -134,7 +134,7 @@ end
|
||||
---Get Druid instance for inner component creation.
|
||||
---@param template string|nil
|
||||
---@param nodes table<hash, node>|nil
|
||||
---@return druid_instance
|
||||
---@return druid.instance
|
||||
function M:get_druid(template, nodes)
|
||||
local context = { _context = self }
|
||||
local druid_instance = setmetatable(context, { __index = self._meta.druid })
|
||||
@@ -239,7 +239,7 @@ end
|
||||
|
||||
|
||||
--- Setup component context and his style table
|
||||
---@param druid_instance table The parent druid instance
|
||||
---@param druid_instance druid.instance The parent druid instance
|
||||
---@param context table Druid context. Usually it is self of script
|
||||
---@param style table Druid style module
|
||||
---@param instance_class table The component instance class
|
||||
|
@@ -12,7 +12,7 @@ local M = {}
|
||||
---Create a new Druid instance for creating GUI components.
|
||||
---@param context table The Druid context. Usually, this is the self of the gui_script. It is passed into all Druid callbacks.
|
||||
---@param style table|nil The Druid style table to override style parameters for this Druid instance.
|
||||
---@return druid_instance druid_instance The new Druid instance
|
||||
---@return druid.instance druid_instance The new Druid instance
|
||||
function M.new(context, style)
|
||||
if settings.default_style == nil then
|
||||
M.set_default_style(default_style)
|
||||
|
@@ -17,7 +17,7 @@ local event = require("event.event")
|
||||
|
||||
---@class druid.container: druid.base_component
|
||||
---@field node node
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
---@field node_offset vector4
|
||||
---@field origin_size vector3
|
||||
---@field size vector3
|
||||
|
@@ -1,5 +1,5 @@
|
||||
---@class druid.widget: druid.base_component
|
||||
---@field druid druid_instance Ready to use druid instance
|
||||
---@field druid druid.instance Ready to use druid instance
|
||||
---@field root node
|
||||
|
||||
---@class GUITextMetrics
|
||||
|
@@ -6,7 +6,7 @@ local helper = require("druid.helper")
|
||||
local settings = require("druid.system.settings")
|
||||
local base_component = require("druid.component")
|
||||
|
||||
---@class druid_instance
|
||||
---@class druid.instance
|
||||
---@field components_all druid.base_component[] All created components
|
||||
---@field components_interest table<string, druid.base_component[]> All components sorted by interest
|
||||
---@field url url
|
||||
@@ -80,7 +80,7 @@ end
|
||||
local WIDGET_METATABLE = { __index = base_component }
|
||||
|
||||
---Create the Druid component instance
|
||||
---@param self druid_instance
|
||||
---@param self druid.instance
|
||||
---@param widget_class druid.base_component
|
||||
local function create_widget(self, widget_class)
|
||||
local instance = setmetatable({}, {
|
||||
@@ -124,7 +124,7 @@ end
|
||||
|
||||
|
||||
---Before processing any input check if we need to update input stack
|
||||
---@param self druid_instance
|
||||
---@param self druid.instance
|
||||
---@param components table[]
|
||||
local function check_sort_input_stack(self, components)
|
||||
if not components or #components == 0 then
|
||||
@@ -421,7 +421,7 @@ end
|
||||
---If whitelist is not empty and component not contains in this list,
|
||||
---component will be not processed on input step
|
||||
---@param whitelist_components table|druid.base_component[] The array of component to whitelist
|
||||
---@return druid_instance
|
||||
---@return druid.instance
|
||||
function M:set_whitelist(whitelist_components)
|
||||
if whitelist_components and whitelist_components._component then
|
||||
whitelist_components = { whitelist_components }
|
||||
@@ -441,7 +441,7 @@ end
|
||||
---If blacklist is not empty and component contains in this list,
|
||||
---component will be not processed on input step DruidInstance
|
||||
---@param blacklist_components table|druid.base_component[] The array of component to blacklist
|
||||
---@return druid_instance
|
||||
---@return druid.instance
|
||||
function M:set_blacklist(blacklist_components)
|
||||
if blacklist_components and blacklist_components._component then
|
||||
blacklist_components = { blacklist_components }
|
||||
|
@@ -6,7 +6,7 @@ local color = require("druid.color")
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field text_button druid.text
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
local M = {}
|
||||
|
||||
function M:init()
|
||||
|
@@ -2,7 +2,7 @@ local event = require("event.event")
|
||||
|
||||
---@class widget.property_checkbox: druid.widget
|
||||
---@field root node
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field selected node
|
||||
|
@@ -3,7 +3,7 @@
|
||||
---@field container druid.container
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
local M = {}
|
||||
|
||||
function M:init()
|
||||
|
@@ -2,7 +2,7 @@ local event = require("event.event")
|
||||
|
||||
---@class widget.property_left_right_selector: druid.widget
|
||||
---@field root node
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field selected node
|
||||
|
@@ -4,7 +4,7 @@ local helper = require("druid.helper")
|
||||
---@class widget.property_slider: druid.widget
|
||||
---@field root node
|
||||
---@field container druid.container
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
---@field text_name druid.text
|
||||
---@field text_value druid.text
|
||||
---@field slider druid.slider
|
||||
|
@@ -6,7 +6,7 @@ local event = require("event.event")
|
||||
---@field container druid.container
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field druid druid_instance
|
||||
---@field druid druid.instance
|
||||
local M = {}
|
||||
|
||||
function M:init()
|
||||
|
Reference in New Issue
Block a user