a296877 - Add option to iterate over UnitAura instead of aura list
[wowui.git] / OmaRF / Events.lua
index 404e063..af49cd4 100644 (file)
@@ -11,7 +11,6 @@ local UnitIsAFK, UnitIsDND = UnitIsAFK, UnitIsDND;
 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;
@@ -72,7 +71,6 @@ end
 
 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);
@@ -84,7 +82,6 @@ function M.RegisterUnitEvents(frame)
     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);
@@ -143,11 +140,6 @@ local function updateText(frame, unit)
     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
@@ -170,6 +162,7 @@ local function updatePowerColor(frame, unit)
     frame.mana:SetVertexColor(unpack(powerColors[UnitPowerType(unit)]));
 end
 
+-- TODO maybe add a prefix when in vehicle
 local function updateName(frame, unit)
     local name = UnitName(unit);
     if not name then return end
@@ -339,9 +332,10 @@ local eventFuncs = {
         updateShield(frame, frame.displayed);
         updateHealAbsorb(frame, frame.displayed);
         -- no heal prediction update, that doesn't overflow too much
-        -- raid marker update here, because marker is removed when unit dies
+        -- raid marker update here, if needed
+        -- because marker is removed when unit dies
         -- without a RAID_TARGET_UPDATE event
-        updateRaidMarker(frame, frame.unit);
+        --updateRaidMarker(frame, frame.unit);
     end,
     ["UNIT_POWER"] = function(frame)
         updatePower(frame, frame.displayed);
@@ -378,14 +372,11 @@ local eventFuncs = {
         updatePower(frame, frame.displayed);
     end,
     ["UNIT_NAME_UPDATE"] = function(frame)
-        updateName(frame, frame.displayed);
+        updateName(frame, frame.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);
@@ -416,8 +407,7 @@ local eventFuncs = {
         updateHealPred(frame, frame.displayed);
         updateHealAbsorb(frame, frame.displayed);
         updateAggro(frame, frame.displayed);
-        updateName(frame, frame.displayed);
-        updateIncomingRes(frame, frame.unit);
+        updateName(frame, frame.unit);
         updateReadyCheck(frame, frame.unit);
         updateRaidMarker(frame, frame.displayed);
     end,