Skip to content

Commit 0a96560

Browse files
committed
Minor improvements and bugfixes
1 parent c1d09e7 commit 0a96560

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

BlizzMovePlugin_Rematch.lua

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,27 @@ function Plugin:ADDON_LOADED(addonName)
1212

1313
--- @type BlizzMoveAPI
1414
local BlizzMoveAPI = _G.BlizzMoveAPI;
15-
if(BlizzMoveAPI and BlizzMoveAPI.GetVersion and BlizzMoveAPI.RegisterAddOnFrames) then
15+
if BlizzMoveAPI and BlizzMoveAPI.GetVersion and BlizzMoveAPI.RegisterAddOnFrames then
1616
local _, _, _, _, versionInt = BlizzMoveAPI:GetVersion();
1717
if (versionInt == nil or versionInt >= 30200) then
1818
compatible = true;
1919
end
2020
end
2121

22-
if(not compatible) then
22+
if not compatible then
2323
print(name .. ' is not compatible with the current version of BlizzMove, please update.');
2424
return;
2525
end
2626

27-
local subFrames;
28-
if RematchFrame then
29-
subFrames = {
30-
RematchFrame = {
31-
MinVersion = 0,
32-
},
33-
};
34-
end
35-
36-
if not subFrames then
27+
if not RematchFrame then
3728
print(name .. ' current version of Rematch is not supported by this plugin. Please notify the author of this plugin on CurseForge or GitHub.');
3829
return;
3930
end
40-
local frameTable = {
41-
['Blizzard_Collections'] =
42-
{
43-
['CollectionsJournal'] =
44-
{
45-
MinVersion = 0,
46-
SubFrames = subFrames,
47-
},
48-
},
49-
};
50-
BlizzMoveAPI:RegisterAddOnFrames(frameTable);
31+
hooksecurefunc(RematchFrame, 'SetParent', function(_, parent)
32+
if parent == CollectionsJournal then
33+
BlizzMoveAPI:UnregisterFrame('Rematch', 'RematchFrame');
34+
else
35+
BlizzMoveAPI:RegisterAddOnFrames({ ['Rematch'] = { RematchFrame = {} } });
36+
end
37+
end);
5138
end

0 commit comments

Comments
 (0)