From c38a55a89e830974631aac07fb6697f2628a2dd1 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 13 Dec 2021 02:43:57 +0100 Subject: [PATCH] unitframes: add new unitstring for raidframes --- api/unitframes.lua | 9 +++++++++ modules/gui.lua | 1 + 2 files changed, 10 insertions(+) diff --git a/api/unitframes.lua b/api/unitframes.lua index e6263331..6a6a1283 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -2362,6 +2362,15 @@ function pfUI.uf:GetStatusValue(unit, pos) else return unit:GetColor("health") .. pfUI.api.Abbreviate(health) end + elseif config == "namehealthbreak" then + local health = ceil(rhp - rhpmax) + if UnitIsDead(unitstr) then + return unit:GetColor("health") .. DEAD + elseif health == 0 then + return unit:GetColor("unit") .. UnitName(unitstr) + else + return unit:GetColor("unit") .. UnitName(unitstr) .. "\n" .. unit:GetColor("health") .. pfUI.api.Abbreviate(-health) + end elseif config == "shortnamehealth" then local health = ceil(rhp - rhpmax) if UnitIsDead(unitstr) then diff --git a/modules/gui.lua b/modules/gui.lua index 39e8e62a..f4476fe6 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1030,6 +1030,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () "level:" .. T["Level"], "class:" .. T["Class"], "namehealth:" .. T["Name | Health Missing"], + "namehealthbreak:" .. T["Name (Linebreak) -Health Missing"], "shortnamehealth:" .. T["Name (Short) | Health Missing"], "healthdyn:" .. T["Health - Auto"], "health:" .. T["Health - Current"],