diff --git a/init.lua b/init.lua index ca58b06..ad34ab3 100644 --- a/init.lua +++ b/init.lua @@ -76,7 +76,7 @@ local inventory_form = smartfs.create("smart_inventory:main", function(state) end) tabdef.view = state:container(0,1,def.name.."_container") tabdef.viewstate = tabdef.view:getContainerState() - tabdef.viewstate:loadTemplate(def.smartfs_callback) + def.smartfs_callback(tabdef.viewstate) tab_controller:tab_add(def.name, tabdef) button_x = button_x + 1 end diff --git a/smartfs.lua b/smartfs.lua index 401fed4..4a51fd7 100644 --- a/smartfs.lua +++ b/smartfs.lua @@ -641,18 +641,6 @@ function smartfs._makeState_(form, params, location, newplayer) return self._ele[data.name] end, - loadTemplate = function(self, template) - -- template can be a function (usable in smartfs.create()), a form name or object ( a smartfs.create() result) - if type(template) == "function" then -- asume it is a smartfs.create() usable function - return template(self) - elseif type(template) == "string" then -- asume it is a form name - return smartfs.__call(self, template)._reg(self) - elseif type(template) == "table" then --asume it is an other state - if template._reg then - template._reg(self) - end - end - end, ------------------------------------------------------ -- State - Element Constructors @@ -848,7 +836,6 @@ smartfs.element("button", { self:getBackgroundString() return specstring end, - submit = function(self, field, player) if self._click then self:_click(self.root, player)