#Custom Anchor

19 messages · Page 1 of 1 (latest)

hollow zealot
#

Hi, I need to set the anchor of group based on the current spec that I'm playing.
The code works fine, but i can't understand when custom anchor function is fired. Is that a way to change it when spec is changed? To fire it i need to reload or open/close wa

#

This is the following code:
function() if GetSpecialization() == 2 then return WeakAuras.GetRegion("Aura_1") else return WeakAuras.GetRegion("Aura_2") end end

lost spade
#

what is the trigger

hollow zealot
#

There isn't a trigger since this is a group

#

Updated the description of the post

lost spade
#

but group have weakauras in them

hollow zealot
#

Sure, there a lot of auras inside, all of them track buffs

#

And even if they are updated, the custom anchor function is never fired

lost spade
#

easiest way would be make 2 groups for each spec

hollow zealot
#

Ye sure, but The are a lot of aura in that should be shared

#

Or i could solve this problem if it would possible to use a dynamical group inside to another dynamical group

sharp moat
#

PLAYER_TALENT_UPDATE is the event you want for that.

hollow zealot
# sharp moat PLAYER_TALENT_UPDATE is the event you want for that.

Yes but this is a custom anchor function of a group, not of an aura. So it's not fiered in any trigger update since groups don't have any. Also when a aura inside the group is triggered, the anchor function of the group is not fired. To fired it i can only relod ui or open/close the editor inside this function

hollow zealot
#

If from another aura I get the region of the interested group, is possible to use a function of region to SetAnchorPoint?

#

So it’s not fired from custom anchor function but inside a trigger of another aura

sharp moat
#

what are you anchoring it to? if its not anchored to something moving and its gonna stay in a static location on the screen thenyou could probably do this in using custom some custom code in animations maybe? something like instead of changing the anchor when spec is changed, change it from startX and startY to deltaX and deltaY. (no actual animation, just moving it from one spot to another)

sharp moat
# sharp moat what are you anchoring it to? if its not anchored to something moving and its go...

Follow up: i just tested this on a group and it seems to work. no need to reload or open the options, just changing the variable does it. ```function(progress, startX, startY, deltaX, deltaY)
if VARIABLE == "SOMETHING"
then
return deltaX , deltaY
else
return startX, startY
end

end``` swap out the VARIABLE and the SOMETHING for the appropriate info and then set the variable in one of the auras using the code you posted above. this again is only really a viable solution if what youre trying to anchor it to isnt something thats going to move around.

hollow zealot
#

It would very easy if in anchor custom code I can specify a list of event that fire the function, like trigger or custom condition, otherwise the purpose to have a custom function for groups when it is never fired, is completely useless