922d6e4 - Remove OmaRF in favor of newer kehys frames
[wowui.git] / kehys / events.lua
index 32241e4..4a9264f 100644 (file)
@@ -23,6 +23,7 @@ local READY_CHECK_WAITING_TEXTURE = READY_CHECK_WAITING_TEXTURE;
 
 local _, addon = ...;
 addon.Events = {};
+local guids = addon.FrameGuids;
 local baseColor = {0, 0, 0};
 local overlayColorDispel = {1, 0.5, 0, 0.5};
 local overlayColorCharm = {0.8, 0, 1, 0.5};
@@ -141,6 +142,13 @@ local eventFuncs = {
     end,
     ["UNIT_NAME_UPDATE"] = function(frame)
         updateName(frame, frame.unit);
+        if frame.guid then
+            guids[frame.guid] = nil;
+        end
+        frame.guid = UnitGUID(frame.unit);
+        if frame.guid then
+            guids[frame.guid] = frame;
+        end
     end,
     ["PLAYER_ROLES_ASSIGNED"] = function(frame)
         updateRole(frame, frame.unit);
@@ -158,6 +166,15 @@ local eventFuncs = {
         updateName(frame, frame.unit);
         updateReadyCheck(frame, frame.unit);
         updateRaidMarker(frame, frame.displayed);
+
+        if frame.guid then
+            guids[frame.guid] = nil;
+        end
+        frame.guid = UnitGUID(frame.unit);
+        if frame.guid then
+            guids[frame.guid] = frame;
+        end
+        -- TODO update initial aura state
     end,
 };
 eventFuncs["READY_CHECK_CONFIRM"] = eventFuncs["READY_CHECK"];