Overhaul item and inventory and clean up bits and pieces
This commit is contained in:
@@ -146,7 +146,7 @@ public partial class App : Node, IApp
|
||||
})
|
||||
.Handle((in AppLogic.Output.SetupGameScene _) =>
|
||||
{
|
||||
LoadingScreen.Show();
|
||||
LoadingScreen.ShowLoadingScreen();
|
||||
LoadGame(GAME_SCENE_PATH);
|
||||
})
|
||||
.Handle((in AppLogic.Output.ShowMainMenu _) =>
|
||||
@@ -155,7 +155,7 @@ public partial class App : Node, IApp
|
||||
})
|
||||
.Handle((in AppLogic.Output.CloseGame _) =>
|
||||
{
|
||||
LoadingScreen.Hide();
|
||||
LoadingScreen.HideLoadingScreen();
|
||||
_game.GameExitRequested -= GameExitRequested;
|
||||
MainMenu.StartGameButton.GrabFocus();
|
||||
_game.CallDeferred(MethodName.QueueFree, []);
|
||||
@@ -166,13 +166,13 @@ public partial class App : Node, IApp
|
||||
})
|
||||
.Handle((in AppLogic.Output.EnemyViewerOpened _) =>
|
||||
{
|
||||
LoadingScreen.Show();
|
||||
LoadingScreen.ShowLoadingScreen();
|
||||
MainMenu.Hide();
|
||||
LoadEnemyViewer(ENEMY_VIEWER_PATH);
|
||||
})
|
||||
.Handle((in AppLogic.Output.EnemyViewerExited _) =>
|
||||
{
|
||||
LoadingScreen.Hide();
|
||||
LoadingScreen.HideLoadingScreen();
|
||||
if (_enemyViewer != null && _enemyViewer is DataViewer enemyViewer)
|
||||
enemyViewer.CallDeferred(MethodName.QueueFree);
|
||||
MainMenu.Show();
|
||||
@@ -203,24 +203,22 @@ public partial class App : Node, IApp
|
||||
_game = scene as IGame;
|
||||
_game.GameLoaded += OnGameLoaded;
|
||||
_game.GameExitRequested += GameExitRequested;
|
||||
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
|
||||
CallDeferred(MethodName.AddChild, scene);
|
||||
}
|
||||
|
||||
private void OnGameLoaded() => LoadingScreen.Hide();
|
||||
private void OnGameLoaded() => LoadingScreen.HideLoadingScreen();
|
||||
|
||||
private async void LoadEnemyViewer(string sceneName)
|
||||
{
|
||||
var scene = await LoadSceneInternal(sceneName);
|
||||
_enemyViewer = scene as IDataViewer;
|
||||
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
|
||||
CallDeferred(MethodName.AddChild, scene);
|
||||
LoadingScreen.Hide();
|
||||
LoadingScreen.HideLoadingScreen();
|
||||
}
|
||||
|
||||
private async Task<Node> LoadSceneInternal(string sceneName)
|
||||
{
|
||||
LoadingScreen.Show();
|
||||
LoadingScreen.ShowLoadingScreen();
|
||||
LoadingScreen.ProgressBar.Value = 0;
|
||||
var sceneLoader = new SceneLoader();
|
||||
CallDeferred(MethodName.AddChild, sceneLoader);
|
||||
|
||||
Reference in New Issue
Block a user