Cleanup compile warnings, cleanup logs, spruce up level selection menu
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Core;
|
||||
|
||||
namespace Bootstrap
|
||||
{
|
||||
@@ -40,7 +41,9 @@ namespace Bootstrap
|
||||
/// Current progress provider being used for the loading screen
|
||||
/// </summary>
|
||||
private ProgressProvider _currentProgressProvider;
|
||||
|
||||
|
||||
private LogVerbosity _logVerbosity = LogVerbosity.Warning;
|
||||
|
||||
/// <summary>
|
||||
/// Default progress provider that returns 0 (or 1 if loading is complete)
|
||||
/// </summary>
|
||||
@@ -62,7 +65,12 @@ namespace Bootstrap
|
||||
loadingScreenContainer.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the loading screen and resets the progress bar to zero
|
||||
/// </summary>
|
||||
@@ -130,7 +138,7 @@ namespace Bootstrap
|
||||
float displayProgress = Mathf.Min(steadyProgress, actualProgress);
|
||||
|
||||
// Log the progress values for debugging
|
||||
Debug.Log($"[InitialLoadingScreen] Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
|
||||
LogDebugMessage($"Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
|
||||
|
||||
// Directly set the progress bar fill amount without smoothing
|
||||
if (progressBarImage != null)
|
||||
@@ -143,7 +151,7 @@ namespace Bootstrap
|
||||
if (steadyProgress >= 1.0f && displayProgress >= 1.0f)
|
||||
{
|
||||
_animationComplete = true;
|
||||
Debug.Log("[InitialLoadingScreen] Animation complete");
|
||||
LogDebugMessage("Animation complete");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -155,7 +163,7 @@ namespace Bootstrap
|
||||
if (progressBarImage != null)
|
||||
{
|
||||
progressBarImage.fillAmount = 1.0f;
|
||||
Debug.Log("[InitialLoadingScreen] Final progress set to 1.0");
|
||||
LogDebugMessage("Final progress set to 1.0");
|
||||
}
|
||||
|
||||
// Hide the screen if loading is also complete
|
||||
@@ -164,7 +172,7 @@ namespace Bootstrap
|
||||
if (loadingScreenContainer != null)
|
||||
{
|
||||
loadingScreenContainer.SetActive(false);
|
||||
Debug.Log("[InitialLoadingScreen] Animation AND loading complete, hiding screen");
|
||||
LogDebugMessage("Animation AND loading complete, hiding screen");
|
||||
|
||||
// Invoke the callback when fully hidden
|
||||
_onLoadingScreenFullyHidden?.Invoke();
|
||||
@@ -181,7 +189,7 @@ namespace Bootstrap
|
||||
/// </summary>
|
||||
public void HideLoadingScreen()
|
||||
{
|
||||
Debug.Log("[InitialLoadingScreen] Loading complete, marking loading as finished");
|
||||
LogDebugMessage("Loading complete, marking loading as finished");
|
||||
|
||||
// Mark that loading is complete
|
||||
_loadingComplete = true;
|
||||
@@ -192,7 +200,7 @@ namespace Bootstrap
|
||||
if (loadingScreenContainer != null)
|
||||
{
|
||||
loadingScreenContainer.SetActive(false);
|
||||
Debug.Log("[InitialLoadingScreen] Animation already complete, hiding screen immediately");
|
||||
LogDebugMessage("Animation already complete, hiding screen immediately");
|
||||
|
||||
// Invoke the callback when fully hidden
|
||||
_onLoadingScreenFullyHidden?.Invoke();
|
||||
@@ -202,7 +210,7 @@ namespace Bootstrap
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[InitialLoadingScreen] Animation still in progress, waiting for it to complete");
|
||||
LogDebugMessage("Animation still in progress, waiting for it to complete");
|
||||
// The coroutine will handle hiding when animation completes
|
||||
}
|
||||
}
|
||||
@@ -236,5 +244,13 @@ namespace Bootstrap
|
||||
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if ( _logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[InitialLoadingScreen] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user