View Single Post
01-31-12, 04:06 PM   #20
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by SDPhantom View Post
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.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote