frame.prev.hmax = nil;
else
if UnitIsAFK(unit) then
+ frame.text.status = true;
frame.text:SetText("afk");
if not frame.text:IsShown() then frame.text:Show() end
elseif UnitIsDND(unit) then
+ frame.text.status = true;
frame.text:SetText("dnd");
if not frame.text:IsShown() then frame.text:Show() end
else
- if frame.text:IsShown() then frame.text:Hide() end
+ frame.text.status = false;
+ if not (frame.nonraid and frame.unit == "target") and frame.text:IsShown() then
+ frame.text:Hide();
+ end
end
if frame.nonraid and frame.unit == "player" then
if InCombatLockdown() then
-- health
local current, hmax = UnitHealth(unit), UnitHealthMax(unit);
if frame.prev.health ~= current or frame.prev.hmax ~= hmax then
+ if frame.nonraid and frame.unit == "target" and frame.prev.htext ~= current then
+ frame.prev.htext = current;
+ if current > 1000000000 then -- 1.0B
+ frame.text:SetFormattedText("%.2fB", current / 1000000000);
+ elseif current > 1000000 then -- 1.0M
+ frame.text:SetFormattedText("%.2fM", current / 1000000);
+ elseif current > 1000 then -- 1.0K
+ frame.text:SetFormattedText("%.1fK", current / 1000);
+ end
+ if not frame.text:IsShown() then frame.text:Show() end
+ end
frame.prev.health = current;
frame.prev.hmax = hmax;
if hmax < current or hmax <= 1 then
frame.prev.mmax = max;
if max < current or max <= 1 then
frame.mana:SetWidth(width);
- frame.mana:SetText("100");
+ frame.manatext:SetText("100");
if not frame.mana:IsShown() then frame.mana:Show() end
if not frame.manatext:IsShown() then frame.manatext:Show() end
elseif current <= 0 then