View Single Post
11/11/16, 09:21 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,999
Originally Posted by Havin View Post
First, thank you, for the quick answer

So, im gonna "sniff" it then. Thats not a perfect solution, but it may do the job also.

Besides that, does a value exist to find out which of the bars is currently active? That would help to save the Ultimate Costs and to position that information in the screen.
You can use the event if a weapon pair changes:

Lua Code:
  1. --Register callback function if the weapon bars change
  2.     EVENT_MANAGER:RegisterForEvent(myAddon.Name .. "_WeaponPairChanged", EVENT_ACTIVE_WEAPON_PAIR_CHANGED, ActiveWeaponPairChanged)

In the callback function "ActiveWeaponPairChanged" you can save the active weapon pair to a variable in your addon:

Lua Code:
  1. --Fires each time you change your weapon bars
  2. local function ActiveWeaponPairChanged(eventCode, activeWeaponPair, locked)
  3.     myAddon.activeWeaponBar = activeWeaponPair
  4. end


This event will trigger multiple times if the weapon pair changes!
If I remember right it was something like
-One time for the "form-bar" with locked = true
-One time for the "to-bar" with locked = false
-One time for the "form-bar" with locked = false

Locked is the state as the abilities on the bar get locked. They get grayed out and you're not able to use them during the switch happens.
  Reply With Quote