|
327 | 327 |
|
328 | 328 | local function ReskinMainFrame(frame) |
329 | 329 | frame:StripTextures() |
330 | | - frame:SetTemplate() |
| 330 | + frame:SetTemplate("Transparent") |
331 | 331 | 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) |
346 | 332 | end |
347 | 333 |
|
348 | 334 | local function ReskinTitleBar(frame) |
@@ -1442,17 +1428,59 @@ local function ReskinMiniLoadoutPanel(frame) |
1442 | 1428 | frame.__windSkin = true |
1443 | 1429 | end |
1444 | 1430 |
|
1445 | | -function S:RematchButton() |
| 1431 | +function S:BlizzardCollections_Rematch() |
1446 | 1432 | if not E.private.WT.skins.enable or not E.private.WT.skins.addons.rematch then |
1447 | 1433 | return |
1448 | 1434 | end |
1449 | 1435 |
|
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 |
1451 | 1443 | return |
1452 | 1444 | end |
1453 | 1445 |
|
| 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 | + |
1454 | 1482 | RunNextFrame(function() |
1455 | | - self:Proxy("HandleCheckBox", _G.Rematch.journal.UseRematchCheckButton) |
| 1483 | + self:Proxy("HandleCheckBox", Journal.UseRematchCheckButton) |
1456 | 1484 | end) |
1457 | 1485 | end |
1458 | 1486 |
|
@@ -1522,4 +1550,4 @@ function S:Rematch() |
1522 | 1550 | end |
1523 | 1551 |
|
1524 | 1552 | S:AddCallbackForAddon("Rematch") |
1525 | | -S:AddCallbackForAddon("Blizzard_Collections", "RematchButton") |
| 1553 | +S:AddCallbackForAddon("Blizzard_Collections", "BlizzardCollections_Rematch") |
0 commit comments