Strip debug logging from the game, fix screen weirdness

This commit is contained in:
Michal Pikulski
2025-10-14 15:53:58 +02:00
parent 18be597424
commit e8180b21bf
65 changed files with 768 additions and 411 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem;
using Pixelplacement;
using UnityEngine;
@@ -251,7 +252,7 @@ namespace AppleHills.UI.CardSystem
// Animate card to center of slot using Pixelplacement.Tween
Tween.LocalPosition(cardUI.transform, Vector3.zero, 0.25f, 0f, Tween.EaseOutBack);
Debug.Log($"[AlbumViewPage] Placed card '{cardUI.GetCardData().Name}' in album slot");
Logging.Debug($"[AlbumViewPage] Placed card '{cardUI.GetCardData().Name}' in album slot");
}
/// <summary>

View File

@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem;
using Pixelplacement;
using UnityEngine;
@@ -137,7 +138,7 @@ namespace AppleHills.UI.CardSystem
}
else
{
Debug.LogWarning("[BoosterOpeningPage] No cards were obtained from the booster pack.");
Logging.Warning("[BoosterOpeningPage] No cards were obtained from the booster pack.");
UIPageController.Instance.PopPage();
}
}

View File

@@ -1,5 +1,6 @@
using System;
using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem;
using UnityEngine;
using UnityEngine.UI;
@@ -168,7 +169,7 @@ namespace AppleHills.UI.CardSystem
}
else
{
Debug.Log("[CardAlbumUI] No booster packs available");
Logging.Debug("[CardAlbumUI] No booster packs available");
// TODO: Show "no boosters available" message
}
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem;
using Pixelplacement;
using UnityEngine;
@@ -136,7 +137,7 @@ namespace AppleHills.UI.CardSystem
/// </summary>
private void OnChangeClothesClicked()
{
Debug.Log("[CardMenuPage] Change Clothes feature coming soon!");
Logging.Debug("[CardMenuPage] Change Clothes feature coming soon!");
// No implementation yet - "Coming soon" feature
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using AppleHills.Data.CardSystem;
using Core;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
@@ -37,7 +38,7 @@ namespace AppleHills.UI.CardSystem
/// </summary>
public void SetupCard(CardData cardData)
{
Debug.Log($"[CardUIElement] Setting up card with data: {cardData}");
Logging.Debug($"[CardUIElement] Setting up card with data: {cardData}");
this.cardData = cardData;
@@ -199,7 +200,7 @@ namespace AppleHills.UI.CardSystem
public void OnShowAnimation()
{
// Stub for card reveal animation
Debug.Log($"[CardUIElement] Showing card: {cardData?.Name}");
Logging.Debug($"[CardUIElement] Showing card: {cardData?.Name}");
// Could add animation code or call Animation Trigger here
}
@@ -209,7 +210,7 @@ namespace AppleHills.UI.CardSystem
public void OnMoveToBackpackAnimation()
{
// Stub for animation when card moves to backpack
Debug.Log($"[CardUIElement] Moving card to backpack: {cardData?.Name}");
Logging.Debug($"[CardUIElement] Moving card to backpack: {cardData?.Name}");
// Could add animation code or call Animation Trigger here
}
@@ -221,14 +222,14 @@ namespace AppleHills.UI.CardSystem
{
if (cardDefinition == null)
{
Debug.LogWarning("[CardUIElement] Cannot create card data: No card definition assigned");
Logging.Warning("[CardUIElement] Cannot create card data: No card definition assigned");
return;
}
cardData = cardDefinition.CreateCardData();
UpdateCardVisuals();
Debug.Log($"[CardUIElement] Created card from definition: {cardData.Name}");
Logging.Debug($"[CardUIElement] Created card from definition: {cardData.Name}");
}
#endif
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Core;
using UnityEngine;
namespace AppleHills.UI.CardSystem
@@ -49,7 +50,7 @@ namespace AppleHills.UI.CardSystem
page.TransitionIn();
OnPageChanged?.Invoke(page);
Debug.Log($"[UIPageController] Pushed page: {page.PageName}");
Logging.Debug($"[UIPageController] Pushed page: {page.PageName}");
}
/// <summary>
@@ -69,12 +70,12 @@ namespace AppleHills.UI.CardSystem
UIPage previousPage = _pageStack.Peek();
previousPage.TransitionIn();
OnPageChanged?.Invoke(previousPage);
Debug.Log($"[UIPageController] Popped to previous page: {previousPage.PageName}");
Logging.Debug($"[UIPageController] Popped to previous page: {previousPage.PageName}");
}
else
{
OnPageChanged?.Invoke(null);
Debug.Log("[UIPageController] Popped last page, no pages left in stack");
Logging.Debug("[UIPageController] Popped last page, no pages left in stack");
}
}
@@ -92,7 +93,7 @@ namespace AppleHills.UI.CardSystem
// Clear stack
_pageStack.Clear();
OnPageChanged?.Invoke(null);
Debug.Log("[UIPageController] Cleared page stack");
Logging.Debug("[UIPageController] Cleared page stack");
}
/// <summary>

