-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic resizing of Icons in a dynamic group to fit a fixed size defined for the group #2878
Comments
It took quite some googling, but I finaly found a post on Reddit that suggesting using a custom grow function for the dynamic group. In the grow function one can change the width and/or height of the group's children. The following code reproduces the native "Centered Horizontal" placement and changes the width of the group's icon to perfectly fit 180 px horizontally: -- https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Dynamic-Group#custom-grow
function(newPositions, activeRegions)
local totalWidth = 180
local width = totalWidth / #activeRegions
for i = 1, #activeRegions do
-- Changing only the icon width. I prefer to have constant height,
-- which means that icons may not be square. To keep icons square,
-- add `activeRegions[i].region:SetRegionHeight(width)`
activeRegions[i].region:SetRegionWidth(width)
newPositions[i] = {
i*width - totalWidth/2 - width/2, -- x
0 -- y
}
end
end Here's part of my UI using the custom grow function above. Just so there's no confusion, the picture shows three distinct dynamic groups: one below the player unit frame, and two groups between the player and target frames. |
I dunno if I'll ever have an answer given the late comment, but how could I possibly change the spacing between icons/auras with that code? |
@gollumeo, I can't test right now, but something like this should work:
where X is the desired spacing activeRegions[i].region:SetRegionWidth(width-2)
newPositions[i] = {
i*(width+2) - totalWidth/2 - (width+2)/2, -- x
0 -- y
} |
It works, ty! It asks to change some parameters (like the total width) to actually fit the initial pattern, but that's what I needed! Thanks a lot ♥ |
Duplicate of #4057 |
Is your feature request related to a problem? Please describe.
When adding icons to a dynamic group it is impossible to set a max lenght for the group so that adding icons does not enlarge the group. Since unit frames are in set places on the screen, players usully set their icons between the player and target unitframe. Unfortunately, there is no way to control the size of the dynamic group (depends on talents/spells selected) and thus we end up with not so nice UIs with varying lenght of dynamic groups.
Describe the solution you'd like
When creating a dynamic group, depending on talents choice there can be X icons or X+n icons
Ideally one would like to have all icons in a dynamic group fit a predefined maximum lenght of the dynamic group.
So that adding extra icons to a dynamic group, the lenght of the dynamic group does not change but the size of icons dynamically change to fit the predefined dynamic group lenght.
This makes for visually pleasing UI.
Describe alternatives you've considered
yes, tried using code such as the one used here https://wago.io/kib-dh-hud
But would rather have it done natively by weak aura, especially this would be used by many classes.
The text was updated successfully, but these errors were encountered: