local UnitDebuff, UnitIsCharmed = UnitDebuff, UnitIsCharmed;
local UnitPower, UnitPowerMax, UnitPowerType = UnitPower, UnitPowerMax, UnitPowerType;
local UnitHealth, UnitHealthMax = UnitHealth, UnitHealthMax;
local UnitDebuff, UnitIsCharmed = UnitDebuff, UnitIsCharmed;
local UnitPower, UnitPowerMax, UnitPowerType = UnitPower, UnitPowerMax, UnitPowerType;
local UnitHealth, UnitHealthMax = UnitHealth, UnitHealthMax;
local UnitGetIncomingHeals, UnitGetTotalAbsorbs = UnitGetIncomingHeals, UnitGetTotalAbsorbs;
local UnitThreatSituation, GetThreatStatusColor = UnitThreatSituation, GetThreatStatusColor;
local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected;
local UnitHasIncomingResurrection = UnitHasIncomingResurrection;
local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs;
local UnitHasVehicleUI, UnitTargetsVehicleInRaidUI = UnitHasVehicleUI, UnitTargetsVehicleInRaidUI;
local UnitGetIncomingHeals, UnitGetTotalAbsorbs = UnitGetIncomingHeals, UnitGetTotalAbsorbs;
local UnitThreatSituation, GetThreatStatusColor = UnitThreatSituation, GetThreatStatusColor;
local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected;
local UnitHasIncomingResurrection = UnitHasIncomingResurrection;
local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs;
local UnitHasVehicleUI, UnitTargetsVehicleInRaidUI = UnitHasVehicleUI, UnitTargetsVehicleInRaidUI;
local baseColor = Settings.BaseColor;
local overlayColorDispel = Settings.OverlayColorDispel;
local overlayColorCharm = Settings.OverlayColorCharm;
local overlayColorAlert = Settings.OverlayColorAlert;
local powerColors = Settings.PowerColors;
local baseColor = Settings.BaseColor;
local overlayColorDispel = Settings.OverlayColorDispel;
local overlayColorCharm = Settings.OverlayColorCharm;
local overlayColorAlert = Settings.OverlayColorAlert;
local powerColors = Settings.PowerColors;
- -- TODO ready check support, raid marker support,
- -- player flags support (/afk, /dnd)
+ -- TODO raid marker support
local displayed = frame.unit ~= frame.displayed and frame.displayed or nil;
frame:RegisterUnitEvent("UNIT_HEALTH", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", frame.unit, displayed);
local displayed = frame.unit ~= frame.displayed and frame.displayed or nil;
frame:RegisterUnitEvent("UNIT_HEALTH", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_POWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_MAXPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_POWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_MAXPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_NAME_UPDATE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_AURA", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_NAME_UPDATE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_AURA", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_HEAL_PREDICTION", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_CONNECTION", frame.unit, displayed);
frame:RegisterUnitEvent("INCOMING_RESURRECT_CHANGED", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_THREAT_SITUATION_UPDATE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_CONNECTION", frame.unit, displayed);
frame:RegisterUnitEvent("INCOMING_RESURRECT_CHANGED", frame.unit, displayed);
local healthLost = max - current;
if UnitIsDeadOrGhost(unit) then
frame.text:SetText("Dead");
local healthLost = max - current;
if UnitIsDeadOrGhost(unit) then
frame.text:SetText("Dead");
elseif healthLost > 0 then
if healthLost > 1200000000 then -- 1.2B
frame.text:SetFormattedText("-%.1fB", healthLost / 1000000000);
elseif healthLost > 0 then
if healthLost > 1200000000 then -- 1.2B
frame.text:SetFormattedText("-%.1fB", healthLost / 1000000000);
+local function updateReadyCheck(frame, unit)
+ local status = GetReadyCheckStatus(unit);
+ if status == "ready" then
+ frame.ready:SetTexture(READY_CHECK_READY_TEXTURE);
+ frame.ready:Show()
+ elseif status == "notready" then
+ frame.ready:SetTexture(READY_CHECK_NOT_READY_TEXTURE);
+ frame.ready:Show()
+ elseif status == "waiting" then
+ frame.ready:SetTexture(READY_CHECK_WAITING_TEXTURE);
+ frame.ready:Show()
+ else
+ frame.ready:Hide()
+ end
+end
+
local eventFuncs = {
["UNIT_HEALTH"] = function(frame)
updateHealth(frame, frame.displayed);
local eventFuncs = {
["UNIT_HEALTH"] = function(frame)
updateHealth(frame, frame.displayed);
end,
["UNIT_DISPLAYPOWER"] = function(frame)
updatePowerColor(frame, frame.displayed);
end,
["UNIT_DISPLAYPOWER"] = function(frame)
updatePowerColor(frame, frame.displayed);
end,
["UNIT_NAME_UPDATE"] = function(frame)
updateName(frame, frame.displayed);
end,
["UNIT_NAME_UPDATE"] = function(frame)
updateName(frame, frame.displayed);
["PLAYER_ROLES_ASSIGNED"] = function(frame)
updateRole(frame, frame.unit);
end,
["PLAYER_ROLES_ASSIGNED"] = function(frame)
updateRole(frame, frame.unit);
end,
["UPDATE_ALL_BARS"] = function(frame)
updateVehicle(frame);
updateMaxHealth(frame, frame.displayed);
["UPDATE_ALL_BARS"] = function(frame)
updateVehicle(frame);
updateMaxHealth(frame, frame.displayed);
updateHealAbsorb(frame, frame.displayed);
updatePowerColor(frame, frame.displayed);
updateIncomingRes(frame, frame.unit);
updateHealAbsorb(frame, frame.displayed);
updatePowerColor(frame, frame.displayed);
updateIncomingRes(frame, frame.unit);
updateAggro(frame, frame.displayed);
updateName(frame, frame.displayed);
updateRole(frame, frame.unit);
updateAggro(frame, frame.displayed);
updateName(frame, frame.displayed);
updateRole(frame, frame.unit);
};
eventFuncs["UNIT_HEALTH_FREQUENT"] = eventFuncs["UNIT_HEALTH"];
eventFuncs["PARTY_MEMBER_DISABLE"] = eventFuncs["PARTY_MEMBER_ENABLE"];
};
eventFuncs["UNIT_HEALTH_FREQUENT"] = eventFuncs["UNIT_HEALTH"];
eventFuncs["PARTY_MEMBER_DISABLE"] = eventFuncs["PARTY_MEMBER_ENABLE"];
+eventFuncs["PLAYER_FLAGS_CHANGED"] = eventFuncs["UNIT_CONNECTION"];
+eventFuncs["UNIT_POWER_BAR_SHOW"] = eventFuncs["UNIT_DISPLAYPOWER"];
+eventFuncs["UNIT_POWER_BAR_HIDE"] = eventFuncs["UNIT_DISPLAYPOWER"];
+eventFuncs["READY_CHECK_CONFIRM"] = eventFuncs["READY_CHECK"];
+eventFuncs["READY_CHECK_FINISHED"] = eventFuncs["READY_CHECK"];
eventFuncs["UNIT_ENTERED_VEHICLE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["UNIT_EXITED_VEHICLE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["UNIT_PET"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["GROUP_ROSTER_UPDATE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["UNIT_ENTERED_VEHICLE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["UNIT_EXITED_VEHICLE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["UNIT_PET"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["GROUP_ROSTER_UPDATE"] = eventFuncs["UPDATE_ALL_BARS"];