View File

@@ -146,7 +146,7 @@ namespace UI
float displayProgress = Mathf.Min(steadyProgress, actualProgress);
// Log the progress values for debugging
Debug.Log($"[LoadingScreen] Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
Logging.Debug($"[LoadingScreen] Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
// Directly set the progress bar fill amount without smoothing
if (progressBarImage != null)
@@ -159,7 +159,7 @@ namespace UI
if (steadyProgress >= 1.0f && displayProgress >= 1.0f)
{
_animationComplete = true;
Debug.Log("[LoadingScreen] Animation complete");
Logging.Debug("[LoadingScreen] Animation complete");
break;
}
@@ -171,7 +171,7 @@ namespace UI
if (progressBarImage != null)
{
progressBarImage.fillAmount = 1.0f;
Debug.Log("[LoadingScreen] Final progress set to 1.0");
Logging.Debug("[LoadingScreen] Final progress set to 1.0");
}
// Hide the screen if loading is also complete
@@ -180,7 +180,7 @@ namespace UI
if (loadingScreenContainer != null)
{
loadingScreenContainer.SetActive(false);
Debug.Log("[LoadingScreen] Animation AND loading complete, hiding screen");
Logging.Debug("[LoadingScreen] Animation AND loading complete, hiding screen");
// Invoke the callback when fully hidden
_onLoadingScreenFullyHidden?.Invoke();
@@ -196,7 +196,7 @@ namespace UI
/// </summary>
public void HideLoadingScreen()
{
Debug.Log("[LoadingScreen] Loading complete, marking loading as finished");
Logging.Debug("[LoadingScreen] Loading complete, marking loading as finished");
// Mark that loading is complete
_loadingComplete = true;
@@ -207,7 +207,7 @@ namespace UI
if (loadingScreenContainer != null)
{
loadingScreenContainer.SetActive(false);
Debug.Log("[LoadingScreen] Animation already complete, hiding screen immediately");
Logging.Debug("[LoadingScreen] Animation already complete, hiding screen immediately");
// Invoke the callback when fully hidden
_onLoadingScreenFullyHidden?.Invoke();
@@ -216,7 +216,7 @@ namespace UI
}
else
{
Debug.Log("[LoadingScreen] Animation still in progress, waiting for it to complete");
Logging.Debug("[LoadingScreen] Animation still in progress, waiting for it to complete");
// The coroutine will handle hiding when animation completes
}
}

View File

@@ -8,7 +8,7 @@ public class MainMenu : MonoBehaviour
public async void StartGame()
{
// Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%"));
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
}

View File

@@ -86,7 +86,7 @@ namespace UI
if(!isMainMenu)
HidePauseMenu(false); // Ensure menu is hidden when switching to a game level
Debug.Log($"[PauseMenu] Setting pause menu active: {!isMainMenu} for scene: {levelName}");
Logging.Debug($"[PauseMenu] Setting pause menu active: {!isMainMenu} for scene: {levelName}");
}
/// <summary>
@@ -105,7 +105,7 @@ namespace UI
InputManager.Instance.SetInputMode(InputMode.UI);
OnGamePaused?.Invoke();
Debug.Log("[PauseMenu] Game Paused");
Logging.Debug("[PauseMenu] Game Paused");
}
/// <summary>
@@ -124,7 +124,7 @@ namespace UI
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
OnGameResumed?.Invoke();
Debug.Log("[PauseMenu] Game Resumed");
Logging.Debug("[PauseMenu] Game Resumed");
}
/// <summary>
@@ -141,7 +141,7 @@ namespace UI
public async void ExitToMainMenu()
{
// Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%"));
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress);
}
@@ -156,6 +156,12 @@ namespace UI
Application.Quit();
#endif
}
public async void ReloadLevel()
{
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.ReloadCurrentScene(progress);
}
/// <summary>
/// Loads a level based on the selection from a dropdown menu.
@@ -168,7 +174,7 @@ namespace UI
HidePauseMenu();
// Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%"));
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
switch (levelSelection)
{
case 0: