Template files are now expected to return a template table instead of calling loveframes.templates.Register

This commit is contained in:
Kenny Shields 2014-10-23 18:52:55 -04:00
parent 4692f1e6d8
commit 9977d8e106
2 changed files with 3 additions and 2 deletions

View File

@ -433,7 +433,8 @@ end
-- loop through a list of all gui templates and require them
for k, v in ipairs(templates) do
if v.extension == "lua" then
require(v.requirepath)
local template = require(v.requirepath)
loveframes.templates.Register(template)
end
end

View File

@ -1 +1 @@
--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ --[[------------------------------------------------ -- note: This is the base template for all Love Frames objects. You should not edit or delete this template unless you know what you are doing. --]]------------------------------------------------ -- get the current require path local path = string.sub(..., 1, string.len(...) - string.len(".templates.base")) local loveframes = require(path .. ".libraries.common") -- template table local template = {} -- template name template.name = "Base" -- template properties template.properties = {} template.properties["*"] = { state = "none", x = 0, y = 0, width = 5, height = 5, staticx = 0, staticy = 0, draworder = 0, collide = true, internal = false, visible = true, hover = false, alwaysupdate = false, retainsize = false, calledmousefunc = false, skin = nil, clickbounds = nil, Draw = nil, Update = nil, OnMouseEnter = nil, OnMouseExit = nil } -- register the template loveframes.templates.Register(template)
--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ --[[------------------------------------------------ -- note: This is the base template for all Love Frames objects. You should not edit or delete this template unless you know what you are doing. --]]------------------------------------------------ -- template table local template = {} -- template name template.name = "Base" -- template properties template.properties = {} template.properties["*"] = { state = "none", x = 0, y = 0, width = 5, height = 5, staticx = 0, staticy = 0, draworder = 0, collide = true, internal = false, visible = true, hover = false, alwaysupdate = false, retainsize = false, calledmousefunc = false, skin = nil, clickbounds = nil, Draw = nil, Update = nil, OnMouseEnter = nil, OnMouseExit = nil } return template