View Single Post
11-15-22, 08:51 AM   #3
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Well, it had to happen because the update process happens in stages now, filtering > sorting > redrawing. Buttons get updated only at the redrawing stage, but before that we work with raw aura data. If I were you, I'd use PostUpdateButton instead of PostUpdate since it gives you both the button and the aura data, but you won't need the latter in this case. I drycoded it, but this should do the trick.

Lua Code:
  1. local BOLSTER_ID = 209859
  2.  
  3. local function PreUpdate(element)
  4.     element.bolsterStacks = 0
  5.     element.bolsterInstanceID = nil
  6. end
  7.  
  8. local function FilterAura(element, _, data)
  9.     if data.name and data.spellId == BOLSTER_ID then
  10.         if not element.bolsterInstanceID then
  11.             element.bolsterInstanceID = data.auraInstanceID
  12.         end
  13.  
  14.         element.bolsterStacks = element.bolsterStacks + 1
  15.         return element.bolsterStacks == 1
  16.     end
  17. end
  18.  
  19. local function PostUpdateButton(element, button)
  20.     if not element.bolsterInstanceID then return end
  21.     if element.bolsterInstanceID ~= button.auraInstanceID then return end
  22.  
  23.     button.Count:SetText(element.bolsterStacks)
  24. end
__________________
  Reply With Quote