From 7c012be822a0686f59086b2b1673e6e85559b79b Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 11 Apr 2020 16:32:07 +0200 Subject: [PATCH] nameplates: use libhealth values if existing --- modules/nameplates.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index ea147128..e77bc2ad 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -387,7 +387,11 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () plate.health:SetValue(hp) if C.nameplates.showhp == "1" then - plate.health.text:SetText(string.format("%s / %s", hp, hpmax)) + local realhp, realhpmax + if pfUI.libhealth and pfUI.libhealth.enabled then + realhp, realhpmax = pfUI.libhealth:GetDBHealth(name .. ":" .. level) + end + plate.health.text:SetText(string.format("%s / %s", realhp and ceil(realhp*hp) or hp, realhpmax or hpmax)) else plate.health.text:SetText() end