mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-01 03:19:59 +00:00
nameplates: add option to show health in percent
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user