View Single Post
05-10-14, 09:52 AM   #14
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
so somewhere in your addon's lua file, like the first line you should have something like the following (outside of all functions)

lua Code:
  1. local AddonName, AddonTable = ...

this will give you the name that your addon is going to load as and a table that is global to all files loaded in your addon


then you just do something like the following.

lua Code:
  1. Frame:RegisterEvent("ADDON_LOADED")
  2. Frame:SetScript("OnEvent",function(self, event, ...)     local arg = ... -- used since arg will be indexable if a table and for more events
  3.      if event == "ADDON_LOADED" and arg  == AddonName then
  4.           --loading code here
  5.      end
  6.      -- other event code goes here
  7. end)

Last edited by Billtopia : 05-10-14 at 10:00 AM.
  Reply With Quote