mirror of
https://github.com/Insality/druid
synced 2025-09-27 10:02:19 +02:00
Update docs, config generations, fix linter
This commit is contained in:
@@ -3,18 +3,13 @@ local component = require("druid.component")
|
||||
---@class component_name : druid.base_component
|
||||
local Component = component.create("component_name")
|
||||
|
||||
local SCHEME = {
|
||||
ROOT = "root",
|
||||
BUTTON = "button",
|
||||
}
|
||||
|
||||
|
||||
-- Component constructor. Template name and nodes are optional. Pass it if you use it in your component
|
||||
function Component:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
self.root = self:get_node(SCHEME.ROOT)
|
||||
self.root = self:get_node("root")
|
||||
|
||||
self.button = self.druid:new_button(SCHEME.BUTTON, function() end)
|
||||
self.button = self.druid:new_button("button", function() end)
|
||||
end
|
||||
|
||||
|
||||
|
@@ -3,13 +3,6 @@ local component = require("druid.component")
|
||||
---@class component_name : druid.base_component
|
||||
local Component = component.create("component_name")
|
||||
|
||||
-- Scheme of component gui nodes
|
||||
local SCHEME = {
|
||||
ROOT = "root",
|
||||
BUTTON = "button",
|
||||
}
|
||||
|
||||
|
||||
-- Component constructor. Template name and nodes are optional. Pass it if you use it in your component
|
||||
function Component:init(template, nodes)
|
||||
-- If your component is gui template, pass the template name and set it
|
||||
@@ -18,7 +11,7 @@ function Component:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
-- self:get_node will auto process component template and nodes
|
||||
self.root = self:get_node(SCHEME.ROOT)
|
||||
self.root = self:get_node("root")
|
||||
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user