Skip to content

Commit 0b5ef6c

Browse files
committed
- fixed error message regarding missing config if ADDONS_LOADED is fired for some addons before VARIABLES_LOADED
1 parent 2f65df2 commit 0b5ef6c

File tree

3 files changed

+88
-14
lines changed

3 files changed

+88
-14
lines changed

TipTac/ttCore.lua

+31-5
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,8 @@ end
18741874

18751875
-- AddOn Loaded
18761876
function tt:ADDON_LOADED(event, addOnName)
1877+
if (not cfg) then return end;
1878+
18771879
-- check if addon is already loaded
18781880
if (TT_AddOnsLoaded[addOnName] == nil) or (TT_AddOnsLoaded[addOnName]) then
18791881
return;
@@ -1891,7 +1893,7 @@ function tt:ADDON_LOADED(event, addOnName)
18911893
end
18921894
end
18931895
-- now PetJournalPrimaryAbilityTooltip and PetJournalSecondaryAbilityTooltip exist
1894-
if (addOnName == "Blizzard_Collections") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Collections"))) then
1896+
if (addOnName == "Blizzard_Collections") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Collections")) and (not TT_AddOnsLoaded['Blizzard_Collections'])) then
18951897
pjpatt = PetJournalPrimaryAbilityTooltip;
18961898
pjsatt = PetJournalSecondaryAbilityTooltip;
18971899

@@ -1905,24 +1907,39 @@ function tt:ADDON_LOADED(event, addOnName)
19051907

19061908
-- Post-Hook WardrobeCollectionFrame.ItemsCollectionFrame:UpdateItems() to re-anchor tooltip at transmogrifier if "Anchors->Frame Tip Type" = "Mouse Anchor" and selecting items, see WardrobeItemsCollectionMixin:UpdateItems() in "Blizzard_Collections/Blizzard_Wardrobe.lua"
19071909
hooksecurefunc(WardrobeCollectionFrame.ItemsCollectionFrame, "UpdateItems", WCFICF_UpdateItems_Hook);
1910+
1911+
if (addOnName == "TipTac") then
1912+
TT_AddOnsLoaded["Blizzard_Collections"] = true;
1913+
end
1914+
end
19081915
-- now CommunitiesGuildNewsFrame exists
1909-
elseif (addOnName == "Blizzard_Communities") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Communities"))) then
1916+
if (addOnName == "Blizzard_Communities") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Communities")) and (not TT_AddOnsLoaded['Blizzard_Communities'])) then
19101917
-- Function to apply necessary hooks to CommunitiesFrame.MemberList.ListScrollFrame to apply class colors
19111918
tt:ApplyHooksToCFMLLSF();
19121919

19131920
hooksecurefunc(CommunitiesFrame.MemberList, "RefreshLayout", function()
19141921
tt:ApplyHooksToCFMLLSF();
19151922
end);
1923+
1924+
if (addOnName == "TipTac") then
1925+
TT_AddOnsLoaded["Blizzard_Communities"] = true;
1926+
end
1927+
end
19161928
-- now ContributionBuffTooltip exists
1917-
elseif (addOnName == "Blizzard_Contribution") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Contribution"))) then
1929+
if (addOnName == "Blizzard_Contribution") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Contribution")) and (not TT_AddOnsLoaded['Blizzard_Contribution'])) then
19181930
-- Hook Tips & Apply Settings
19191931
self:ApplyHooksToTips({
19201932
"ContributionBuffTooltip"
19211933
}, true, true);
19221934

19231935
self:ApplySettings();
1936+
1937+
if (addOnName == "TipTac") then
1938+
TT_AddOnsLoaded["Blizzard_Contribution"] = true;
1939+
end
1940+
end
19241941
-- now EncounterJournalTooltip exists
1925-
elseif (addOnName == "Blizzard_EncounterJournal") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_EncounterJournal"))) then
1942+
if (addOnName == "Blizzard_EncounterJournal") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_EncounterJournal")) and (not TT_AddOnsLoaded['Blizzard_EncounterJournal'])) then
19261943
ejtt = EncounterJournalTooltip;
19271944

19281945
-- Hook Tips & Apply Settings
@@ -1932,8 +1949,13 @@ function tt:ADDON_LOADED(event, addOnName)
19321949
-- }, true, true);
19331950

