From f4ed469fc9eaeebf39093fbf6601581cc10c6e2f Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 26 Oct 2025 20:02:15 -0300 Subject: feat:save AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O vazio dentro de mim é como uma xícara de café esquecida no canto da mesa. --- scripts/GameManager.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'scripts/GameManager.cs') 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(); + } } } -- cgit v1.2.3