View Single Post
08-11-18, 04:06 PM   #6
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
No, that table only has entries for certain things. I just nil it out in case that particular one is there (or gets added in the future).

For this case in particular, the code that positions MainMenuBar checks if either it or MicroButtonAnBagsBar IsUserPlaced then that code is skipped. However, ExtraActionBarFrame is in UIPARENT_MANAGED_FRAME_POSITIONS and is handled by a loop that iterates over it's entries. The code called in that loop also checks if ignoreFramePositionManager is set and exits out early.

There is one other case: CastingBarFrame:GetAttribute("ignoreFramePositionManager") so to also handle that you would need:
Code:
local function SetPosition(frame, ...)
    if type(frame) == 'string' then
        frame = _G[frame]
    end
    if type(frame) == 'table' and type(frame.IsObjectType) == 'function' and frame:IsObjectType('Frame') then
        local name = frame:GetName()
        if name then
            UIPARENT_MANAGED_FRAME_POSITIONS[name] = nil
        end
        frame:SetMovable(true)
        frame:SetUserPlaced(true)
        frame:SetDontSavePosition(true)
        frame:SetAttribute('ignoreFramePositionManager', true)
        frame.ignoreFramePositionManager = true
        if ... then
            frame:ClearAllPoints()
            frame:SetPoint(...)
        end
        frame:SetMovable(false)
    end
end
  Reply With Quote