mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-19 19:10:49 +00:00
skin: detect off-frame backdrop positions
This commit is contained in:
+12
-2
@@ -5,12 +5,22 @@ pfUI:RegisterModule("skin", function ()
|
|||||||
local left = UIParent.left
|
local left = UIParent.left
|
||||||
local center = UIParent.center
|
local center = UIParent.center
|
||||||
|
|
||||||
|
-- detect outer frame backdrops
|
||||||
|
if left and not left.rightObj then
|
||||||
|
left.rightObj = left.backdrop or left
|
||||||
|
for _, frame in pairs({left:GetChildren()}) do
|
||||||
|
if frame.backdrop and frame.backdrop.GetRight and frame.backdrop:GetRight() > left.rightObj:GetRight() then
|
||||||
|
left.rightObj = frame.backdrop
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- reset anchors
|
-- reset anchors
|
||||||
if not left or not left:IsShown() or not center or not center:IsShown() then
|
if not left or not left:IsShown() or not center or not center:IsShown() then
|
||||||
UIParent.pfLeftAligned = nil
|
UIParent.pfLeftAligned = nil
|
||||||
return
|
return
|
||||||
elseif center and center:IsShown() and left and left:IsShown() then
|
elseif center and center:IsShown() and left and left:IsShown() then
|
||||||
local width = left.backdrop and left.backdrop:GetRight() or left:GetRight()
|
local width = left.rightObj:GetRight()
|
||||||
if width ~= UIParent.pfLeftAligned then
|
if width ~= UIParent.pfLeftAligned then
|
||||||
center:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", width + 10, -104)
|
center:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", width + 10, -104)
|
||||||
UIParent.pfLeftAligned = width
|
UIParent.pfLeftAligned = width
|
||||||
@@ -19,7 +29,7 @@ pfUI:RegisterModule("skin", function ()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- durability frame
|
-- durability frame
|
||||||
pfUI.durability = CreateFrame("Frame","pfDurability",UIParent)
|
pfUI.durability = CreateFrame("Frame", "pfDurability", UIParent)
|
||||||
if pfUI.minimap then
|
if pfUI.minimap then
|
||||||
pfUI.durability:SetPoint("TOPLEFT", pfUI.minimap, "BOTTOMLEFT", 0, -35)
|
pfUI.durability:SetPoint("TOPLEFT", pfUI.minimap, "BOTTOMLEFT", 0, -35)
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user