smartfs update: remove obsolete loadTemplate

This commit is contained in:
Alexander Weber 2017-02-13 11:03:07 +01:00
parent f06d1e5b4c
commit f837a4684a
2 changed files with 1 additions and 14 deletions

View File

@ -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

View File

@ -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)