PHP код:
local size = 26
local spells = {57960,53390,63734,33151,53601,48952,54428,498,59578}
local spellsDB = {}
for _,s in pairs(spells) do
spellsDB[s] = CreateFrame("frame", nil, ShapeshiftButton7)
spellsDB[s]:SetSize(size, size)
spellsDB[s].c = CreateFrame("Cooldown", nil, spellsDB[s])
spellsDB[s].c:SetAllPoints()
spellsDB[s].t = spellsDB[s]:CreateTexture(nil, 'BORDER')
spellsDB[s].t:SetAllPoints()
spellsDB[s].t:SetTexture(select(3, GetSpellInfo(s)))
spellsDB[s]:Hide()
end
local f = CreateFrame("Frame") f:RegisterEvent("UNIT_AURA")
f:SetScript("OnEvent", function(self, event, ...)
local unit = ...
local sfound, rfound = false, false
if event == "UNIT_AURA" and unit=='player' then
local index = 0
for _,s in pairs(spells) do spellsDB[s]:Hide() end
for i = 1, 40 do
local n, _, _, _, _, d, x, _, _, _, spellID = UnitBuff("player", i)
if not n then break end
if spellsDB[spellID] then
if index == 0 then spellsDB[spellID]:SetPoint("TOP", 30, 10) else spellsDB[spellID]:SetPoint("TOP", 30+index*size, 10) end
spellsDB[spellID]:Show() spellsDB[spellID].c:SetCooldown(x - d - 0.5, d) index = index + 1
end
end
end
end)
Можно ли как нибудь добавить отображение стаков?
Ну или какой нибудь аддон для трека баффов лёгкий подскажите.