summaryrefslogtreecommitdiff
path: root/scripts/GameManager.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-11-04 18:14:43 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-11-04 18:14:43 -0300
commitd312f5a470c9f3cde27ed44492c13ae7d6bd2fe5 (patch)
tree61f46ae40eecf18c2c267d35406ff6f312337e06 /scripts/GameManager.cs
parent63e4f75e9292e1276cc0b5d11ebad010f147aa68 (diff)
Definir nome de jogador
Diffstat (limited to 'scripts/GameManager.cs')
-rw-r--r--scripts/GameManager.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/GameManager.cs b/scripts/GameManager.cs
index a17ae79..5898744 100644
--- a/scripts/GameManager.cs
+++ b/scripts/GameManager.cs
@@ -1,6 +1,5 @@
+using System.Diagnostics;
using Godot;
-using GodotPlugins.Game;
-using System;
using TheLegendOfGustav.GUI;
using TheLegendOfGustav.Utils;
@@ -10,6 +9,7 @@ public partial class GameManager : Node
{
private PackedScene mainMenuScene = GD.Load<PackedScene>("res://scenes/GUI/main_menu.tscn");
private PackedScene gameScene = GD.Load<PackedScene>("res://scenes/Game.tscn");
+ private PackedScene nameScene = GD.Load<PackedScene>("res://scenes/name_thyself.tscn");
private Node currentScene;
@@ -56,19 +56,30 @@ public partial class GameManager : Node
}
}
- private void NewGame()
+ private void NewGame(string name)
{
MessageLogData.Instance.ClearMessages();
Game game = (Game)SwitchToScene(gameScene);
- game.NewGame();
+ game.NewGame(name);
game.MainMenuRequested += LoadMainMenu;
}
+ private void SelectName()
+ {
+ PlayerName namesc = (PlayerName)SwitchToScene(nameScene);
+ namesc.NewGameRequest += OnNameSelect;
+ }
+
+ private void OnNameSelect(string name)
+ {
+ NewGame(name);
+ }
+
private void OnGameRequest(bool load)
{
if (!load)
{
- NewGame();
+ SelectName();
}
else
{