Fixes potential bug with registering ADDON_LOADED in OnEnable
This commit is contained in:
parent
fe7e404ebe
commit
c01267f550
2 changed files with 11 additions and 14 deletions
|
@ -25,15 +25,12 @@ local BLACKLIST = {
|
|||
|
||||
function mod:OnInitialize()
|
||||
self:RegisterOptions(options, defaults, function(d) db=d end)
|
||||
-- must be in OnInitialize because ADDON_LOADED is buggy otherwise
|
||||
self:RegisterEvent("ADDON_LOADED")
|
||||
end
|
||||
|
||||
function mod:OnEnable()
|
||||
self:RegisterEvent("RAID_ROSTER_UPDATE")
|
||||
if IsAddOnLoaded("Blizzard_GuildUI") then
|
||||
self:ADDON_LOADED(_, "Blizzard_GuildUI")
|
||||
else
|
||||
self:RegisterEvent("ADDON_LOADED")
|
||||
end
|
||||
end
|
||||
|
||||
function mod:ADDON_LOADED(_, name)
|
||||
|
|
|
@ -52,6 +52,15 @@ function mod:OnInitialize()
|
|||
-- allow max camera zoom
|
||||
ConsoleExec("cameradistancemaxfactor 5")
|
||||
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
|
||||
|
||||
|
||||
|
@ -80,15 +89,6 @@ function mod:OnEnable()
|
|||
|
||||
-- louder LFD sound
|
||||
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
|
||||
|
||||
-- Slash Commands --------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue