Originally Posted by p3lim
The following worked perfectly for me
Code:
function pMinimap:ADDON_LOADED(event)
pMinimapDB = pMinimapDB or {}
for k,v in pairs(defaults) do
if(type(pMinimapDB[k]) == 'nil') then
pMinimapDB[k] = v
end
end
self:UnregisterEvent(event)
-- rest of the addon here
end
|
yup that would work.
Just a quick note though pMinimap:ADDON_LOADED will be called multiple times even though you've unregistered the event, check the addonarg matches your own addonname before doing anything.