Skip to content
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

Improved Anchor System #5662

Open
Causese opened this issue Feb 11, 2025 · 1 comment
Open

Improved Anchor System #5662

Causese opened this issue Feb 11, 2025 · 1 comment
Labels
🎨 Feature Request This is a request for a new feature, or an expansion of an existing feature.

Comments

@Causese
Copy link
Contributor

Causese commented Feb 11, 2025

Is your feature request related to a problem? Please describe.

  1. Currently the setting's of the frame that the users anchors to are not inherited without using code. (grow direction, limit, etc)
  2. It also requires the anchor source (main pack) to specify 0,0 coordinates, which causes all WAs to be in the center of the screen by default.
    This is a problem for users who want to opt out of Anchor auras.
  3. The frame that should be anchored to is also currently specified by name, causing issues when users rename the destination frame.

Describe the solution you'd like

  1. Problem
  • Ideally the system would respect the settings of the group that it is anchored to without requiring user code. (grow etc)
  1. Problem
  • The original aura's x/y coordinates should be ignored when an Anchor Aura (destination frame) is found.
    This allows WA creators to specify default positions instead of being forced to set x/y coordinates in the original pack to 0,0.
    Main concern here is that there are users who are lazy / not interested in dealing with anchor auras and want things to not be in the center of their screen by default.
  1. Problem
  • Ideally the user can specify an Anchor ID

Benefits:

  • renaming anchor aura is no longer an issue (frame reference)
  • can technically have multiple anchor auras with same ID that have a "load only on char x" load condition in case people want to position them in different spots based on which character they use atm.

Describe alternatives you've considered

/

Additional context

Anchor Auras became popular because they allow you to specify a permanent spot for your WAs (dungeon, raid, ..) that is unaffected by updates.

Benefits of Anchor Auras

  • No need to untick position related toggles when updating the main pack
  • No need to specify an initial position for future dungeon / raid packs.
  • Forgetting to untick position related settings on import is not punished
  • Anchor Auras don't require deep nesting so moving things around is a lot easier, especially when auras that need to be positioned are scattered among many sub groups.

For dynamic groups it currently requires code similar to this:

function(pos, reg)
    aura_env.anchorData = aura_env.anchorData or WeakAuras.GetData("Dynamic Icon Anchor")
    if aura_env.anchorData then
        local anchorData = aura_env.anchorData
        local direction = anchorData.grow == "RIGHT" and 1 or -1
        local space = anchorData.space
        local offset = 0
        local max = anchorData.limit
        max = #reg <= max and #reg or max
        for i =1, max do
            pos[i] = {
                offset,
                0,
            }
            offset = offset+((reg[i].region.width+space)*direction)
        end
    else
        local xoffset = 0  
        for i =1, #reg do
            pos[i] = {
                xoffset,
                0,
            }
            xoffset = xoffset+reg[i].region.width-1
        end
    end
end

Anchor aura group structure (Reloe):

Original Aura structure (Reloe):

@Causese Causese added the 🎨 Feature Request This is a request for a new feature, or an expansion of an existing feature. label Feb 11, 2025
@mrbuds
Copy link
Contributor

mrbuds commented Feb 12, 2025

I don't think stuffing more functions to anchors is the way, i'd rather see a proper (cascading?) styling system capable of inheriting any property from a chosen model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 Feature Request This is a request for a new feature, or an expansion of an existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants