Skip to content

Commit

Permalink
Set a fixed frame strata where required
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Nov 18, 2020
1 parent a2d9222 commit f8bea9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Borders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -952,10 +952,12 @@ end

do
local inc = 0
local backgroundFrame = CreateFrame("Frame") -- HybridMinimap compat
local backgroundFrame = CreateFrame("Frame") -- HybridMinimap support
backgroundFrame:SetParent(Minimap)
backgroundFrame:SetFrameStrata("BACKGROUND")
backgroundFrame:SetFrameLevel(1)
backgroundFrame:SetFixedFrameStrata(true)
backgroundFrame:SetFixedFrameLevel(true)
backgroundFrame:Show()
function mod:CreateBorderFromParams(t)
inc = inc + 1
Expand Down
23 changes: 12 additions & 11 deletions SexyMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -422,21 +422,22 @@ function mod:PLAYER_LOGIN()
mod.PLAYER_LOGIN = nil
end

Minimap:SetParent(UIParent)
-- Undo the damage caused by automagic fuckery when a frame changes parent
-- In other words, restore the minimap defaults to what they were, when it was parented to MinimapCluster
Minimap:SetFrameStrata("LOW") -- Blizz Defaults patch 9.0.1 Minimap.xml
Minimap:SetFrameLevel(1)
if mod.frame.GetFrameStrata(Minimap) ~= "LOW" then
mod.frame.SetFrameStrata(Minimap, "LOW") -- Blizz Defaults patch 9.0.1 Minimap.xml
end
if mod.frame.GetFrameLevel(Minimap) ~= 2 then
mod.frame.SetFrameLevel(Minimap, 2) -- Blizz Defaults patch 9.0.1 Minimap.xml
end

-- Prevent the damage caused by automagic fuckery when a frame changes parent by locking the strata/level in place
mod.frame.SetFixedFrameStrata(Minimap, true)
mod.frame.SetFixedFrameLevel(Minimap, true)
mod.frame.SetParent(Minimap, UIParent)

-- Make sure the various minimap buttons follow the minimap
-- We do this before login to prevent button placement issues
MinimapBackdrop:ClearAllPoints()
MinimapBackdrop:SetPoint("CENTER", Minimap, "CENTER", -8, -23)
-- This should never run as we should always load before it... unless someone force loads it early
-- If they did, the strata/level would also mess up from changing Minimap parent, so we restore it
if HybridMinimap then
HybridMinimap:SetFrameStrata("BACKGROUND") -- Blizz Defaults patch 9.0.1 Blizzard_HybridMinimap.xml
HybridMinimap:SetFrameLevel(100)
end

function mod:SetupMap()
local Minimap = Minimap
Expand Down

0 comments on commit f8bea9b

Please sign in to comment.