#Synch sizes with a custom growth function group

11 messages · Page 1 of 1 (latest)

tiny raft
#

I have a dynamic group with my rotation abilities, and it has a custom growth function to make sure the group isn't larger than 420px (reducing icon width if necessary), which means the group width is variable and can change at any time
I'd like another group of vertically stacked progress bar WAs to adjust their width based on the current width of the first group.

What's the best approach for that?

#

To clarify, the rotation group size can change at any moment for things like entering execute, gaining void bolt or other stuff

hard trout
#

wouldnt that be terrible if the group size can change at any moment? progress bar changing size all the time?

tiny raft
#

Here's an example screenshot. It's the golden and white bars on top of my rotation. These are tracking PI and a random speed increase, but I track a lot of things this way, and I like the bars to be aligned to the rotation group

tiny raft
#

I have never used eventscan but I was thinking on sending the width value from one wa to the other using that, but I want to know if there's a better way to do it

hard trout
#

yeah in the custom grow send a scanevents with the width, thats one of the better ways of doing

#

other way is to put bars in dynamic group and sort them in the custom grow as well

tiny raft
#

I use this function to sort my rotation group
`function(newPositions, activeRegions)
local totalWidth = math.min(220,(#activeRegions*40))
local width = math.min((totalWidth / #activeRegions),40)

for i = 1, #activeRegions do
    activeRegions[i].region:SetRegionWidth(width)
    
    newPositions[i] = {
        i*width - totalWidth/2 - width/2, -- x
        0                                 -- y
    }
end

end`
Is there a way I could sort the bars group based on the activeRegions of the rotation group?

hard trout
#

ive never fiddled with it myself but you'd need to identify which region is the bars and set the position and width for them

tiny raft
#

I'm trying it with eventscan and I'm not sure how to use it.
I'm capturing the event correctly from an even trigger in the bar auras, but the arg I receive is nil. Also I'm not sure I'm correctly setting the width.
First group custom growth function:

function(newPositions, activeRegions)
    local totalWidth = math.min(220,(#activeRegions*40))
    local width = math.min((totalWidth / #activeRegions),40)
    
    WeakAuras.ScanEvents("ROTATION_WIDTH_ADJUST",totalWidth)
    
    for i = 1, #activeRegions do
        activeRegions[i].region:SetRegionWidth(width)
        
        newPositions[i] = {
            i*width - totalWidth/2 - width/2, -- x
            0                                 -- y
        }
    end
end

And here's the trigger capturing the event:

function(event,totalWidth)
    print(totalWidth)
    --aura_env.region:SetRegionWidth(totalWidth)
end

At the moment it prints 'nil' three times, so I'm not passing the arg correclty :S

#

Can't I use eventscan from a custom growth func?