summaryrefslogtreecommitdiff
path: root/scripts/GameManager.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-10-26 20:02:15 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-10-26 20:02:15 -0300
commitf4ed469fc9eaeebf39093fbf6601581cc10c6e2f (patch)
treed8f29ae3288e950b5fb1f5251845d57949ca2ac0 /scripts/GameManager.cs
parent639cd8cef403e9e66bf31e7888e786effac2b292 (diff)
feat:save AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
O vazio dentro de mim é como uma xícara de café esquecida no canto da mesa.
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();
+ }
}
}