This commit is contained in:
SoulliesOfficial
2025-08-22 14:54:40 -04:00
parent 6aa498f6be
commit 70b2a43824
574 changed files with 173713 additions and 1884 deletions

View File

@@ -11,7 +11,9 @@ namespace Ichni
{
public class ProjectLoader
{
public float loadPercent;
public float fakeLoadPercent;
public float realLoadPercent;
public float displayLoadPercent => Mathf.Min(realLoadPercent, fakeLoadPercent);
public static readonly ES3Settings SaveSettings = new ES3Settings
{
@@ -39,34 +41,53 @@ namespace Ichni
LoadProjectInfo(beatMapFolderPath);
LoadSongInfo(beatMapFolderPath);
LoadCommandScripts(beatMapFolderPath);
GameManager.instance.gameLoadingCanvas.MoveParts();
ThemeBundleManager.instance.LoadThemeBundles(GameManager.instance.projectInformation.selectedThemeBundleList);
loadPercent = 0f;
realLoadPercent = 0f;
fakeLoadPercent = 0f;
Observable.EveryUpdate()
.Where(_ => ThemeBundleManager.instance.waitingBundleAmount.Value == 0)
.Where(_ => ThemeBundleManager.instance.waitingBundleAmount.Value == 0 &&
GameManager.instance.gameLoadingCanvas.allPartsSet)
.First()
.Subscribe(_ =>
{
LoadBeatMap(beatMapFolderPath);
IDisposable fakeLoadObserver = Observable.EveryUpdate().Subscribe(_ =>
{
fakeLoadPercent += Time.deltaTime * 0.2f;
GameManager.instance.gameLoadingCanvas.SetProgress(displayLoadPercent * 100f);
});
Observable.EveryUpdate()
.Where(_ => ((BeatmapContainer_BM)GameManager.instance.beatmapContainer.matchedBM).remainingElementAmount.Value == 0)
.Where(_ => ((BeatmapContainer_BM)GameManager.instance.beatmapContainer.matchedBM).remainingElementAmount.Value == 0 &&
fakeLoadPercent >= 1f)
.First()
.Subscribe(_ =>
{
GameManager.instance.beatmapContainer.gameElementList.ForEach(element => element.BeforeStart());
GameManager.instance.gameUICanvas.readyText.DOFade(1, 0.5f)
.SetLoops(4, LoopType.Yoyo).SetEase(Ease.InOutFlash).Play();
Observable.Timer(TimeSpan.FromSeconds(2)).First().Subscribe(_ =>
fakeLoadObserver.Dispose();
Observable.Timer(TimeSpan.FromSeconds(1f)).First().Subscribe(_ =>
{
GameManager.instance.audioManager.isDelaying = true;
GameManager.instance.audioManager.isStarting = false;
Observable.NextFrame().Subscribe(_=>
GameManager.instance.gameLoadingCanvas.FadeOut();
GameManager.instance.audioManager.isLoading = false;
GameManager.instance.beatmapContainer.gameElementList.ForEach(element => element.BeforeStart());
GameManager.instance.gameUICanvas.readyText.DOFade(1, 0.5f)
.SetLoops(4, LoopType.Yoyo).SetEase(Ease.InOutFlash).Play();
Observable.Timer(TimeSpan.FromSeconds(2)).First().Subscribe(_ =>
{
GameManager.instance.beatmapContainer.gameElementList.ForEach(element => element.WhenStart());
GameManager.instance.audioManager.isDelaying = true;
GameManager.instance.audioManager.isStarting = false;
Observable.NextFrame().Subscribe(_ =>
{
GameManager.instance.beatmapContainer.gameElementList.ForEach(element => element.WhenStart());
});
});
});
});