First Time Posting On This Discord
Hello everyone,
I'm currently working on developing a WeakAura that displays high-priority purgeable buffs im tracking on specific units in rated arena (The enemy player units are: arena1, arena2 & arena3). I want the weakaura to show an icon anchored to the corresponding arena frame (arena1, arena2, or arena3) when the buff is active on that unit.
For instance, if arena1 has the buff 'Power Infusion' active, I would like the WeakAura to display the icon & anchor it to its respective arena frame called "sArenaEnemyFrame1" . Similarly, if the buff is active on arena3, I want the icon to be shown & anchored to "sArenaEnemyFrame3."
To achieve this, I am currently using a the Group By Frame feature with a custom function. Here's the code I'm using:
for _, regionData in ipairs(activeRegions) do
local unit = regionData.region.state and regionData.region.state.unit
if unit then
local frame = UnitIsUnit(unit, "arena1") and sArenaEnemyFrame1 or UnitIsUnit(unit, "arena2") and sArenaEnemyFrame2 or UnitIsUnit(unit, "arena3") and sArenaEnemyFrame3
if frame then
frames[frame] = frames[frame] or {}
tinsert(frames[frame], regionData)
end
end
end
end```
In addition, I have my trigger set to unit-type Arena.
The issue I'm encountering is that the buff isn't showing up at all when it should be active inside the arena. I've double-checked the code, read through links like this (https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Dynamic-Group#group-by-frame), searched through this discord & have not found anyone trying to do this with arena frames. My programming skills are quite poor & I'm unable to identify the problem. Could someone please assist me in resolving this issue?
Helpful side note: I have been successful with changing the local frame line of code to:
```local frame = UnitIsUnit(unit, "player") and sArenaEnemyFrame1```
In addition to setting my trigger unit type to player. It then displays & anchors the icon on the correct frame when the buff is applied. However, this is just for testing purposes and not how I intend to use it.
Thank you in advance for your help.