Originally Posted by plopek
Can I make the icon appear only when cooldown/timer starts?
|
Something like this would probably work.
Lua Code:
local t=CreateFrame("FRAME")
t:SetPoint("CENTER",ParentUI,2,12)
t:SetSize(30,30)
t.c=CreateFrame("Cooldown","cd1")
t.c:SetAllPoints(t)
t.t=t:CreateTexture(nil,"BORDER")
t.t:SetAllPoints()
t.t:SetTexture("Interface\\Icons\\spell_holy_crusaderstrike")
t:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
t:Hide()
cd1:HookScript('OnHide', function() t:Hide() end)
t:SetScript("OnEvent", function(...)
local b,_,_,e,_,_,_,_,_,_,l = select(4, ...)
if (e == UnitName("Player") and (b=="SPELL_AURA_APPLIED" or b=="SPELL_AURA_REFRESH")and l==209785) then
t:Show()
CooldownFrame_SetTimer(cd1,GetTime(),15,1)
end
end)