GryllsAddons/ShaguTweaks-mods

Incorrect mouseover right/right 2 bag positioning

Arcose opened this issue · 5 comments

Hello,

Currently, if you have either "Mouseover Right" or "Mouseover Right 2" enabled in the "Advanced Options" menu, you get misaligned bags as shown in the picture below if your bags reach the top of your screen and extend into a new column.

Incorrect Bag Positioning

I believe that the issue is that the below function only sets ContainerFrame1's point, but doesn't take into account the edge case of when a new column for any of the remaining ContainerFrame's is created.

Located in: actionbar-mouseover-bar-right.lua

    local function movebags()
        if ShaguTweaks.MouseoverRight2 then return end
        if MultiBarLeft:IsVisible() then
            ContainerFrame1:ClearAllPoints()
            ContainerFrame1:SetPoint("RIGHT", MultiBarLeft, "LEFT", -5)
        elseif MultiBarRight:IsVisible() then
            ContainerFrame1:ClearAllPoints()
            ContainerFrame1:SetPoint("RIGHT", MultiBarRight, "LEFT", -5)
        end
    end

The updateContainerFrameAnchors function located in ContainerFrame.lua of Blizzard's UI code seems to handle the column creation. I suspect that the section with "--Start a new column" is the culprit that is causing the issue. I'm not very experienced with Lua or WoW addon coding in general, but a simple solution might be to follow the same method they use for calculating columns and set each ContainerFrame's position accordingly.

Thanks for raising this. I can't seem to reproduce this issue by changing the UI scale or resolution. I've changed the code in the right bar mods please could you try to download the addon again and see if the issue still occurs?

After I did a clean install of ShaguTweaks and the new ShaguTweaks-Mods, it seems like the issue is no longer occurring. However, I do notice that after the initial login, the bags are now at the far-right edge of the screen, overlapping both of the multibars if they are enabled. One solution I found for this was replacing hide(bar) with mouseover(bar) in setup(bar) to delay the hiding of the actionbars. By doing this, the bag container is correctly positioned, but the downside is that the actionbars are displayed briefly upon the entering world event.

Just to double check, though, I reinstalled the older version that I had with a fresh download of ShaguTweaks, all other addons disabled, and my WTF folder deleted, but the issue still persisted. I think it's possible that #8 and the movebags function were both contributing to this issue. Really feels like Blizzard has code running somewhere after movebags() is called which sees that the actionbars are hidden and then causes any additional bag columns to be in their default no actionbar position. It's still strange, why the issue couldn't be replicated.

Another thing I did notice is that the problem only exists on login and that after a /rl or opening the interface and clicking okay to exit, the issue resolved itself on both the new and old versions.

Also, I tested commenting out the updateContainerFrameAnchors() calls that were added and they didn't seem to cause any changes, unfortunately.

Edit: It appears that the issue of the bags going to the far-right edge of the screen also occurs when a quest is accepted, abandoned, untracked, or tracked and that my suggested solution does not solve this.

Edit 2: Okay, I now believe that the quest tracker is what's causing the problem. It seems that when either of the right actionbars is hidden and the quest tracker is open/updated, it updates its position and the position of the bags to their rightmost possible position as if the actionbars are completely turned off.

Thank you for your extensive testing! I've tried to use your solution by creating a timer to hide the bars after 1 second when you login, allowing the UI to move the bars itself. I can't seem to duplicate the issue unfortunately in my testing playing around with the quest log and the solution implemented appears to work on my client but please let me know if you encounter any further issues.

Okay, I think I finally figured out what's causing this. Was looking at Blizzard's UI code some more and saw that in their reputation bar code they were calling UIParent_ManageFramePositions() before calling updateContainerFrameAnchors(), and I also checked and saw that their QuestWatch_Update() function also calls UIParent_ManageFramePositions(). I tested it, and with the following implementation, the bags on my client dynamically move based on whether any of the right actionbars are showing or not.

local function hide(bar)
    bar:Hide()
    UIParent_ManageFramePositions()
end

local function show(bar)
    bar:Show()
    UIParent_ManageFramePositions()
end

And with this implementation, you could also go back to using hide(bar) in setup(bar) instead of mouseover(bar), and everything still works perfectly. However, I'll leave that decision up to you depending on what you feel is best.

Thank you again it looks like your proposed solution works great to dynamically adjust the bags! I've added it into the code now so hopefully we can put this issue to rest.