diff options
Diffstat (limited to 'scripts/GUI')
| -rw-r--r-- | scripts/GUI/PlayerName.cs | 24 | ||||
| -rw-r--r-- | scripts/GUI/PlayerName.cs.uid | 1 |
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 |
