Код:
local PostUpdateHealthBar = function(health, unit, min, max)
if not UnitIsConnected(unit) or UnitIsGhost(unit) or UnitIsDead(unit) then
if not UnitIsConnected(unit) then
health.value:SetText("|cffD7BEA5".."Offline".."|r")
elseif UnitIsDead(unit) then
health.value:SetText("|cffD7BEA5".."Dead".."|r")
elseif UnitIsGhost(unit) then
health.value:SetText("|cffD7BEA5".."Ghost".."|r")
end
else
local r, g, b
if min ~= max then
r, g, b = oUF.ColorGradient(min/max, 1, 1, 1, 1, 1, 1, 1, 1, 1)
if unit == "player" or unit == "target" and health:GetAttribute("normalUnit") ~= "pet" then
health.value:SetFormattedText("|cffffffff%s|r |cffffffff | |r |cffffffff%s|r", (min), (max))
elseif unit == "player" or unit == "target" then
health.value:SetFormattedText("|cffffffff%s|r |cffffffff | |r |cffffffff%s|r", (min), (max))
end
else
if unit == "player" and unit == "target" then
health.value:SetFormattedText("|cffffffff%s|r |cffffffff | |r |cffffffff%s|r", (min), (max))
end
end
end
end