ok sorry phanx, here it is. i am ready to get laughed at for this code:
Code:
local addon, addonName = ...
local frame = CreateFrame("Frame")
local onEvent = function(self, event, ...)
if event == "COMBAT_LOG_EVENT_UNFILTERED" then
local timestamp, subevent, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags,
spellID, spellName, spellSchool, extraSpellID, extraSpellName = ...;
if (subevent == "SPELL_INTERRUPT") then
interruptgo(destName, spellID)
end
end
end
frame:SetScript("OnEvent", onEvent)
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
target=CreateFrame("Frame")
target:SetPoint("CENTER", TargetFrame, "CENTER",-130,0)
target:SetSize(40,40)
target.c=CreateFrame("Cooldown","cd1")
target.c:SetAllPoints(target)
target.t=target:CreateTexture(nil,"BORDER")
target.t:SetAllPoints()
target.t:SetTexture("Interface\\Icons\\ability_kick")
focus=CreateFrame("Frame")
focus:SetPoint("CENTER", FocusFrame, "CENTER",-130,0)
focus:SetSize(40,40)
focus.c=CreateFrame("Cooldown","cd2")
focus.c:SetAllPoints(focus)
focus.t=focus:CreateTexture(nil,"BORDER")
focus.t:SetAllPoints()
focus.t:SetTexture("Interface\\Icons\\ability_kick")
function interruptgo(destName, spellID)
if spellID == 1766 and destName == (UnitName("target")) then
CooldownFrame_SetTimer(cd1,GetTime(),5,1)
target.t:SetTexture("Interface\\Icons\\ability_kick")
elseif spellID == 1766 and destName == (UnitName("focus")) then
CooldownFrame_SetTimer(cd2,GetTime(),5,1)
focus.t:SetTexture("Interface\\Icons\\ability_kick")
elseif spellID == 1766 and destName == (UnitName("target")) then
CooldownFrame_SetTimer(cd1,GetTime(),4,1)
target.t:SetTexture("Interface\\Icons\\spell_holy_rebuke")
elseif spellID == 1766 and destName == (UnitName("focus")) then
CooldownFrame_SetTimer(cd2,GetTime(),4,1)
focus.t:SetTexture("Interface\\Icons\\spell_holy_rebuke")
-- and so on for all interrupt spells...
end
end
would it be better to do the SpellID and icons textures as arguments of a table so that i can just get the duration and texture by adressing say "kick" in that table? if so i don't know how
but as is said, my main goal now is to not have the icons shown always but only if they are actually counting. is there a way to determine if there is actually an animation running on the CooldownFrame cd1 or cd2, or do i have to do it with an OnUpdate GetTime thingy.
thanx for helping me!