19341951
-- self:ApplySettings();
1952+
1953+
if (addOnName == "TipTac") then
1954+
TT_AddOnsLoaded["Blizzard_EncounterJournal"] = true;
1955+
end
1956+
end
19351957
-- now RaiderIO_ProfileTooltip and RaiderIO_SearchTooltip exist
1936-
elseif (addOnName == "RaiderIO") or ((addOnName == "TipTac") and (IsAddOnLoaded("RaiderIO"))) then
1958+
if (addOnName == "RaiderIO") or ((addOnName == "TipTac") and (IsAddOnLoaded("RaiderIO")) and (not TT_AddOnsLoaded['RaiderIO'])) then
19371959
-- Hook Tips & Apply Settings
19381960
C_Timer.After(1, function()
19391961
self:ApplyHooksToTips({
@@ -1943,6 +1965,10 @@ function tt:ADDON_LOADED(event, addOnName)
19431965

19441966
self:ApplySettings();
19451967
end);
1968+
1969+
if (addOnName == "TipTac") then
1970+
TT_AddOnsLoaded["RaiderIO"] = true;
1971+
end
19461972
end
19471973

19481974
TT_AddOnsLoaded[addOnName] = true;

TipTac/ttHyperlink.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ local supportedHyperLinks = {
3838
};
3939

4040
local addOnsLoaded = {
41+
["TipTac"] = false,
4142
["Blizzard_Communities"] = false
4243
};
4344

@@ -53,14 +54,20 @@ ttHyperlink:RegisterEvent("ADDON_LOADED");
5354

5455
-- AddOn Loaded
5556
function ttHyperlink:ADDON_LOADED(event, addOnName)
57+
if (not cfg) then return end;
58+
5659
-- check if addon is already loaded
5760
if (addOnsLoaded[addOnName] == nil) or (addOnsLoaded[addOnName]) then
5861
return;
5962
end
6063

6164
-- now CommunitiesGuildNewsFrame exists
62-
if (addOnName == "Blizzard_Communities") then
65+
if (addOnName == "Blizzard_Communities") or ((addOnName == "TipTac") and (IsAddOnLoaded("Blizzard_Communities")) and (not addOnsLoaded['Blizzard_Communities'])) then
6366
self:OnApplyConfig(cfg);
67+
68+
if (addOnName == "TipTac") then
69+
addOnsLoaded["Blizzard_Communities"] = true;
70+
end
6471
end
6572

6673
addOnsLoaded[addOnName] = true;

TipTacItemRef/ttItemRef.lua

+49-8
Original file line numberDiff line numberDiff line change
@@ -1600,13 +1600,15 @@ end
16001600

16011601
-- AddOn Loaded
16021602
function ttif:ADDON_LOADED(event, addOnName)
1603+
if (not cfg) then return end;
1604+
16031605
-- check if addon is already loaded
16041606
if (addOnsLoaded[addOnName] == nil) or (addOnsLoaded[addOnName]) then
16051607
return;
16061608
end
16071609

16081610
-- now AchievementFrameMiniAchievement exists
1609-
if (addOnName == "Blizzard_AchievementUI") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_AchievementUI"))) then
1611+
if (addOnName == "Blizzard_AchievementUI") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_AchievementUI")) and (not addOnsLoaded['Blizzard_AchievementUI'])) then
16101612
local ABMAhooked = {}; -- see AchievementButton_GetMiniAchievement() in "Blizzard_AchievementUI/Blizzard_AchievementUI.lua"
16111613

16121614
hooksecurefunc("AchievementButton_GetMiniAchievement", function(index)
@@ -1616,8 +1618,13 @@ function ttif:ADDON_LOADED(event, addOnName)
16161618
ABMAhooked[frame] = true;
16171619
end
16181620
end);
1621+
1622+
if (addOnName == "TipTac") then
1623+
addOnsLoaded["Blizzard_AchievementUI"] = true;
1624+
end
1625+
end
16191626
-- now PetJournalPrimaryAbilityTooltip and PetJournalSecondaryAbilityTooltip exist
1620-
elseif (addOnName == "Blizzard_Collections") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_Collections"))) then
1627+
if (addOnName == "Blizzard_Collections") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_Collections")) and (not addOnsLoaded['Blizzard_Collections'])) then
16211628
pjpatt = PetJournalPrimaryAbilityTooltip;
16221629
pjsatt = PetJournalSecondaryAbilityTooltip;
16231630

@@ -1662,8 +1669,13 @@ function ttif:ADDON_LOADED(event, addOnName)
16621669
local model = setsTransmogFrame.Models[i];
16631670
hooksecurefunc(model, "RefreshTooltip", WCFSTFM_RefreshTooltip_Hook);
16641671
end
1672+
1673+
if (addOnName == "TipTac") then
1674+
addOnsLoaded["Blizzard_Collections"] = true;
1675+
end
1676+
end
16651677
-- now CommunitiesGuildNewsFrame exists
1666-
elseif (addOnName == "Blizzard_Communities") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_Communities"))) then
1678+
if (addOnName == "Blizzard_Communities") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_Communities")) and (not addOnsLoaded['Blizzard_Communities'])) then
16671679
hooksecurefunc("CommunitiesGuildNewsButton_OnEnter", GNB_OnEnter_Hook);
16681680

16691681
-- Function to apply necessary hooks to CommunitiesFrameGuildDetailsFrameInfo
@@ -1672,8 +1684,13 @@ function ttif:ADDON_LOADED(event, addOnName)
16721684
hooksecurefunc("CommunitiesGuildInfoFrame_UpdateChallenges", function()
16731685
ttif:ApplyHooksToCFGDFI();
16741686
end);
1687+
1688+
if (addOnName == "TipTac") then
1689+
addOnsLoaded["Blizzard_Communities"] = true;
1690+
end
1691+
end
16751692
-- now EncounterJournalTooltip exists
1676-
elseif (addOnName == "Blizzard_EncounterJournal") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_EncounterJournal"))) then
1693+
if (addOnName == "Blizzard_EncounterJournal") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_EncounterJournal")) and (not addOnsLoaded['Blizzard_EncounterJournal'])) then
16771694
ejtt = EncounterJournalTooltip;
16781695

16791696
-- Hook Tips & Apply Settings
@@ -1683,8 +1700,13 @@ function ttif:ADDON_LOADED(event, addOnName)
16831700
-- }, true, true);
16841701

