diff options
Diffstat (limited to 'scripts/GameManager.cs')
| -rw-r--r-- | scripts/GameManager.cs | 21 |
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(); + } } } |
