mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-19 02:50:50 +00:00
skin: auto adjust UIPanel sizes accordingly
This commit is contained in:
@@ -1,4 +1,22 @@
|
||||
pfUI:RegisterModule("skin", function ()
|
||||
-- align UIParent panels
|
||||
pfUI.panelalign = CreateFrame("Frame", "pfUIParentPanelAlign", UIParent)
|
||||
pfUI.panelalign:SetScript("OnUpdate", function()
|
||||
local left = UIParent.left
|
||||
local center = UIParent.center
|
||||
|
||||
-- reset anchors
|
||||
if not left or not left:IsShown() or not center or not center:IsShown() then
|
||||
UIParent.pfLeftAligned = nil
|
||||
return
|
||||
elseif center and center:IsShown() and left and left:IsShown() then
|
||||
local width = left.backdrop and left.backdrop:GetRight() or left:GetRight()
|
||||
if width ~= UIParent.pfLeftAligned then
|
||||
center:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", width + 10, -104)
|
||||
UIParent.pfLeftAligned = width
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- durability frame
|
||||
pfUI.durability = CreateFrame("Frame","pfDurability",UIParent)
|
||||
|
||||
Reference in New Issue
Block a user