Make the score display a UIPage as well

This commit is contained in:
Michal Adam Pikulski
2025-10-22 10:37:51 +02:00
parent acf3ecec3f
commit 8591490cb2
7 changed files with 820 additions and 803 deletions

View File

@@ -146,27 +146,18 @@ namespace UI.CardSystem
var backpackInput = backpackIcon.gameObject.GetComponentInParent<BackpackInput>();
InputManager.Instance.RegisterOverrideConsumer(backpackInput);
// If no pages are open, push the main menu
if (PageController.CurrentPage == null)
PageController.PushPage(mainMenuPage);
// Clear notification for unseen cards when opening menu
if (_hasUnseenCards)
{
PageController.PushPage(mainMenuPage);
// Clear notification for unseen cards when opening menu
if (_hasUnseenCards)
{
_hasUnseenCards = false;
}
// Hide the backpack button when entering menu
if (backpackButton != null)
{
backpackButton.gameObject.SetActive(false);
}
_hasUnseenCards = false;
}
else if (PageController.CurrentPage == mainMenuPage)
// Hide the backpack button when entering menu
if (backpackButton != null)
{
// If main menu is open, pop it
PageController.PopPage();
backpackButton.gameObject.SetActive(false);
}
}
@@ -184,8 +175,28 @@ namespace UI.CardSystem
}
else
{
// Check if any page in the stack has "Card" or "Album" in the name
bool hasCardOrAlbumPage = false;
if (PageController != null && PageController.PageStack != null)
{
foreach (var page in PageController.PageStack)
{
if (page != null && page.PageName != null)
{
if (page.PageName.Contains("Card") || page.PageName.Contains("Album"))
{
hasCardOrAlbumPage = true;
break;
}
}
}
}
// Hide backpack button if there's a card/album page in the stack
if (backpackButton != null)
backpackButton.gameObject.SetActive(false);
{
backpackButton.gameObject.SetActive(!hasCardOrAlbumPage);
}
}
// Update menu if it's the main menu page