Originally Posted by SDPhantom
I usually have a core file in a UI addon that is loaded first out of all the others that handles all the basic needs, typicly global registration of the addon table, API for registering modules, event callback system, and/or any functions/structures I want globally available to the entire addon.
It doesn't hurt to put that line in all of your files, but it's completely redundant.
|
Including this line, however, is not redundant:
Code:
local addonName, addon = ...
That ensures the file it's included in has an upvalued version of the name and the shared table. Personally, I prefer NOT putting that table in the global space and instead using it as a shared private namespace.