unitframes: add option for vertical health bars

This commit is contained in:
stokbaek
2017-12-05 21:01:54 +01:00
committed by Shagu
parent b9dcfe8814
commit 03eb6a737c
12 changed files with 55 additions and 6 deletions
+10
View File
@@ -425,6 +425,7 @@ pfUI:RegisterModule("gui", function ()
"off:" .. T["Disabled"]
}
pfUI.gui.dropdowns.uf_layout = {
"default:" .. T["Default"],
"tukui:TukUI"
@@ -733,6 +734,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.player, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.player, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.player, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.player, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.player, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.player, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.player, "clickcast", "checkbox")
@@ -776,6 +778,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.target, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.target, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.target, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.target, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.target, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.target, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.target, "clickcast", "checkbox")
@@ -818,6 +821,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.ttarget, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.ttarget, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.ttarget, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.ttarget, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.ttarget, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.ttarget, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.ttarget, "clickcast", "checkbox")
@@ -860,6 +864,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.pet, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.pet, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.pet, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.pet, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.pet, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.pet, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.pet, "clickcast", "checkbox")
@@ -902,6 +907,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.focus, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.focus, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.focus, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.focus, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.focus, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.focus, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.focus, "clickcast", "checkbox")
@@ -970,6 +976,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.raid, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.raid, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.raid, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.raid, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.raid, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.raid, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.raid, "clickcast", "checkbox")
@@ -1012,6 +1019,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.group, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.group, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.group, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.group, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.group, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.group, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.group, "clickcast", "checkbox")
@@ -1054,6 +1062,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.grouptarget, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.grouptarget, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.grouptarget, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.grouptarget, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.grouptarget, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.grouptarget, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.grouptarget, "clickcast", "checkbox")
@@ -1096,6 +1105,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Debuff Limit"], C.unitframes.grouppet, "debufflimit")
CreateConfig(this, T["Debuffs Per Row"], C.unitframes.grouppet, "debuffperrow")
CreateConfig(this, T["Invert Health Bar"], C.unitframes.grouppet, "invert_healthbar", "checkbox")
CreateConfig(this, T["Enable Vertical Health Bar"], C.unitframes.grouppet, "verticalbar", "checkbox")
CreateConfig(this, T["Enable Buff Indicators"], C.unitframes.grouppet, "buff_indicator", "checkbox")
CreateConfig(this, T["Enable Debuff Indicators"], C.unitframes.grouppet, "debuff_indicator", "checkbox")
CreateConfig(this, T["Enable Clickcast"], C.unitframes.grouppet, "clickcast", "checkbox")
+24 -6
View File
@@ -624,14 +624,32 @@ pfUI:RegisterModule("thirdparty", function ()
if healthWidth + incWidth > width * (1+(OVERHEALPERCENT/100)) then
incWidth = width * (1+OVERHEALPERCENT/100) - healthWidth
end
frame.incHeal:ClearAllPoints()
frame.incHeal:SetPoint("TOPLEFT", frame.hp.bar, "TOPLEFT", 0, 0)
if frame.config.invert_healthbar == "1" then
frame.incHeal:SetWidth(incWidth)
frame.incHeal:SetFrameStrata("HIGH")
else
local height = frame.hp.bar:GetHeight() / frame.hp.bar:GetEffectiveScale()
local healthHeight = height * (health / maxHealth)
local incHeight = height * healed / maxHealth
if healthHeight + incHeight > height * (1+(OVERHEALPERCENT/100)) then
incHeight = height * (1+OVERHEALPERCENT/100) - healthHeight
end
frame.incHeal:ClearAllPoints()
if frame.config.verticalbar == "0" then
frame.incHeal:SetPoint("TOPLEFT", frame.hp.bar, "TOPLEFT", 0, 0)
frame.incHeal:SetWidth(incWidth + healthWidth)
else
frame.incHeal:SetPoint("BOTTOM", frame.hp.bar, "BOTTOM", 0, 0)
frame.incHeal:SetWidth(width)
frame.incHeal:SetHeight(incHeight + healthHeight)
end
if frame.config.invert_healthbar == "1" then
if frame.config.verticalbar == "0" then
frame.incHeal:SetWidth(incWidth)
frame.incHeal:SetFrameStrata("HIGH")
else
frame.incHeal:SetHeight(incHeight)
frame.incHeal:SetFrameStrata("HIGH")
end
else
frame.incHeal:SetFrameStrata("BACKGROUND")
end
else