PHP код:
do
local size = 36
local f,pg,i,c = CreateFrame("frame","CD_Weapon_",UIParent),UnitGUID("player"),0
f:SetPoint("CENTER")
f:SetSize(size,size)
f:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Background",
tile = true, tileSize = 0, edgeSize = 1, insets = { left = 0, right = 0, top = 0, bottom = 0}})
f:SetMovable(true)
f:SetClampedToScreen(true)
f:EnableMouse(true)
f:SetScript("OnMouseDown",function(self,button) self:StartMoving() end)
f:SetScript("OnMouseUp",function(self,button) self:StopMovingOrSizing() end)
f:SetBackdropColor(.4,.4,.4,1)
f:SetBackdropBorderColor(0,0,0,1)
f:Hide()
i = f:CreateTexture(nil,"OVERLAY")
i:SetTexture((select(3,GetSpellInfo(58804))))
i:SetTexCoord(.08,.92,.08,.92)
i:SetPoint("CENTER")
i:SetSize(size-6,size-6)
c = CreateFrame("Cooldown",nil,f,"CooldownFrameTemplate")
c:SetPoint("CENTER")
c:SetReverse(true)
c:SetDrawEdge(true)
f:SetScript("OnEvent",function(_,_,t,_,g,_,_,_,_,_,id)
if (id == 25504 or id == 33750) and g == pg then
f:Show()
c:Show()
c:SetCooldown(GetTime(),3)
local tt=3
f:SetScript("OnUpdate",function(self,e)
tt=tt-e
if tt <=0 then
self:Hide()
self:SetScript("OnUpdate",nil)
end
end)
end
end)
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
мб баг, но кулдаун там общий.