frame:SetScript("OnUpdate", nil);
end
-function M.UpdateAuraTooltips()
- GameTooltip = _G["GameTooltip"];
-end
-
local function createAura(parent, prev, anchor, name, unit)
local aura = CreateFrame("Frame", name, parent);
aura:SetPoint("TOPLEFT", prev, anchor);
aura:SetHeight(20);
aura.icon = aura:CreateTexture(nil, "ARTWORK");
aura.icon:SetAllPoints();
+ aura.stack = aura:CreateFontString(nil, "OVERLAY", "NumberFontNormalSmall");
+ aura.stack:SetPoint("BOTTOMRIGHT");
aura.cd = CreateFrame("Cooldown", name.."CD", aura, "CooldownFrameTemplate");
aura.cd:SetReverse(true);
aura.cd:SetHideCountdownNumbers(true);
aura.cd:SetAllPoints();
- aura.unit = unit; -- TODO add aura.stack text
+ aura.unit = unit;
aura:SetScript("OnEnter", showTooltip);
aura:SetScript("OnLeave", hideTooltip);
aura:Hide();
i = i + 1;
end
-- max rows
- for y=0,1 do
+ for y=0,0 do
for x=1,10 do
local auraName = name..i;
parent.auras[i] = createAura(parent.auras, parent.auras[y*10+x], "BOTTOMLEFT", auraName, unit);
function M.UpdateAuras(frame, unit)
local auras = frame.auras;
- for _, aura in ipairs(auras) do
- if not aura:IsShown() then break end
- aura:Hide();
- end
local icon, count, duration, expires, caster, id;
local pos = 1;
for _, filter in ipairs(auraFilters) do
aura.icon:SetTexture(icon);
aura.index = i;
aura.filter = filter;
+ if count > 1 then
+ aura.stack:SetText(count);
+ aura.stack:Show();
+ else
+ aura.stack:Hide();
+ end
if expires > 0 then
aura.cd:SetCooldown(expires - duration, duration);
else
i = i + 1;
end
end
+
+ while auras[pos] do
+ if not auras[pos]:IsShown() then return end
+ auras[pos]:Hide();
+ pos = pos + 1;
+ end
end