From e2152a0326ed5ec21d767bc11b506913f8db69f6 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 3 May 2020 13:38:46 +0200 Subject: [PATCH] nameplates: add option to show health in percent --- api/config.lua | 1 + modules/gui.lua | 1 + modules/nameplates.lua | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/config.lua b/api/config.lua index 0c7d7901..a2e97dfc 100644 --- a/api/config.lua +++ b/api/config.lua @@ -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") diff --git a/modules/gui.lua b/modules/gui.lua index 0bd8e0f4..b1a98c7d 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -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") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index b1087093..f42e2087 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -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))