I'm not sure that I went about this the best way, but here's what I've managed to get so far. I'm sure something will go wrong, but in the meantime this script seems to disable the frame at login, after combat has ended and after I change talents (frame only activates for holy spec).
Lua Code:
local frameHandler = CreateFrame("FRAME")
local frameHandler2 = CreateFrame("FRAME")
local inCombat = false -- Need own variable becuase of event timings
frameHandler:SetScript("OnEvent", function(self, event, ...) -- Hides/shows frames when leaving/entering combat
if event =="PLAYER_REGEN_DISABLED" then
inCombat = true
PitBull4_Groups_Party:Show()
else
inCombat = false
PitBull4_Groups_Party:Hide()
end
if IsAddOnLoaded("PitBull4") then
C_Timer.After(0.1, function()
PitBull4_Groups_Party:Hide()
end)
end
end)
frameHandler2:SetScript("OnEvent", function(self, event, ...) -- Hides/shows frames when changing talent specialization
if event =="ACTIVE_TALENT_GROUP_CHANGED" then
C_Timer.After(0.1, function()
PitBull4_Groups_Party:Hide()
end)
end
end)
frameHandler:RegisterEvent("PLAYER_REGEN_ENABLED") -- Left combat
frameHandler:RegisterEvent("PLAYER_REGEN_DISABLED") -- Entered combat
frameHandler2:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") -- Changed talent specialization
Now I need to figure out how to make the frame fade before it goes away.