Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions Frames/Update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,10 @@ function DF:UpdateUnitFrame(frame, source)
local deficit = UnitHealthMissing(unit, true)
if deficit then
if C_StringUtil and C_StringUtil.TruncateWhenZero and C_StringUtil.WrapString then
local truncated = C_StringUtil.TruncateWhenZero(deficit)
local result = C_StringUtil.WrapString(truncated, "-")
frame.healthText:SetText(result)
frame.healthText:SetText(C_StringUtil.WrapString(C_StringUtil.TruncateWhenZero(deficit), "-"))
if db.healthTextAbbreviate and AbbreviateNumbers and frame.healthText:GetText() then
frame.healthText:SetFormattedText("-%s", AbbreviateNumbers(deficit))
end
elseif db.healthTextAbbreviate and AbbreviateNumbers then
frame.healthText:SetFormattedText("-%s", AbbreviateNumbers(deficit))
else
Expand Down Expand Up @@ -1057,9 +1058,10 @@ function DF:UpdateHealthFast(frame)
local deficit = UnitHealthMissing(unit, true)
if deficit then
if C_StringUtil and C_StringUtil.TruncateWhenZero and C_StringUtil.WrapString then
local truncated = C_StringUtil.TruncateWhenZero(deficit)
local result = C_StringUtil.WrapString(truncated, "-")
frame.healthText:SetText(result)
frame.healthText:SetText(C_StringUtil.WrapString(C_StringUtil.TruncateWhenZero(deficit), "-"))
if db.healthTextAbbreviate and AbbreviateNumbers and frame.healthText:GetText() then
frame.healthText:SetFormattedText("-%s", AbbreviateNumbers(deficit))
end
elseif db.healthTextAbbreviate and AbbreviateNumbers then
frame.healthText:SetFormattedText("-%s", AbbreviateNumbers(deficit))
else
Expand Down Expand Up @@ -1270,14 +1272,17 @@ function DF:UpdateHealth(frame)
elseif format == "DEFICIT" then
local miss = UnitHealthMissing(unit, true)

if C_StringUtil and C_StringUtil.TruncateWhenZero and C_StringUtil.WrapString then
local truncated = C_StringUtil.TruncateWhenZero(miss)
local result = C_StringUtil.WrapString(truncated, "-")
frame.healthText:SetText(result)
elseif db.healthTextAbbreviate then
frame.healthText:SetFormattedText("-%s", FormatValue(miss))
else
frame.healthText:SetFormattedText("-%s", miss)
if miss then
if C_StringUtil and C_StringUtil.TruncateWhenZero and C_StringUtil.WrapString then
frame.healthText:SetText(C_StringUtil.WrapString(C_StringUtil.TruncateWhenZero(miss), "-"))
if db.healthTextAbbreviate and frame.healthText:GetText() then
frame.healthText:SetFormattedText("-%s", FormatValue(miss))
end
elseif db.healthTextAbbreviate then
frame.healthText:SetFormattedText("-%s", FormatValue(miss))
else
frame.healthText:SetFormattedText("-%s", miss)
end
end
elseif format == "CURRENT" then
local curr = UnitHealth(unit, true)
Expand Down