Skip to content

Commit

Permalink
Possible fix for a rare taint issue involving the spellbook
Browse files Browse the repository at this point in the history
  • Loading branch information
Numynum committed Sep 2, 2024
1 parent e2a9b2f commit 1e0e08f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions modules/copyTalentButtonInfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Module:SetupHook(talentsTab)
self:OnTalentButtonAcquired(talentButton);
end
self:SecureHook(talentsTab, 'ShowSelections', 'OnShowSelections');
Util:GetTalentContainerFrame().SpellBookFrame.PagedSpellsFrame:RegisterCallback('OnUpdate', self.OnSpellbookUpdate, self);
EventRegistry:RegisterCallback("PlayerSpellsFrame.SpellBookFrame.DisplayedSpellsChanged", self.OnSpellbookUpdate, self);
self:OnSpellbookUpdate();
end

Expand Down Expand Up @@ -138,15 +138,19 @@ end
Module.hookedTooltipFrames = {};
function Module:OnSpellbookUpdate()
local spellBookFrame = Util:GetTalentContainerFrame().SpellBookFrame;
spellBookFrame:ForEachDisplayedSpell(function(spellFrame)
local button = spellFrame.Button;
if self:IsHooked(button, 'OnEnter') then
return;
end
self.hookedTooltipFrames[button] = true;
self:SecureHookScript(button, 'OnEnter', 'OnSpellbookButtonEnter');
self:SecureHookScript(button, 'OnLeave', 'OnSpellbookButtonLeave');
end);

DevTool:AddData(Mixin({}, spellBookFrame.PagedSpellsFrame.frames));
for _, frame in pairs(spellBookFrame.PagedSpellsFrame.frames) do
if frame.elementData and frame.spellBookItemInfo then -- Avoid header or spacer frames
local button = frame.Button;
if self:IsHooked(button, 'OnEnter') then
return;
end
self.hookedTooltipFrames[button] = true;
self:SecureHookScript(button, 'OnEnter', 'OnSpellbookButtonEnter');
self:SecureHookScript(button, 'OnLeave', 'OnSpellbookButtonLeave');
end
end
end

function Module:OnTalentTooltipCreated(_, tooltip)
Expand Down

0 comments on commit 1e0e08f

Please sign in to comment.