castbar: add options for width and height

This commit is contained in:
shagu
2019-04-04 21:46:40 +02:00
parent d41cf181b6
commit e52b08ecb8
11 changed files with 72 additions and 22 deletions
+18 -4
View File
@@ -149,13 +149,21 @@ pfUI:RegisterModule("castbar", function ()
if C.castbar.player.hide_pfui == "0" then
pfUI.castbar.player = CreateCastbar("pfPlayerCastbar", UIParent, "player")
local width = C.castbar.player.width ~= "0" and C.castbar.player.width
if pfUI.uf.player then
local pspace = tonumber(C.unitframes.player.pspace)
local width = C.castbar.player.width ~= "-1" and C.castbar.player.width or pfUI.uf.player:GetWidth()
pfUI.castbar.player:SetPoint("TOPLEFT", pfUI.uf.player, "BOTTOMLEFT", 0, -default_border * 2 - pspace)
pfUI.castbar.player:SetWidth(pfUI.uf.player:GetWidth())
pfUI.castbar.player:SetWidth(width)
else
local width = C.castbar.player.width ~= "-1" and C.castbar.player.width or 200
pfUI.castbar.player:SetPoint("CENTER", 0, -200)
pfUI.castbar.player:SetWidth(200)
pfUI.castbar.player:SetWidth(width)
end
if C.castbar.player.height ~= "-1" then
pfUI.castbar.player:SetHeight(C.castbar.player.height)
end
UpdateMovable(pfUI.castbar.player)
@@ -167,11 +175,17 @@ pfUI:RegisterModule("castbar", function ()
if pfUI.uf.target then
local pspace = tonumber(C.unitframes.target.pspace)
local width = C.castbar.target.width ~= "-1" and C.castbar.target.width or pfUI.uf.target:GetWidth()
pfUI.castbar.target:SetPoint("TOPLEFT", pfUI.uf.target, "BOTTOMLEFT", 0, -default_border * 2 - pspace)
pfUI.castbar.target:SetWidth(pfUI.uf.target:GetWidth())
pfUI.castbar.target:SetWidth(width)
else
local width = C.castbar.target.width ~= "-1" and C.castbar.target.width or 200
pfUI.castbar.target:SetPoint("CENTER", 0, -225)
pfUI.castbar.target:SetWidth(200)
pfUI.castbar.target:SetWidth(width)
end
if C.castbar.target.height ~= "-1" then
pfUI.castbar.target:SetHeight(C.castbar.target.height)
end
UpdateMovable(pfUI.castbar.target)
+10 -2
View File
@@ -1759,8 +1759,16 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, T["Casting Color"], C.appearance.castbar, "castbarcolor", "color")
CreateConfig(nil, T["Channeling Color"], C.appearance.castbar, "channelcolor", "color")
CreateConfig(nil, T["Disable Blizzard Castbar"], C.castbar.player, "hide_blizz", "checkbox")
CreateConfig(nil, T["Disable pfUI Player Castbar"], C.castbar.player, "hide_pfui", "checkbox")
CreateConfig(nil, T["Disable pfUI Target Castbar"], C.castbar.target, "hide_pfui", "checkbox")
CreateConfig(nil, T["Player Castbar"], nil, nil, "header")
CreateConfig(nil, T["Castbar Width"], C.castbar.player, "width")
CreateConfig(nil, T["Castbar Height"], C.castbar.player, "height")
CreateConfig(nil, T["Disable Player Castbar"], C.castbar.player, "hide_pfui", "checkbox")
CreateConfig(nil, T["Target Castbar"], nil, nil, "header")
CreateConfig(nil, T["Castbar Width"], C.castbar.target, "width")
CreateConfig(nil, T["Castbar Height"], C.castbar.target, "height")
CreateConfig(nil, T["Disable Target Castbar"], C.castbar.target, "hide_pfui", "checkbox")
end)
CreateGUIEntry(T["Chat"], nil, function()