Skip to content

Commit 97b0092

Browse files
committed
feat: use transparent background for rematch
1 parent 515f122 commit 97b0092

File tree

1 file changed

+47
-19
lines changed

1 file changed

+47
-19
lines changed

Modules/Skins/Addons/Rematch.lua

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -327,22 +327,8 @@ end
327327

328328
local function ReskinMainFrame(frame)
329329
frame:StripTextures()
330-
frame:SetTemplate()
330+
frame:SetTemplate("Transparent")
331331
S:CreateShadow(frame)
332-
if not E.private.WT.skins.shadow then
333-
return
334-
end
335-
hooksecurefunc(frame, "Show", function()
336-
if _G.CollectionsJournal and _G.CollectionsJournal.shadow then
337-
_G.CollectionsJournal.shadow:Hide()
338-
end
339-
end)
340-
341-
hooksecurefunc(frame, "Hide", function()
342-
if _G.CollectionsJournal and _G.CollectionsJournal.shadow then
343-
_G.CollectionsJournal.shadow:Show()
344-
end
345-
end)
346332
end
347333

348334
local function ReskinTitleBar(frame)
@@ -1442,17 +1428,59 @@ local function ReskinMiniLoadoutPanel(frame)
14421428
frame.__windSkin = true
14431429
end
14441430

1445-
function S:RematchButton()
1431+
function S:BlizzardCollections_Rematch()
14461432
if not E.private.WT.skins.enable or not E.private.WT.skins.addons.rematch then
14471433
return
14481434
end
14491435

1450-
if not _G.Rematch or not _G.Rematch.journal then
1436+
local Rematch = _G.Rematch
1437+
if not Rematch then
1438+
return
1439+
end
1440+
1441+
local Journal = Rematch.journal
1442+
if not Journal then
14511443
return
14521444
end
14531445

1446+
local function HidePetJournalElements()
1447+
if not Journal:IsActive() then
1448+
return
1449+
end
1450+
1451+
_G.CollectionsJournalCloseButton:Hide()
1452+
_G.CollectionsJournalTitleText:Hide()
1453+
_G.CollectionsJournal.backdrop:SetTemplate("NoBackdrop")
1454+
if _G.CollectionsJournal.shadow then
1455+
_G.CollectionsJournal.shadow:Hide()
1456+
end
1457+
end
1458+
1459+
local function RestoreJournalElements()
1460+
if not Journal:IsActive() then
1461+
return
1462+
end
1463+
1464+
_G.CollectionsJournal.backdrop:SetTemplate("Transparent")
1465+
_G.CollectionsJournalCloseButton:Show()
1466+
_G.CollectionsJournalTitleText:Show()
1467+
if _G.CollectionsJournal.shadow then
1468+
_G.CollectionsJournal.shadow:Show()
1469+
end
1470+
end
1471+
1472+
self:SecureHook(Journal, "PLAYER_REGEN_ENABLED", HidePetJournalElements)
1473+
self:SecureHook(Journal, "PetJournalOnShow", HidePetJournalElements)
1474+
self:SecureHook(Journal, "PetJournalOnSetShown", function(_, shown)
1475+
(shown and HidePetJournalElements or RestoreJournalElements)()
1476+
end)
1477+
self:Hook(Journal, "PLAYER_REGEN_DISABLED", RestoreJournalElements)
1478+
self:Hook(Journal, "PetJournalOnHide", RestoreJournalElements)
1479+
1480+
self:HookScript(Rematch.bottombar.UseRematchCheckButton, "OnClick", RestoreJournalElements)
1481+
14541482
RunNextFrame(function()
1455-
self:Proxy("HandleCheckBox", _G.Rematch.journal.UseRematchCheckButton)
1483+
self:Proxy("HandleCheckBox", Journal.UseRematchCheckButton)
14561484
end)
14571485
end
14581486

@@ -1522,4 +1550,4 @@ function S:Rematch()
15221550
end
15231551

15241552
S:AddCallbackForAddon("Rematch")
1525-
S:AddCallbackForAddon("Blizzard_Collections", "RematchButton")
1553+
S:AddCallbackForAddon("Blizzard_Collections", "BlizzardCollections_Rematch")

0 commit comments

Comments
 (0)