16851702
-- self:OnApplyConfig();
1703+
1704+
if (addOnName == "TipTac") then
1705+
addOnsLoaded["Blizzard_EncounterJournal"] = true;
1706+
end
1707+
end
16861708
-- now GuildNewsButton exists
1687-
elseif (addOnName == "Blizzard_GuildUI") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_GuildUI"))) then
1709+
if (addOnName == "Blizzard_GuildUI") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_GuildUI")) and (not addOnsLoaded['Blizzard_GuildUI'])) then
16881710
hooksecurefunc("GuildNewsButton_OnEnter", GNB_OnEnter_Hook);
16891711

16901712
-- Function to apply necessary hooks to GuildInfoFrameInfoChallenge
@@ -1693,11 +1715,21 @@ function ttif:ADDON_LOADED(event, addOnName)
16931715
hooksecurefunc("GuildInfoFrame_UpdateChallenges", function()
16941716
ttif:ApplyHooksToGIFIC();
16951717
end);
1718+
1719+
if (addOnName == "TipTac") then
1720+
addOnsLoaded["Blizzard_GuildUI"] = true;
1721+
end
1722+
end
16961723
-- now PlayerChoiceTorghastOption exists
1697-
elseif (addOnName == "Blizzard_PlayerChoice") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_PlayerChoice"))) then
1724+
if (addOnName == "Blizzard_PlayerChoice") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_PlayerChoice")) and (not addOnsLoaded['Blizzard_PlayerChoice'])) then
16981725
hooksecurefunc(PlayerChoicePowerChoiceTemplateMixin, "OnEnter", PCPCTM_OnEnter_Hook);
1726+
1727+
if (addOnName == "TipTac") then
1728+
addOnsLoaded["Blizzard_PlayerChoice"] = true;
1729+
end
1730+
end
16991731
-- now PVPRewardTemplate exists
1700-
elseif (addOnName == "Blizzard_PVPUI") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_PVPUI"))) then
1732+
if (addOnName == "Blizzard_PVPUI") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("Blizzard_PVPUI")) and (not addOnsLoaded['Blizzard_PVPUI'])) then
17011733
-- Function to apply necessary hooks to PVPRewardTemplate, see HonorFrameBonusFrame_Update() in "Blizzard_PVPUI/Blizzard_PVPUI.lua"
17021734
local buttons = {
17031735
HonorFrame.BonusFrame.RandomBGButton,
@@ -1709,8 +1741,13 @@ function ttif:ADDON_LOADED(event, addOnName)
17091741
for i, button in pairs(buttons) do
17101742
button.Reward.EnlistmentBonus:HookScript("OnEnter", HFBFB_OnEnter);
17111743
end
1744+
1745+
if (addOnName == "TipTac") then
1746+
addOnsLoaded["Blizzard_PVPUI"] = true;
1747+
end
1748+
end
17121749
-- now WorldQuestTrackerAddon exists
1713-
elseif (addOnName == "WorldQuestTracker") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("WorldQuestTracker"))) then
1750+
if (addOnName == "WorldQuestTracker") or ((addOnName == "TipTacItemRef") and (IsAddOnLoaded("WorldQuestTracker")) and (not addOnsLoaded['WorldQuestTracker'])) then
17141751
local WQTThooked = {}; -- see WorldQuestTracker.GetOrCreateTrackerWidget() in "WorldQuestTracker/WorldQuestTracker_Tracker.lua"
17151752

17161753
hooksecurefunc(WorldQuestTrackerAddon, "GetOrCreateTrackerWidget", function(index)
@@ -1720,6 +1757,10 @@ function ttif:ADDON_LOADED(event, addOnName)
17201757
WQTThooked[frame] = true;
17211758
end
17221759
end);
1760+
1761+
if (addOnName == "TipTac") then
1762+
addOnsLoaded["WorldQuestTracker"] = true;
1763+
end
17231764
end
17241765

17251766
addOnsLoaded[addOnName] = true;

0 commit comments

Comments
 (0)