View Single Post
07/01/18, 08:07 PM   #1
static_recharge
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 35
Multiple Event Filters?

So I'm following the Wiki on how to add multiple filters for the same event and I'm stumped. According to the Wiki:
Multiple filters can be added in one call by repeatedly supplying a filter type followed by a parameter or in multiple calls by calling AddFilterForEvent for the same event. Filters cannot be removed once they were added without unregistering the event.
But when I try to do this (either method mentioned), the only filter that applies is the last one to run in the code.

My code for method 1:
Code:
EVENT_MANAGER:RegisterForEvent(SFR.addonName, EVENT_EFFECT_CHANGED, SFR.OnEffectChanged)

EVENT_MANAGER:AddFilterForEvent(SFR.addonName, EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, 89957, REGISTER_FILTER_ABILITY_ID, 61259)
My code for method 2:
Code:
EVENT_MANAGER:RegisterForEvent(SFR.addonName, EVENT_EFFECT_CHANGED, SFR.OnEffectChanged)

EVENT_MANAGER:AddFilterForEvent(SFR.addonName, EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, 89957)

EVENT_MANAGER:AddFilterForEvent(SFR.addonName, EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, 61259)
In both cases only the last filter to be executed works. I verified this by switching the abilityId's and still only the last one to be applied works. Any ideas or suggestions for what I'm doing wrong? I'd like to add a whole bunch of filters so that my code only fires on the events I want, but I can't even get these 2 to work.

Thanks in advance for any help!
  Reply With Quote