Make the score display a UIPage as well
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user