WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Error: "SetPoint would result in anchor family connection" (https://www.wowinterface.com/forums/showthread.php?t=57297)

LudiusMaximus 07-18-19 08:37 AM

Error: "SetPoint would result in anchor family connection"
 
When I do

Code:

_G.FramerateLabel:ClearAllPoints()
_G.FramerateLabel:SetPoint("TOPLEFT", "UIParent", "TOPLEFT")

I get (since 8.2) the following error:

Message: Interface\FrameXML\UIParent.lua:2356: Action[SetPoint] failed because[SetPoint would result in anchor family connection]: attempted from: FramerateLabel:SetPoint

But the effect is exactly what I want: FramerateLabel moves to the top left corner of UIParent.

So what is the meaning of this error?
And is there a way to achieve what I want without causing an error?

Fizzlemizz 07-18-19 10:39 AM

I think this frame is anchored to the WorldFrame by Blizzard but in their "management" code they don't use a ClearAllPoints() so it runs up against the change made in 8.2.

Try Anchoring it to WorldFrame so it's kept "all in the family".

LudiusMaximus 07-22-19 04:33 PM

Perfect help! Thanks a lot!

Nimhfree 07-22-19 07:57 PM

You're lucky...my code however raises an error when I do something like pop through a portal:
Code:

                --        Move the buffs somewhere convenient
                f=BuffFrame
                f:SetMovable(1)
                f:SetUserPlaced(true)
                f:SetScale(.8)
                f:ClearAllPoints()
                f:SetPoint("TOPRIGHT",WorldFrame,"BOTTOMRIGHT",-290,-4)

Code:

66x FrameXML\UIParent.lua:2203: Action[SetPoint] failed because[SetPoint would result in anchor family connection]: attempted from: BuffFrame:SetPoint.
[C]: in function `SetPoint'
FrameXML\UIParent.lua:2203: in function `UIParent_UpdateTopFramePositions'
FrameXML\PlayerFrame.lua:316: in function `PlayerFrame_ResetPosition'
FrameXML\PlayerFrame.lua:200: in function `OnEvent'
FrameXML\UnitFrame.lua:933: in function <FrameXML\UnitFrame.lua:931>


Fizzlemizz 07-22-19 08:09 PM

Isn't BuffFrame anchored to UIParent?

Edit:
Code:

function UIParent_UpdateTopFramePositions()
        local topOffset = 0;
        local buffsAreaTopOffset = 0;

        if (OrderHallCommandBar and OrderHallCommandBar:IsShown()) then
                topOffset = 12;
                buffsAreaTopOffset = OrderHallCommandBar:GetHeight();
        end

        if (PlayerFrame and not PlayerFrame:IsUserPlaced() and not PlayerFrame_IsAnimatedOut(PlayerFrame)) then
                PlayerFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -19, -4 - topOffset)
        end

        if (TargetFrame and not TargetFrame:IsUserPlaced()) then
                TargetFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 250, -4 - topOffset);
        end

        local ticketStatusFrameShown = TicketStatusFrame and TicketStatusFrame:IsShown();
        local gmChatStatusFrameShown = GMChatStatusFrame and GMChatStatusFrame:IsShown();
        if (ticketStatusFrameShown) then
                TicketStatusFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -180, 0 - buffsAreaTopOffset);
                buffsAreaTopOffset = buffsAreaTopOffset + TicketStatusFrame:GetHeight();
        end
        if (gmChatStatusFrameShown) then
                GMChatStatusFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -170, -5 - buffsAreaTopOffset);
                buffsAreaTopOffset = buffsAreaTopOffset + GMChatStatusFrame:GetHeight() + 5;
        end
        if (not ticketStatusFrameShown and not gmChatStatusFrameShown) then
                buffsAreaTopOffset = buffsAreaTopOffset + 13;
        end

        BuffFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -205, 0 - buffsAreaTopOffset);
end



All times are GMT -6. The time now is 02:31 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI