Rework loading maps to be asynchronous, change debug menu so that its not completely pausing the game
This commit is contained in:
@@ -24,7 +24,7 @@ public partial class App : Node, IApp
|
||||
|
||||
[Node] private MainMenu MainMenu { get; set; } = default!;
|
||||
|
||||
[Node] private Control LoadingScreen { get; set; } = default!;
|
||||
[Node] private LoadingScreen LoadingScreen { get; set; } = default!;
|
||||
|
||||
public IInstantiator Instantiator { get; set; } = default!;
|
||||
|
||||
@@ -118,6 +118,7 @@ public partial class App : Node, IApp
|
||||
if (_loadingGame)
|
||||
{
|
||||
ResourceLoader.LoadThreadedGetStatus(GAME_SCENE_PATH, _progress);
|
||||
LoadingScreen.ProgressBar.Value = (double)_progress.Single();
|
||||
if ((double)_progress.Single() == 1)
|
||||
_loadedScene.OnNext(GAME_SCENE_PATH);
|
||||
}
|
||||
@@ -125,6 +126,7 @@ public partial class App : Node, IApp
|
||||
if (_loadingEnemyViewer)
|
||||
{
|
||||
ResourceLoader.LoadThreadedGetStatus(ENEMY_VIEWER_PATH, _progress);
|
||||
LoadingScreen.ProgressBar.Value = (double)_progress.Single();
|
||||
if ((double)_progress.Single() == 1)
|
||||
_loadedScene.OnNext(ENEMY_VIEWER_PATH);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user