summaryrefslogtreecommitdiff
path: root/scripts/GUI
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/GUI
parent63e4f75e9292e1276cc0b5d11ebad010f147aa68 (diff)
Definir nome de jogador
Diffstat (limited to 'scripts/GUI')
-rw-r--r--scripts/GUI/PlayerName.cs24
-rw-r--r--scripts/GUI/PlayerName.cs.uid1
2 files changed, 25 insertions, 0 deletions
diff --git a/scripts/GUI/PlayerName.cs b/scripts/GUI/PlayerName.cs
new file mode 100644
index 0000000..f1f5a00
--- /dev/null
+++ b/scripts/GUI/PlayerName.cs
@@ -0,0 +1,24 @@
+using Godot;
+
+namespace TheLegendOfGustav.GUI;
+public partial class PlayerName : Control
+{
+
+ private LineEdit nameEdit;
+ private Button startButton;
+ [Signal]
+ public delegate void NewGameRequestEventHandler(string name);
+
+ public override void _Ready()
+ {
+ nameEdit = GetNode<LineEdit>("VBoxContainer/thename");
+ startButton = GetNode<Button>("VBoxContainer/Button");
+ startButton.Pressed += OnClick;
+ }
+
+ private void OnClick()
+ {
+ string name = nameEdit.Text;
+ EmitSignal(SignalName.NewGameRequest, name);
+ }
+}
diff --git a/scripts/GUI/PlayerName.cs.uid b/scripts/GUI/PlayerName.cs.uid
new file mode 100644
index 0000000..17f45c4
--- /dev/null
+++ b/scripts/GUI/PlayerName.cs.uid
@@ -0,0 +1 @@
+uid://cmtn05tqqh0t4