function addon.RegisterEvents(frame)
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
frame:RegisterEvent("RAID_TARGET_UPDATE");
+ if frame.unit == "player" then frame:RegisterEvent("PLAYER_ALIVE") end
if frame.unit == "focus" then frame:RegisterEvent("PLAYER_FOCUS_CHANGED") end
+ if frame.unit == "target" then frame:RegisterEvent("PLAYER_TARGET_CHANGED") end
if not frame.nonraid then
frame:RegisterEvent("PLAYER_REGEN_DISABLED");
frame:RegisterEvent("READY_CHECK");
frame:RegisterUnitEvent("UNIT_ENTERED_VEHICLE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_EXITED_VEHICLE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_PET", frame.unit, displayed);
- if frame.unit ~= "player" then
+ if frame.unit == "focus" or frame.unit == "target" then
+ frame:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", frame.unit, displayed);
+ end
+ if not frame.nonraid or frame.unit ~= "player" then
frame:RegisterUnitEvent("UNIT_NAME_UPDATE", frame.unit, displayed);
end
if not frame.nonraid then
frame.stacks = {};
frame.heal = {};
frame.buff1 = {};
+ frame.buff2 = {};
addon.SetAuras(frame.unit, frame.guid);
end
end,
["UPDATE_ALL_BARS"] = function(frame)
updateVehicle(frame);
updateRaidMarker(frame, frame.displayed);
- if frame.unit ~= "player" then
+ if not frame.nonraid or frame.unit ~= "player" then
updateName(frame, frame.unit);
end
if not frame.nonraid then
frame.stacks = {};
frame.heal = {};
frame.buff1 = {};
+ frame.buff2 = {};
addon.SetAuras(frame.unit, frame.guid);
end
end,
eventFuncs["GROUP_ROSTER_UPDATE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["PLAYER_ENTERING_WORLD"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["PLAYER_FOCUS_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["PLAYER_TARGET_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["UNIT_TARGETABLE_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["PLAYER_ALIVE"] = eventFuncs["UPDATE_ALL_BARS"];
function addon.UnitEvent(self, event)
return eventFuncs[event](self);