From 7c09db641acd7e6770bebcb8526773bee285bab1 Mon Sep 17 00:00:00 2001 From: Michal Pikulski Date: Mon, 10 Nov 2025 12:41:28 +0100 Subject: [PATCH] Only show cards when in actual album --- Assets/Scripts/UI/CardSystem/AlbumViewPage.cs | 75 ++++++++++++++++++- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/UI/CardSystem/AlbumViewPage.cs b/Assets/Scripts/UI/CardSystem/AlbumViewPage.cs index 8b4796a2..cd5d2b1b 100644 --- a/Assets/Scripts/UI/CardSystem/AlbumViewPage.cs +++ b/Assets/Scripts/UI/CardSystem/AlbumViewPage.cs @@ -56,7 +56,7 @@ namespace UI.CardSystem canvasGroup = GetComponent(); if (canvasGroup == null) canvasGroup = gameObject.AddComponent(); - + // Hide backdrop initially if (cardEnlargedBackdrop != null) { @@ -72,6 +72,17 @@ namespace UI.CardSystem // Set up booster pack button listeners SetupBoosterButtonListeners(); + // Subscribe to book page flip events + if (book != null) + { + book.OnFlip.AddListener(OnPageFlipped); + Debug.Log("[AlbumViewPage] Subscribed to book.OnFlip event"); + } + else + { + Debug.LogWarning("[AlbumViewPage] Book reference is null, cannot subscribe to OnFlip event!"); + } + // Subscribe to CardSystemManager events (managers are guaranteed to be initialized) if (CardSystemManager.Instance != null) { @@ -125,6 +136,12 @@ namespace UI.CardSystem for (int i = 0; i < boosterPackButtons.Length; i++) { if (boosterPackButtons[i] == null) continue; + // Unsubscribe from book events + if (book != null) + { + book.OnFlip.RemoveListener(OnPageFlipped); + } + Button button = boosterPackButtons[i].GetComponent