+local function updateStatusText(self, unit)
+ if not UnitIsConnected(unit) then
+ self.statusText:SetText("DC");
+ elseif UnitIsDeadOrGhost(unit) then
+ self.statusText:SetText("rip");
+ else
+ local healthLost = UnitHealthMax(unit) - UnitHealth(unit);
+ if healthLost <= 0 then
+ self.statusText:SetText("");
+ return;
+ end
+
+ local prettyHealth;
+ if healthLost > 1200000000 then -- 1.2B
+ prettyHealth = format("-%.1fB", healthLost / 1000000000);
+ elseif healthLost > 1200000 then -- 1.2M
+ prettyHealth = format("-%.1fM", healthLost / 1000000);
+ elseif healthLost > 1000 then -- 1K
+ prettyHealth = format("-%dK", healthLost / 1000);
+ else
+ prettyHealth = format("-%d", healthLost)
+ end
+
+ self.statusText:SetText(prettyHealth);
+ end
+end
+
+local function frameEvent(self, event, ...)
+ local arg1, arg2, arg3, arg4 = ...;
+ if event == "UNIT_HEALTH" or event == "UNIT_HEALTH_FREQUENT" then
+ updateStatusText(self, arg1);
+ elseif event == "UNIT_AURA" then
+ updateAuras(self, arg1);
+ end
+end
+
+--[[ TODO powerBar display and bar coloring
+ if options.displayPowerBar and role ~= "HEALER" then
+ frame.healthBar:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -1, 1);
+ frame.powerBar:Hide();
+ end
+]]
+
+--local update_ooc = false;