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 GetReadyCheckTimeLeft, GetReadyCheckStatus = GetReadyCheckTimeLeft, GetReadyCheckStatus;
function M.RegisterUnitEvents(frame)
-- events are taken from FrameXML/CompactUnitFrame.lua
- -- 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);
frame:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_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);
frame:RegisterUnitEvent("PLAYER_FLAGS_CHANGED", frame.unit, displayed);
frame:RegisterUnitEvent("READY_CHECK_CONFIRM", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_ENTERED_VEHICLE", frame.unit, displayed);
end
end
-local function updateIncomingRes(frame, unit)
- if UnitHasIncomingResurrection(unit) then frame.rez:Show();
- else frame.rez:Hide(); end
-end
-
local function updateMaxPower(frame, unit)
frame.mana.max = UnitPowerMax(unit);
end
["UNIT_CONNECTION"] = function(frame)
updateText(frame, frame.displayed);
end,
- ["INCOMING_RESURRECT_CHANGED"] = function(frame)
- updateIncomingRes(frame, frame.unit);
- end,
["PARTY_MEMBER_ENABLE"] = function(frame)
-- new power info possibly (FrameXML/CompactUnitFrame.lua)
updateMaxPower(frame, frame.displayed);
updateHealAbsorb(frame, frame.displayed);
updateAggro(frame, frame.displayed);
updateName(frame, frame.displayed);
- updateIncomingRes(frame, frame.unit);
updateReadyCheck(frame, frame.unit);
updateRaidMarker(frame, frame.displayed);
end,