summaryrefslogtreecommitdiff
path: root/scripts/GameManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/GameManager.cs')
-rw-r--r--scripts/GameManager.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/scripts/GameManager.cs b/scripts/GameManager.cs
index 8bc8b6b..a17ae79 100644
--- a/scripts/GameManager.cs
+++ b/scripts/GameManager.cs
@@ -50,10 +50,29 @@ public partial class GameManager : Node
MessageLogData.Instance.ClearMessages();
Game game = (Game)SwitchToScene(gameScene);
game.MainMenuRequested += LoadMainMenu;
+ if (!game.LoadGame())
+ {
+ SwitchToScene(mainMenuScene);
+ }
+ }
+
+ private void NewGame()
+ {
+ MessageLogData.Instance.ClearMessages();
+ Game game = (Game)SwitchToScene(gameScene);
+ game.NewGame();
+ game.MainMenuRequested += LoadMainMenu;
}
private void OnGameRequest(bool load)
{
- LoadGame();
+ if (!load)
+ {
+ NewGame();
+ }
+ else
+ {
+ LoadGame();
+ }
}
}