panel: make panels movable

This commit is contained in:
shagu
2018-06-24 21:44:34 +02:00
parent 193ede50ed
commit 72ea6ba7bb
2 changed files with 16 additions and 14 deletions
+15 -13
View File
@@ -341,7 +341,7 @@ pfUI:RegisterModule("panel", function()
-- Update "durability" -- Update "durability"
local itemLines = {} local itemLines = {}
local slotnames = { "Head", "Shoulder", "Chest", "Wrist", local slotnames = { "Head", "Shoulder", "Chest", "Wrist",
"Hands", "Waist", "Legs", "Feet", "MainHand", "SecondaryHand", "Ranged", } "Hands", "Waist", "Legs", "Feet", "MainHand", "SecondaryHand", "Ranged", }
local totalRep = 0 local totalRep = 0
local repairToolTip = CreateFrame('GameTooltip', "repairToolTip", this, "GameTooltipTemplate") local repairToolTip = CreateFrame('GameTooltip', "repairToolTip", this, "GameTooltipTemplate")
function pfUI.panel:UpdateRepair() function pfUI.panel:UpdateRepair()
@@ -381,7 +381,7 @@ pfUI:RegisterModule("panel", function()
end end
end end
repairToolTip:Hide() repairToolTip:Hide()
local tooltip = function() local tooltip = function()
if totalRep > 0 then if totalRep > 0 then
GameTooltip:ClearLines() GameTooltip:ClearLines()
@@ -392,7 +392,7 @@ pfUI:RegisterModule("panel", function()
GameTooltip:AddDoubleLine(line[1],line[2]) GameTooltip:AddDoubleLine(line[1],line[2])
end end
GameTooltip:Show() GameTooltip:Show()
end end
end end
local click = function() local click = function()
@@ -510,17 +510,18 @@ pfUI:RegisterModule("panel", function()
if pfUI.chat then if pfUI.chat then
pfUI.panel.left:SetScale(pfUI.chat.left:GetScale()) pfUI.panel.left:SetScale(pfUI.chat.left:GetScale())
pfUI.panel.left:SetPoint("BOTTOMLEFT", pfUI.chat.left, "BOTTOMLEFT", 2, 2) pfUI.panel.left:SetWidth(tonumber(C.chat.left.width) - 4)
pfUI.panel.left:SetPoint("BOTTOMRIGHT", pfUI.chat.left, "BOTTOMRIGHT", -2, 2) pfUI.panel.left:SetPoint("BOTTOM", pfUI.chat.left, "BOTTOM", 0, 2)
else else
pfUI.panel.left:SetWidth(C.chat.left.width) pfUI.panel.left:SetWidth(C.chat.left.width)
pfUI.panel.left:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 5, 5) pfUI.panel.left:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 5, 5)
end end
UpdateMovable(pfUI.panel.left) pfUI.panel.left:SetFrameStrata("DIALOG")
pfUI.panel.left:SetHeight(C.global.font_size+default_border*2) pfUI.panel.left:SetHeight(C.global.font_size+default_border*2)
CreateBackdrop(pfUI.panel.left, default_border, nil) CreateBackdrop(pfUI.panel.left, default_border, nil)
UpdateMovable(pfUI.panel.left)
pfUI.panel.left.hide = CreateFrame("Button", nil, pfUI.panel.left) pfUI.panel.left.hide = CreateFrame("Button", nil, pfUI.panel.left)
pfUI.panel.left.hide:SetFrameLevel(0) pfUI.panel.left.hide:SetFrameLevel(0)
@@ -582,18 +583,19 @@ pfUI:RegisterModule("panel", function()
pfUI.panel.right:SetFrameStrata("FULLSCREEN") pfUI.panel.right:SetFrameStrata("FULLSCREEN")
pfUI.panel.right:ClearAllPoints() pfUI.panel.right:ClearAllPoints()
if pfUI.chat then if pfUI.chat then
pfUI.panel.right:SetScale(pfUI.chat.left:GetScale()) pfUI.panel.right:SetScale(pfUI.chat.right:GetScale())
pfUI.panel.right:SetPoint("BOTTOMLEFT", pfUI.chat.right, "BOTTOMLEFT", 2, 2) pfUI.panel.right:SetWidth(tonumber(C.chat.right.width) - 4)
pfUI.panel.right:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", -2, 2) pfUI.panel.right:SetPoint("BOTTOM", pfUI.chat.right, "BOTTOM", 0, 2)
else else
pfUI.panel.right:SetWidth(C.chat.right.width) pfUI.panel.right:SetWidth(C.chat.right.width)
pfUI.panel.right:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5) pfUI.panel.right:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5)
end end
UpdateMovable(pfUI.panel.right) pfUI.panel.right:SetFrameStrata("DIALOG")
pfUI.panel.right:SetHeight(C.global.font_size+default_border*2) pfUI.panel.right:SetHeight(C.global.font_size+default_border*2)
CreateBackdrop(pfUI.panel.right, default_border, nil) CreateBackdrop(pfUI.panel.right, default_border, nil)
UpdateMovable(pfUI.panel.right)
pfUI.panel.right.hide = CreateFrame("Button", nil, pfUI.panel.right) pfUI.panel.right.hide = CreateFrame("Button", nil, pfUI.panel.right)
pfUI.panel.right.hide:SetFrameLevel(0) pfUI.panel.right.hide:SetFrameLevel(0)
@@ -723,4 +725,4 @@ pfUI:RegisterModule("panel", function()
CreateAutohide(pfUI.panel.microbutton) CreateAutohide(pfUI.panel.microbutton)
end end
end) end)
end) end)
+1 -1
View File
@@ -2,7 +2,7 @@
## Title: |cff33ffccpf|cffffffffUI ## Title: |cff33ffccpf|cffffffffUI
## Author: Shagu ## Author: Shagu
## Notes: A complete user interface replacement. ## Notes: A complete user interface replacement.
## Version: 3.10.0 ## Version: 3.11.0
## SavedVariables: pfUI_profiles, pfUI_gold ## SavedVariables: pfUI_profiles, pfUI_gold
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB