mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Revert "Move editor scripts to druid folder"
This reverts commit 007e715009
.
This commit is contained in:
32
druid/editor_scripts/component.lua_template
Normal file
32
druid/editor_scripts/component.lua_template
Normal file
@@ -0,0 +1,32 @@
|
||||
--- For component interest functions
|
||||
--- see https://github.com/Insality/druid/blob/develop/docs_md/02-creating_custom_components.md
|
||||
--- Require this component in you gui file:
|
||||
--- local {COMPONENT_NAME} = require("{COMPONENT_PATH}")
|
||||
--- And create this component via:
|
||||
--- self.{COMPONENT_TYPE} = self.druid:new({COMPONENT_NAME}, template, nodes)
|
||||
|
||||
local component = require("druid.component")
|
||||
|
||||
---@class {COMPONENT_TYPE}: druid.base_component{COMPONENT_ANNOTATIONS}
|
||||
---@field druid druid_instance
|
||||
local {COMPONENT_NAME} = component.create("{COMPONENT_TYPE}")
|
||||
|
||||
local SCHEME = {
|
||||
{SCHEME_LIST}
|
||||
}
|
||||
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function {COMPONENT_NAME}:init(template, nodes)
|
||||
self:set_template(template)
|
||||
self:set_nodes(nodes)
|
||||
self.druid = self:get_druid(){COMPONENT_DEFINE}
|
||||
end
|
||||
|
||||
|
||||
function {COMPONENT_NAME}:on_remove()
|
||||
end
|
||||
|
||||
{COMPONENT_FUNCTIONS}
|
||||
return {COMPONENT_NAME}
|
Reference in New Issue
Block a user