summaryrefslogtreecommitdiff
path: root/Scripts/Game/Input.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/Game/Input.cs')
-rw-r--r--Scripts/Game/Input.cs32
1 files changed, 0 insertions, 32 deletions
diff --git a/Scripts/Game/Input.cs b/Scripts/Game/Input.cs
deleted file mode 100644
index 90a9962..0000000
--- a/Scripts/Game/Input.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Godot;
-
-namespace Texty.Scripts.Game
-{
- public class Input : PanelContainer
- {
- [Signal] public delegate void CommandSubmitted(Command command);
- [Signal] public delegate void UnknownInputSubmitted(string text);
-
- private CommandParser CommandParser => GetNodeOrNull<CommandParser>($"%{nameof(CommandParser)}");
- private Label PromptLabel => GetNodeOrNull<Label>($"%{nameof(PromptLabel)}");
- private LineEdit TextInput => GetNodeOrNull<LineEdit>($"%{nameof(TextInput)}");
-
- public override void _Ready()
- {
- TextInput.GrabFocus();
- }
-
- public void OnTextEntered(string text)
- {
- if (text.Empty())
- return;
-
- TextInput.Clear();
- var command = CommandParser.TryParse(text);
- if (command != null)
- EmitSignal(nameof(CommandSubmitted), command);
- else
- EmitSignal(nameof(UnknownInputSubmitted), text);
- }
- }
-} \ No newline at end of file