View Single Post
11-15-22, 05:11 AM   #2
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 126
What I currently do is add a new attribute in 'updateAura'.

Code:
button.spellID = aura.spellId
Lua Code:
  1. local BOLSTER_ID = 209859
  2.  
  3. local function PreUpdate(element)
  4.     element.numBolster = 0
  5. end
  6.  
  7. local function FilterAura(element, _, data)
  8.     if data.name and data.spellId == BOLSTER_ID then
  9.         element.numBolster = element.numBolster + 1
  10.         return element.numBolster == 1
  11.     end
  12. end
  13.  
  14. local function PostUpdate(element)
  15.     if element.numBolster == 0 then return end
  16.  
  17.     for i = 1, #element.sortedBuffs do
  18.         local button = element[i]
  19.         if button.spellID == BOLSTER_ID then
  20.             button.Count:SetText(element.numBolster)
  21.             break
  22.         end
  23.     end
  24. end
  Reply With Quote