nameplates: add option to show health in percent

This commit is contained in:
shagu
2020-05-03 13:38:46 +02:00
parent 0f18715fab
commit e2152a0326
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -628,6 +628,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "totems", "1")
pfUI:UpdateConfig("nameplates", nil, "showhp", "0")
pfUI:UpdateConfig("nameplates", nil, "alwaysperc", "0")
pfUI:UpdateConfig("nameplates", nil, "vpos", "-10")
pfUI:UpdateConfig("nameplates", nil, "width", "120")
pfUI:UpdateConfig("nameplates", nil, "debuffsize", "14")
+1
View File
@@ -2043,6 +2043,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["nameplates"], T["Hide Critters"], C.nameplates, "critters", "checkbox")
CreateConfig(U["nameplates"], T["Hide Totems"], C.nameplates, "totems", "checkbox")
CreateConfig(U["nameplates"], T["Show Health Points"], C.nameplates, "showhp", "checkbox")
CreateConfig(U["nameplates"], T["Always Show Health In Percent"], C.nameplates, "alwaysperc", "checkbox")
CreateConfig(U["nameplates"], T["Nameplate Width"], C.nameplates, "width")
CreateConfig(U["nameplates"], T["Healthbar Height"], C.nameplates, "heighthealth")
CreateConfig(U["nameplates"], T["Castbar Height"], C.nameplates, "heightcast")
+1 -1
View File
@@ -401,7 +401,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
rhp, rhpmax, estimated = pfUI.libhealth:GetUnitHealthByName(name,level,tonumber(hp),tonumber(hpmax))
end
if estimated or hpmax > 100 then
if C.nameplates.alwaysperc == "0" and ( estimated or hpmax > 100 ) then
plate.health.text:SetText(string.format("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax)))
else
plate.health.text:SetText(string.format("%s%%", hp))