diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-11-04 18:14:43 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-11-04 18:14:43 -0300 |
| commit | d312f5a470c9f3cde27ed44492c13ae7d6bd2fe5 (patch) | |
| tree | 61f46ae40eecf18c2c267d35406ff6f312337e06 /scripts/GUI/PlayerName.cs | |
| parent | 63e4f75e9292e1276cc0b5d11ebad010f147aa68 (diff) | |
Definir nome de jogador
Diffstat (limited to 'scripts/GUI/PlayerName.cs')
| -rw-r--r-- | scripts/GUI/PlayerName.cs | 24 |
1 files changed, 24 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); + } +} |
