WeakAuras

WeakAuras

206M Downloads

"Action Usable" trigger doesn't filter "UNIT_POWER_FREQUENT" from others

mrbuds opened this issue ยท 3 comments

commented

Describe the bug
We had a report on discord from someone who use a lot of Action Usable trigger that went from 85% cpu time used by WA to 5% by replacing those triggers.
His issue was very noticeable while he was in raid and the event most of this CPU time was coming from is UNIT_POWER_FREQUENT.

=============

I didn't found how to modify current trigger to filter without rewriting the whole thing as a TSU: https://hastebin.com/jeyijukoga.rb
This implementation still has a bug where modifying the spell isn't taken into account before a reload

I guess there is an easier and more efficient way to do it, that's why i didn't made a PR

commented

If you are only interested in power updates for a specific unit (Which is the case for the action usable trigger), then you are supposed to use the RegisterUnitEvent method to filter out irrelevant units.

commented

As i understand it, a proper solution is to have a new "unit_events" field to WeakAuras.event_prototypes[*].unit_events with a format like { unitId = {"UNIT_EVENT1", ... }, ... }
And instead of registering it in WeakAuras.frames["WeakAuras Generic Trigger Frame"] additional frames are created per unitId

commented

Sure, that could work.