Skip to content

Commit

Permalink
improve the blue overlay for cascade repurchable talents (you're welc…
Browse files Browse the repository at this point in the history
…ome, people with OCD :D)
  • Loading branch information
Numynum committed Nov 26, 2022
1 parent 52bda58 commit bf6f789
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions modules/highlightCascadeRepurchable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ local _, TTT = ...;
--- @type TalentTreeTweaks_Main
local Main = TTT.Main;

local Module = Main:NewModule('HighlightCascadeRepurchable', 'AceEvent-3.0');
local Module = Main:NewModule('HighlightCascadeRepurchable');
Module.enabled = false;

function Module:OnEnable()
self.enabled = true;
self.buttonTextures = self.buttonTextures or {};
if IsAddOnLoaded('Blizzard_ClassTalentUI') then
EventUtil.ContinueOnAddOnLoaded('Blizzard_ClassTalentUI', function()
self:SetupHook();
else
self:RegisterEvent('ADDON_LOADED');
end
end);
end

function Module:OnDisable()
Expand Down Expand Up @@ -81,13 +79,6 @@ function Module:GetOptions(defaultOptionsTable, db)
return defaultOptionsTable;
end

function Module:ADDON_LOADED(_, addonName)
if addonName == 'Blizzard_ClassTalentUI' then
self:UnregisterEvent('ADDON_LOADED');
self:SetupHook();
end
end

function Module:SetupHook()
ClassTalentFrame.TalentsTab:RegisterCallback(TalentFrameBaseMixin.Event.TalentButtonAcquired, self.OnTalentButtonAcquired, self);
for talentButton in ClassTalentFrame.TalentsTab:EnumerateAllTalentButtons() do
Expand Down Expand Up @@ -115,12 +106,7 @@ function Module:OnTalentButtonAcquired(button)
texture:SetAllPoints(button);
texture:SetTexture('Interface/Tooltips/UI-Tooltip-Background');
texture:SetVertexColor(self.db.color.r, self.db.color.g, self.db.color.b, self.db.color.a);

local mask = button:CreateMaskTexture();
mask:SetAllPoints(texture);
mask:SetTexture('Interface/CHARACTERFRAME/TempPortraitAlphaMask');
texture:AddMaskTexture(mask);

texture:AddMaskTexture(button.IconMask);
texture:Hide();
hooksecurefunc(button, 'UpdateNonStateVisuals', UpdateNonStateVisualsHook);
end
Expand Down

0 comments on commit bf6f789

Please sign in to comment.