From 564ec6e8c55bcf8deb75c7160c3758e5fcaac61c Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 2 Jun 2018 11:09:23 +0200 Subject: [PATCH] castbar: add options to hide player and target bar --- modules/castbar.lua | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/modules/castbar.lua b/modules/castbar.lua index 7bc6cd5a..b07fc04c 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -124,26 +124,30 @@ pfUI:RegisterModule("castbar", function () end -- [[ pfPlayerCastbar ]] -- - pfUI.castbar.player = CreateCastbar("pfPlayerCastbar", UIParent, "player") + if C.castbar.player.hide_pfui == "0" then + pfUI.castbar.player = CreateCastbar("pfPlayerCastbar", UIParent, "player") - if pfUI.uf.player then - local pspace = tonumber(C.unitframes.player.pspace) - pfUI.castbar.player:SetPoint("TOPLEFT", pfUI.uf.player, "BOTTOMLEFT", 0, -default_border * 2 - pspace) - pfUI.castbar.player:SetWidth(pfUI.uf.player:GetWidth()) - else - pfUI.castbar.player:SetPoint("CENTER", 0, -200) - pfUI.castbar.player:SetWidth(200) + if pfUI.uf.player then + local pspace = tonumber(C.unitframes.player.pspace) + pfUI.castbar.player:SetPoint("TOPLEFT", pfUI.uf.player, "BOTTOMLEFT", 0, -default_border * 2 - pspace) + pfUI.castbar.player:SetWidth(pfUI.uf.player:GetWidth()) + else + pfUI.castbar.player:SetPoint("CENTER", 0, -200) + pfUI.castbar.player:SetWidth(200) + end end -- [[ pfTargetCastbar ]] -- - pfUI.castbar.target = CreateCastbar("pfTargetCastbar", UIParent, "target") + if C.castbar.target.hide_pfui == "0" then + pfUI.castbar.target = CreateCastbar("pfTargetCastbar", UIParent, "target") - if pfUI.uf.target then - local pspace = tonumber(C.unitframes.target.pspace) - pfUI.castbar.target:SetPoint("TOPLEFT", pfUI.uf.target, "BOTTOMLEFT", 0, -default_border * 2 - pspace) - pfUI.castbar.target:SetWidth(pfUI.uf.target:GetWidth()) - else - pfUI.castbar.target:SetPoint("CENTER", 0, -225) - pfUI.castbar.target:SetWidth(200) + if pfUI.uf.target then + local pspace = tonumber(C.unitframes.target.pspace) + pfUI.castbar.target:SetPoint("TOPLEFT", pfUI.uf.target, "BOTTOMLEFT", 0, -default_border * 2 - pspace) + pfUI.castbar.target:SetWidth(pfUI.uf.target:GetWidth()) + else + pfUI.castbar.target:SetPoint("CENTER", 0, -225) + pfUI.castbar.target:SetWidth(200) + end end end)