EVENT_ACTIVE_WEAPON_PAIR_CHANGED always fired for every attack (even out of combat)
Hey there,
I just tried to use the event EVENT_ACTIVE_WEAPON_PAIR_CHANGED to see if the active weapon bar was changed.
1) It gets fired once with locked = true for the current active action bar (1) to lock it (but this does not happen always?).
2) Afterwards it gets fired for the new action bar (2) with locked = true.
3) And then finally it gets fired with the new action bar (2) and locked = false.
"Locked" means the small "lock symbol" at the action bar which says you cannot use or change the bar currently.
I just want to react on a player changing his action bar. But this chain of event firing will be ALWAYS fired with steps 2 and 3 if I even only use my attack skill of the weapon.
Bar gets locked 2), bar gets unlocked 3).
Any chance to filter this out so I can just react on a player "really" changing his action bars?
My current solution is:
-Upon login: Get active bar and save it into global addon variable
-Event is fired: Check if global variable differs from current event's active weapon pair id
-> As "locked = false" and weaponbar Id differs: Update the global variable with the new variable from the event
I only run my code if the last weapon bar id differs from the current one.
Any better solutions?
Thanks for your help.
|