#Custom attach to frame

1 messages · Page 1 of 1 (latest)

echo anvil
#

Hi, i want to dynamically attach a weakaura to a first loaded weakaura with name beginning with "Healthbar -". I need to know how to get weakaura frame by name in code and how to check if its loaded.

sharp cloak
#

Eh?

echo anvil
#

i can select a frame here but i want to get it from code by weakaura's name

trim leaf
#

Curious, what are you trying to do that you need to Change the parent?

echo anvil
#

my healthBar wa(luxthos wa) has different position depending on a class/spec, i want to attach debuffs weakaura to it(so i have debuffs on hp bar) but i dont want to make a copy for each class i play

#

like this

trim leaf
#

You'd probably have to utilise scan events to tell which Aura is loaded, not sure if an aura can tell what another aura state is.

But it seems like WA does have a function to set anchors to other auras

local region = aura_env.region

region:SetAnchor("BOTTOMLEFT", WeakAuras.GetRegion("Other Aura"), "TOPRIGHT")
    -- Anchors the aura to another aura.

SetAnchor(anchorPoint, relativeTo, relativePoint)

https://github.com/WeakAuras/WeakAuras2/wiki/Editing-Aura-Regions

GitHub

World of Warcraft addon that provides a powerful framework to display customizable graphics on your screen. - Editing Aura Regions · WeakAuras/WeakAuras2 Wiki

#

I'm also going to assume that partial names don't work, so you'd probably have to create 38 conditions for each scan event for each spec

echo anvil
#

its each class actually, each class has its own hp bar

#

and i thought its possible to set anchors to other auras because you can do it in wa as on screenshot above

trim leaf
#

It is, but I generally only do it through the WA Options interface

#

and the Function above looks like the one you'd use if you wanted to code it.

#

So given the position of the ? in the SS above

#

SetAnchor("TOPLEFT", WeakAuras.GetRegion("HP bar name"), "TOPLEFT")

echo anvil
#

i'll try it, thank you for this

trim leaf
#

If you're gona do this for Multiple Auras, it might be easier to make a "Blank" aura that moves around and just have the debuffs anchor to the "Blank" in the options menu

echo anvil
#

this works in "Anchored to" - custom

#

and it executes only on init so its perfect for me