changed the projects filesystem to use require() instead of loadfile()

currently preparing for a better package manager/installer
This commit is contained in:
Robert Jelic
2022-07-03 21:19:01 +02:00
parent 1f18db9965
commit c00d466b10
73 changed files with 5658 additions and 0 deletions

14
Basalt/loadObjects.lua Normal file
View File

@@ -0,0 +1,14 @@
local _OBJECTS = {}
if(packaged)then
for k,v in pairs(getProject("objects"))do
_OBJECTS[k] = v()
end
return _OBJECTS
end
for _,v in pairs(fs.list(fs.combine("Basalt", "objects")))do
if(v~="example.lua")then
local name = v:gsub(".lua", "")
_OBJECTS[name] = require(name)
end
end
return _OBJECTS