Hey!
So, one of my addon has a frame that listens to ACTIVE_TALENT_GROUP_CHANGED event which calls GetTalentInfo to check whether the specific talent is selected or not when its fired.
I honestly dunno why, but GetTalentInfo seems to be returning a nil value when the player zones into time-walking dungeons, arena and battleground.
Here's a code snippet:
Lua Code:
local f = CreateFrame("Frame")
f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
f:SetScript("OnEvent", function(self, event, ...)
self[event](self, ...)
)
function f:ACTIVE_TALENT_GROUP_CHANGED()
local _, _, _, selected = GetTalentInfo(7, 1, 1)
if selected then
objectA:Show()
else
objectA:Hide()
end
_, _, _, selected = GetTalentInfo(1, 1, 1)
if selected then
objectB:Show()
objectB:RegisterEvent("PLAYER_TARGET_CHANGED")
else
objectB:Hide()
objectB:UnregisterEvent("PLAYER_TARGET_CHANGED")
end
end
Both, objectA and objectB are hidden when I enter those zones and I'll have to reload ui to see them again
(This function is the only part where it manages those objects' visibility)
What would be causing this and would there be any possible solutions?