- for _, aura in pairs(frame.auras) do
- name, _, icon, count, _, duration, expires = UnitAura(unit, aura, nil, frame.auraFilter);
- if name then
- if count > 0 then
- frame.stack:SetText(count);
- frame.stack:Show();
- else
- frame.stack:Hide();
+ local auraFilter = frame.auraFilter;
+ if frame.iterateAuras then
+ local i = 1;
+ while true do
+ name, _, icon, count, _, duration, expires = UnitAura(unit, i, auraFilter);
+ if not name then break end
+ -- possible improvement to add spellID as an option
+ if frame.auras[name] then
+ if count > 0 then
+ frame.stack:SetText(count);
+ frame.stack:Show();
+ else
+ frame.stack:Hide();
+ end
+ if expires > 0 then
+ frame.cd:SetCooldown(expires - duration, duration);
+ frame.cd:Show();
+ else
+ frame.cd:Hide();
+ end
+ frame.icon:SetTexture(icon);
+ frame:Show();
+ return;