From 87e6f6ef1fa8754a3764ca5a85dd9c6ce0a7f608 Mon Sep 17 00:00:00 2001 From: Alexey Gulev Date: Wed, 27 Mar 2019 22:13:45 +0100 Subject: [PATCH] rename create() to new() --- druid/druid.lua | 4 ++-- example/example.gui.gui_script | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/druid/druid.lua b/druid/druid.lua index d91f781..78ce5ae 100644 --- a/druid/druid.lua +++ b/druid/druid.lua @@ -29,7 +29,7 @@ end function M.register(name, module) -- TODO: Find better solution to creating elements? _factory["new_" .. name] = function(factory, node_or_name, ...) - _factory.create(factory, module, node_or_name, ...) + _factory.new(factory, module, node_or_name, ...) end log("Register component", name) end @@ -86,7 +86,7 @@ local function create(module, factory, name, ...) end -function _factory.create(factory, module, node_or_name, ...) +function _factory.new(factory, module, node_or_name, ...) local instance = create(module, factory, node_or_name) if instance.init then diff --git a/example/example.gui.gui_script b/example/example.gui.gui_script index dc5bd03..84ba19e 100644 --- a/example/example.gui.gui_script +++ b/example/example.gui.gui_script @@ -30,8 +30,8 @@ function init(self) print("On button 1") end) - --alternative way of component registration - self.druid:create(druid.comps.button, "button_2", function() + --alternative way of component creation + self.druid:new(druid.comps.button, "button_2", function() print("On button 2") end)