mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-05 13:10:00 +00:00
backdrop api: rework every single frame sizing
This commit breaks alot of compatibility and maybe other things too. The change was necessary, because the old framework ran up against its limits. A lot of new configuration options are now possible and some of them were already added.
This commit is contained in:
+22
-20
@@ -1,4 +1,9 @@
|
||||
pfUI:RegisterModule("panel", function ()
|
||||
local default_border = pfUI_config.appearance.border.default
|
||||
if pfUI_config.appearance.border.panels ~= "-1" then
|
||||
default_border = pfUI_config.appearance.border.panels
|
||||
end
|
||||
|
||||
pfUI.panel = CreateFrame("Frame",nil,UIParent)
|
||||
pfUI.panel:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.panel:RegisterEvent("PLAYER_MONEY")
|
||||
@@ -345,23 +350,22 @@ pfUI:RegisterModule("panel", function ()
|
||||
pfUI.panel.left:SetScale(pfUI.chat.left:GetScale())
|
||||
pfUI.panel.left:SetFrameStrata("HIGH")
|
||||
pfUI.panel.left:ClearAllPoints()
|
||||
pfUI.panel.left:SetHeight(pfUI_config.global.font_size*2)
|
||||
pfUI.panel.left:SetHeight(pfUI_config.global.font_size+default_border*2)
|
||||
pfUI.panel.left:SetPoint("BOTTOMLEFT", pfUI.chat.left, "BOTTOMLEFT", 2, 2)
|
||||
pfUI.panel.left:SetPoint("BOTTOMRIGHT", pfUI.chat.left, "BOTTOMRIGHT", -2, 2)
|
||||
pfUI.panel.left:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.left:SetBackdropColor(0,0,0,.75)
|
||||
pfUI.utils:CreateBackdrop(pfUI.panel.left, default_border, nil, true)
|
||||
|
||||
pfUI.panel.left.hide = CreateFrame("Button", nil, pfUI.panel.left)
|
||||
pfUI.panel.left.hide:ClearAllPoints()
|
||||
pfUI.panel.left.hide:SetWidth(16)
|
||||
pfUI.panel.left.hide:SetWidth(12)
|
||||
pfUI.panel.left.hide:SetHeight(pfUI.panel.left:GetHeight())
|
||||
pfUI.panel.left.hide:SetPoint("LEFT", 0, 0)
|
||||
pfUI.panel.left.hide:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.utils:CreateBackdrop(pfUI.panel.left.hide, default_border)
|
||||
pfUI.panel.left.hide.texture = pfUI.panel.left.hide:CreateTexture("pfPanelLeftHide")
|
||||
pfUI.panel.left.hide.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\left")
|
||||
pfUI.panel.left.hide.texture:ClearAllPoints()
|
||||
pfUI.panel.left.hide.texture:SetPoint("TOPLEFT", pfUI.panel.left.hide, "TOPLEFT", 4, -6)
|
||||
pfUI.panel.left.hide.texture:SetPoint("BOTTOMRIGHT", pfUI.panel.left.hide, "BOTTOMRIGHT", -4, 6)
|
||||
pfUI.panel.left.hide.texture:SetPoint("TOPLEFT", pfUI.panel.left.hide, "TOPLEFT", 2, -4)
|
||||
pfUI.panel.left.hide.texture:SetPoint("BOTTOMRIGHT", pfUI.panel.left.hide, "BOTTOMRIGHT", -2, 4)
|
||||
pfUI.panel.left.hide.texture:SetVertexColor(.25,.25,.25,1)
|
||||
pfUI.panel.left.hide:SetScript("OnClick", function()
|
||||
if pfUI.chat.left:IsShown() then pfUI.chat.left:Hide() else pfUI.chat.left:Show() end
|
||||
@@ -410,23 +414,22 @@ pfUI:RegisterModule("panel", function ()
|
||||
pfUI.panel.right:SetScale(pfUI.chat.right:GetScale())
|
||||
pfUI.panel.right:SetFrameStrata("HIGH")
|
||||
pfUI.panel.right:ClearAllPoints()
|
||||
pfUI.panel.right:SetHeight(pfUI_config.global.font_size*2)
|
||||
pfUI.panel.right:SetHeight(pfUI_config.global.font_size+default_border*2)
|
||||
pfUI.panel.right:SetPoint("BOTTOMLEFT", pfUI.chat.right, "BOTTOMLEFT", 2, 2)
|
||||
pfUI.panel.right:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", -2, 2)
|
||||
pfUI.panel.right:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.right:SetBackdropColor(0,0,0,.75)
|
||||
pfUI.utils:CreateBackdrop(pfUI.panel.right, default_border, nil, true)
|
||||
|
||||
pfUI.panel.right.hide = CreateFrame("Button", nil, pfUI.panel.right)
|
||||
pfUI.panel.right.hide:ClearAllPoints()
|
||||
pfUI.panel.right.hide:SetWidth(16)
|
||||
pfUI.panel.right.hide:SetWidth(12)
|
||||
pfUI.panel.right.hide:SetHeight(pfUI.panel.right:GetHeight())
|
||||
pfUI.panel.right.hide:SetPoint("RIGHT", 0, 0)
|
||||
pfUI.panel.right.hide:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.utils:CreateBackdrop(pfUI.panel.right.hide, default_border)
|
||||
pfUI.panel.right.hide.texture = pfUI.panel.right.hide:CreateTexture("pfPanelRightHide")
|
||||
pfUI.panel.right.hide.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\right")
|
||||
pfUI.panel.right.hide.texture:ClearAllPoints()
|
||||
pfUI.panel.right.hide.texture:SetPoint("TOPLEFT", pfUI.panel.right.hide, "TOPLEFT", 4, -6)
|
||||
pfUI.panel.right.hide.texture:SetPoint("BOTTOMRIGHT", pfUI.panel.right.hide, "BOTTOMRIGHT", -4, 6)
|
||||
pfUI.panel.right.hide.texture:SetPoint("TOPLEFT", pfUI.panel.right.hide, "TOPLEFT", 2, -4)
|
||||
pfUI.panel.right.hide.texture:SetPoint("BOTTOMRIGHT", pfUI.panel.right.hide, "BOTTOMRIGHT", -2, 4)
|
||||
pfUI.panel.right.hide.texture:SetVertexColor(.25,.25,.25,1)
|
||||
pfUI.panel.right.hide:SetScript("OnClick", function()
|
||||
if pfUI.chat.right:IsShown() then pfUI.chat.right:Hide() else pfUI.chat.right:Show() end
|
||||
@@ -472,11 +475,11 @@ pfUI:RegisterModule("panel", function ()
|
||||
pfUI.panel.right.right.text:SetText("[DUMMY]")
|
||||
|
||||
pfUI.panel.minimap = CreateFrame("Button", "pfPanelMinimap", UIParent)
|
||||
pfUI.panel.minimap:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.minimap:SetPoint("TOPRIGHT",UIParent, -5, -7 - Minimap:GetHeight() - 5)
|
||||
pfUI.utils:CreateBackdrop(pfUI.panel.minimap, default_border)
|
||||
pfUI.panel.minimap:SetPoint("TOP", pfUI.minimap, "BOTTOM", 0 , -default_border*3)
|
||||
pfUI.utils:UpdateMovable(pfUI.panel.minimap)
|
||||
pfUI.panel.minimap:SetHeight(pfUI_config.global.font_size * 2)
|
||||
pfUI.panel.minimap:SetWidth(Minimap:GetWidth() + 5)
|
||||
pfUI.panel.minimap:SetHeight(pfUI_config.global.font_size+default_border*2)
|
||||
pfUI.panel.minimap:SetWidth(pfUI.minimap:GetWidth())
|
||||
pfUI.panel.minimap:SetFrameStrata("BACKGROUND")
|
||||
pfUI.panel.minimap.text = pfUI.panel.minimap:CreateFontString("MinimapZoneText", "LOW", "GameFontNormal")
|
||||
pfUI.panel.minimap.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\" .. pfUI_config.global.font_default .. ".ttf", pfUI_config.global.font_size, "OUTLINE")
|
||||
@@ -515,8 +518,7 @@ pfUI:RegisterModule("panel", function ()
|
||||
button.frame:SetScale(1.4)
|
||||
button.frame:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -16)
|
||||
button.frame:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 1)
|
||||
button.frame:SetBackdrop(pfUI.backdrop)
|
||||
button.frame:SetBackdropColor(0,0,0,0)
|
||||
pfUI.utils:CreateBackdrop(button.frame, default_border)
|
||||
button:Show()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user