AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
-- Setup table to load modules on demand:
function LazyLoadSetup(tbl, folder)
--Simplify hierarchy of modules
local modules = {}
for _, object in ipairs(folder:GetDescendants())do
if object:IsA("ModuleScript")then
modules[object.Name] = object
end
end
setmetatable(tbl, {
__index = function(t, i)
local obj = require(modules[i])
if (type(obj) == "table") then
Aero:WrapModule(obj)
end
rawset(t, i, obj)
return obj
end;
})
end
This allows me to better organize the hierarchy and still use the modules like before.
function UI:Init()
TimerModule = self.Modules.Timer
TweenModule = self.Modules.Tween
end
I actually have plans for a similar feature. It is designed to be somewhat similar, but preserve the dot-notation of the folder. I'm going to close this issue, but your idea is not lost!
Here is a small edit that I use.
This allows me to better organize the hierarchy and still use the modules like before.