Thread Tools Display Modes
08-09-09, 06:08 PM   #1
geniworm
A Defias Bandit
Join Date: Jan 2006
Posts: 3
Problems with a LoD library

Hi, I have made a little addon and a part of it ceased working with patch 3.2. This addon of mine uses a library called CandyBar for various functions and it seems that, being load on demand, CandyBar doesn't initially get loaded when it's supposed to be. My addon uses Ace3 and I attempt to load the library like this:
Code:
function Addon:InitCandy()
   if LoadAddOn("CandyBar") then
      self.candy = LibStub:GetLibrary("CandyBar-2.0")
      -- and here I would setup the bars
   end
end

local db
function Addon:OnInitialize()
   self:InitConfig()   
   db = self.db.profile
   self:CreateFrames()
   self:InitCandy()
end
But apparently the LoadAddOn function returns nil, since the code inside the if statement doesn't get executed, thus requiring me to manually load the library ingame - which, for some reason, works... Any ideas on how to make it work again would be greatly appreciated. Thank you!
  Reply With Quote
08-09-09, 08:00 PM   #2
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Move everything from OnInitialize() to OnEnable() - 3.2 borked LoD again.
__________________
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
08-10-09, 06:23 AM   #3
geniworm
A Defias Bandit
Join Date: Jan 2006
Posts: 3
Thanks for helping.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Problems with a LoD library


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off