mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Add component instance with general methods. New component constructor
This commit is contained in:
@@ -96,10 +96,10 @@ end
|
||||
-- node - может брать ноду у компонента по схеме (если есть
|
||||
-- template или таблица нод после gui.clone_tree)
|
||||
function M.node(component, name)
|
||||
local template_name = component.template or const.EMPTY_STRING
|
||||
local template_name = component._meta.template or const.EMPTY_STRING
|
||||
|
||||
if component.nodes then
|
||||
return component.nodes[template_name .. name]
|
||||
if component._meta.nodes then
|
||||
return component._meta.nodes[template_name .. name]
|
||||
else
|
||||
return gui.get_node(template_name .. name)
|
||||
end
|
||||
@@ -165,19 +165,4 @@ function M.get_pivot_offset(pivot)
|
||||
end
|
||||
|
||||
|
||||
function M.get_druid(self)
|
||||
local context = { _context = self }
|
||||
return setmetatable(context, { __index = self.context.druid })
|
||||
end
|
||||
|
||||
|
||||
function M.get_style(self, section)
|
||||
if not self.druid_style then
|
||||
return {}
|
||||
end
|
||||
|
||||
return self.druid_style[section] or {}
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user