View Single Post
06-03-16, 07:23 AM   #25
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by zork View Post
Here is my idea. Can I get the value from GetNumShapeShiftForms() and save it on the bar and access that value in the restricted environment? Should be if I use Execute and set up a reference or am I mistaken?
Yeah, you can just call something like frame:Execute('NumShapeshiftForms = ' .. GetNumShapeshiftForms()) on PLAYER_LOGIN or whenever you think it might change, as long as you're out of combat. You could even call it upon entering combat if you wanted to.

The value would probably only ever change for a leveling druid who just picked up a new form, or maybe switching specs, where you'd gain and lose moonkin form.

From what I can tell the stance bar only monitors the "UPDATE_SHAPESHIFT_COOLDOWN" event to handle hiding and showing the proper buttons, however UPDATE_SHAPESHIFT_FORMS might be a better event to watch.

Look, you can't have an action bar addon that works most of the time. It has to work all of the time, and if the api functions have the potential to ever return the incorrect values due to the order of events being undefined, you simply can't use them. You have to hardcode the bar offsets and pass them based on which macro condition fired.

Last edited by semlar : 06-03-16 at 08:11 AM.