Skip to content

Commit

Permalink
#72 Fixed talent changes not updating spell icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sellorio committed Oct 16, 2020
1 parent 6263151 commit 0fa7e78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/cached-data-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ function MM.GetSpellCharges(spellId)
{ charges, maxCharges, chargeStart, chargeDuration, chargeModRate },
maxCharges and 0 or 999999
end)
end

function MM.ResetCacheForSpells()
Cache.SpellInfo = {}
Cache.SpellCharges = {}
end
3 changes: 3 additions & 0 deletions src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("PLAYER_LEAVING_WORLD")
f:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:RegisterEvent("PLAYER_TALENT_UPDATE")

local function OnUpdate(_, elapsed)
MegaMacroSystemTime = GetTime()
Expand Down Expand Up @@ -59,5 +60,7 @@ f:SetScript("OnEvent", function(self, event)
MegaMacroWindow.OnSpecializationChanged(oldValue, MegaMacroCachedSpecialization)
elseif "PLAYER_TARGET_CHANGED" then
MegaMacroActionBarEngine.OnTargetChanged()
elseif "PLAYER_TALENT_UPDATE" then
MM.ResetCacheForSpells()
end
end)
2 changes: 1 addition & 1 deletion src/mega-macro-icon-evaluator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ local function GetIconAndNameFromAbility(ability)
return texture, ability, "item"
end

return MegaMacroTexture, nil, nil
return MegaMacroTexture, ability, nil
end
end

Expand Down

0 comments on commit 0fa7e78

Please sign in to comment.