Yep, looks like it.
I use
Lua Code:
local addonName, addonTable = ...
at the top of each of my lua files and give them their own sub table for their functionality and data.
For example - if I were to have my own ButtonManager for some reason I could have something like this
Lua Code:
addonTable.ButtonManager = {}
And then I could create addon wide functions like this
Lua Code:
addonTable.ButtonManager.Create = function(...)
end
I still use the regular local variables and functions if no other file needs to access it.
Or global functions if I want external addons access to certain variables or functions - uniquely named of course and validated
You could simplify the addonTables accessors as follows ( using the previous example )
Lua Code:
-- Create the files data table
addonTable.ButtonManager = {}
-- Simplify it
local bm = addonTable.ButtonManager
-- Use it
bm.Create = function(...)
end
But I only do that if it's more than 5/10 lines worth of copying and pasting of the table.