Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/24/15, 11:28 AM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,028
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.
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » EVENT_ACTIVE_WEAPON_PAIR_CHANGED always fired for every attack (even out of combat)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off