1
1
local MAJOR_VERSION = " LibGetFrame-1.0"
2
- local MINOR_VERSION = 14
2
+ local MINOR_VERSION = 15
3
3
if not LibStub then error (MAJOR_VERSION .. " requires LibStub." ) end
4
4
local lib = LibStub :NewLibrary (MAJOR_VERSION , MINOR_VERSION )
5
5
if not lib then return end
@@ -71,7 +71,7 @@ local defaultTargettargetFrames = {
71
71
}
72
72
73
73
local GetFramesCache = {}
74
- local FrameToGUID = {}
74
+ local FrameToUnit = {}
75
75
local UpdatedFrames = {}
76
76
77
77
local function ScanFrames (depth , frame , ...)
@@ -89,10 +89,9 @@ local function ScanFrames(depth, frame, ...)
89
89
local name = frame :GetName ()
90
90
if unit and frame :IsVisible () and name then
91
91
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
96
95
end
97
96
end
98
97
end
@@ -107,8 +106,8 @@ local function ScanForUnitFrames(noDelay)
107
106
wipe (GetFramesCache )
108
107
ScanFrames (0 , UIParent )
109
108
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 )
112
111
end
113
112
elseif not wait then
114
113
wait = true
@@ -118,8 +117,8 @@ local function ScanForUnitFrames(noDelay)
118
117
ScanFrames (0 , UIParent )
119
118
wait = false
120
119
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 )
123
122
end
124
123
end )
125
124
end
0 commit comments