View Single Post
02-01-18, 02:28 AM   #19
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Do you really need Ace-Addon? If you dont use any other function from this lib you can just leave it alone and directly register ADDON_LOADED like you do in OnInitialize. Every ACE-Lib is standalone. e.g. I use, Ace-Db, Ace-Config but never Ace-Addon.


For my addons I do it this way ... where childName is the addon name and addon is the namespace-table, defaults is the table where defaults are defined.
Lua Code:
  1. if(event=='ADDON_LOADED') then
  2.     if(arg1 ~= childName) then return end
  3.     addon['db'] = addon['db'] or LibStub("AceDB-3.0"):New(childName.."DB", nil, default)
  4.     if(type(defaults) == 'table') then
  5.         addon['db']['profile'][childName] = addon['db']['profile'][childName] or CopyTable(defaults)
  6.     else
  7.         addon['db']['profile'][childName] = addon['db']['profile'][childName] or {}
  8.     end
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote