Skip to content

Commit b402d3b

Browse files
committed
replaced FRAME_GUID_UPDATE with FRAME_UNIT_UPDATE
1 parent 2c1ba6d commit b402d3b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

LibGetFrame-1.0.lua

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
local MAJOR_VERSION = "LibGetFrame-1.0"
2-
local MINOR_VERSION = 14
2+
local MINOR_VERSION = 15
33
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
44
local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
55
if not lib then return end
@@ -71,7 +71,7 @@ local defaultTargettargetFrames = {
7171
}
7272

7373
local GetFramesCache = {}
74-
local FrameToGUID = {}
74+
local FrameToUnit = {}
7575
local UpdatedFrames = {}
7676

7777
local function ScanFrames(depth, frame, ...)
@@ -89,10 +89,9 @@ local function ScanFrames(depth, frame, ...)
8989
local name = frame:GetName()
9090
if unit and frame:IsVisible() and name then
9191
GetFramesCache[frame] = name
92-
local guid = UnitGUID(unit)
93-
if guid ~= FrameToGUID[frame] then
94-
FrameToGUID[frame] = guid
95-
UpdatedFrames[frame] = guid
92+
if unit ~= FrameToUnit[frame] then
93+
FrameToUnit[frame] = unit
94+
UpdatedFrames[frame] = unit
9695
end
9796
end
9897
end
@@ -107,8 +106,8 @@ local function ScanForUnitFrames(noDelay)
107106
wipe(GetFramesCache)
108107
ScanFrames(0, UIParent)
109108
callbacks:Fire("GETFRAME_REFRESH")
110-
for frame, guid in pairs(UpdatedFrames) do
111-
callbacks:Fire("FRAME_GUID_UPDATE", frame, guid)
109+
for frame, unit in pairs(UpdatedFrames) do
110+
callbacks:Fire("FRAME_UNIT_UPDATE", frame, unit)
112111
end
113112
elseif not wait then
114113
wait = true
@@ -118,8 +117,8 @@ local function ScanForUnitFrames(noDelay)
118117
ScanFrames(0, UIParent)
119118
wait = false
120119
callbacks:Fire("GETFRAME_REFRESH")
121-
for frame, guid in pairs(UpdatedFrames) do
122-
callbacks:Fire("FRAME_GUID_UPDATE", frame, guid)
120+
for frame, unit in pairs(UpdatedFrames) do
121+
callbacks:Fire("FRAME_UNIT_UPDATE", frame, unit)
123122
end
124123
end)
125124
end

0 commit comments

Comments
 (0)