As an example:
Top of first .Lua file
Lua Code:
local addon, ns = ...
local Funs, Settings = unpack(select(2, ...))
Settings.defaults = {
x = 0,
y = 0,
}
Funs.updateSettings = function()
-- do stuff
end
Second file
Lua Code:
local Funs, Settings = unpack(select(2, ...))
local Init = function()
Funs.updateSettings()
print(Settings.x, Settings.y)
end
You can now access thingies from any file within your addon, as each file in your addon shares a hidden passed argument.