1
0
Fork 0

Fixes potential bug with registering ADDON_LOADED in OnEnable

This commit is contained in:
pigmonkey 2011-09-18 17:35:02 -04:00
parent fe7e404ebe
commit c01267f550
2 changed files with 11 additions and 14 deletions

View file

@ -25,15 +25,12 @@ local BLACKLIST = {
function mod:OnInitialize() function mod:OnInitialize()
self:RegisterOptions(options, defaults, function(d) db=d end) self:RegisterOptions(options, defaults, function(d) db=d end)
-- must be in OnInitialize because ADDON_LOADED is buggy otherwise
self:RegisterEvent("ADDON_LOADED")
end end
function mod:OnEnable() function mod:OnEnable()
self:RegisterEvent("RAID_ROSTER_UPDATE") self:RegisterEvent("RAID_ROSTER_UPDATE")
if IsAddOnLoaded("Blizzard_GuildUI") then
self:ADDON_LOADED(_, "Blizzard_GuildUI")
else
self:RegisterEvent("ADDON_LOADED")
end
end end
function mod:ADDON_LOADED(_, name) function mod:ADDON_LOADED(_, name)

View file

@ -52,6 +52,15 @@ function mod:OnInitialize()
-- allow max camera zoom -- allow max camera zoom
ConsoleExec("cameradistancemaxfactor 5") ConsoleExec("cameradistancemaxfactor 5")
CompactRaidFrameContainer.Show = CompactRaidFrameContainer.Hide CompactRaidFrameContainer.Show = CompactRaidFrameContainer.Hide
-- Fix guild crafters: must be in OnInitialize because ADDON_LOADED is buggy otherwise
self:RegisterEvent("ADDON_LOADED", function(_, name)
if name == "Blizzard_TradeSkillUI" then
for i=1, TRADE_SKILL_GUILD_CRAFTERS_DISPLAYED do
_G["TradeSkillGuildCrafter"..i.."Text"].SetTextColor = function() end
end
end
end)
end end
@ -80,15 +89,6 @@ function mod:OnEnable()
-- louder LFD sound -- louder LFD sound
self:RegisterEvent("LFG_PROPOSAL_SHOW"); self:RegisterEvent("LFG_PROPOSAL_SHOW");
-- Fix guild crafters
self:RegisterEvent("ADDON_LOADED", function(_, name)
if name == "Blizzard_TradeSkillUI" then
for i=1, TRADE_SKILL_GUILD_CRAFTERS_DISPLAYED do
_G["TradeSkillGuildCrafter"..i.."Text"].SetTextColor = function() end
end
end
end)
end end
-- Slash Commands -------------------------------------------------------------- -- Slash Commands --------------------------------------------------------------