summaryrefslogtreecommitdiff
path: root/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/Game/Input.cs11
-rw-r--r--Scripts/Game/Output.cs2
-rw-r--r--Scripts/Game/StatusLine.cs4
3 files changed, 11 insertions, 6 deletions
diff --git a/Scripts/Game/Input.cs b/Scripts/Game/Input.cs
index 2342ac2..90a9962 100644
--- a/Scripts/Game/Input.cs
+++ b/Scripts/Game/Input.cs
@@ -8,17 +8,20 @@ namespace Texty.Scripts.Game
[Signal] public delegate void UnknownInputSubmitted(string text);
private CommandParser CommandParser => GetNodeOrNull<CommandParser>($"%{nameof(CommandParser)}");
- private Label Prompt => GetNodeOrNull<Label>($"%{nameof(Prompt)}");
- private LineEdit Text => GetNodeOrNull<LineEdit>($"%{nameof(Text)}");
+ private Label PromptLabel => GetNodeOrNull<Label>($"%{nameof(PromptLabel)}");
+ private LineEdit TextInput => GetNodeOrNull<LineEdit>($"%{nameof(TextInput)}");
public override void _Ready()
{
- Text.GrabFocus();
+ TextInput.GrabFocus();
}
public void OnTextEntered(string text)
{
- Text.Clear();
+ if (text.Empty())
+ return;
+
+ TextInput.Clear();
var command = CommandParser.TryParse(text);
if (command != null)
EmitSignal(nameof(CommandSubmitted), command);
diff --git a/Scripts/Game/Output.cs b/Scripts/Game/Output.cs
index be943f7..abd3328 100644
--- a/Scripts/Game/Output.cs
+++ b/Scripts/Game/Output.cs
@@ -22,6 +22,7 @@ namespace Texty.Scripts.Game
{
Debug.Assert(OutputBlockScene != null, "OutputBlockScene has not been configured!");
Debug.Assert(OutputBlockScene.CanInstance(), "OutputBlockScene can not be instanced!");
+ Clear();
}
public void Clear()
@@ -35,6 +36,7 @@ namespace Texty.Scripts.Game
public void Push(string text)
{
+ if (text.Empty()) return;
var block = OutputBlockScene.Instance<OutputBlock>();
block.Content = text;
LineContainer.AddChild(block);
diff --git a/Scripts/Game/StatusLine.cs b/Scripts/Game/StatusLine.cs
index ef98a0a..8e19cb4 100644
--- a/Scripts/Game/StatusLine.cs
+++ b/Scripts/Game/StatusLine.cs
@@ -4,7 +4,7 @@ namespace Texty.Scripts.Game
{
public class StatusLine : PanelContainer
{
- private string _titleText = "Title Text";
+ private string _titleText = "";
private RichTextLabel TitleLabel => GetNodeOrNull<RichTextLabel>($"%{nameof(TitleLabel)}");
[Export]
@@ -15,7 +15,7 @@ namespace Texty.Scripts.Game
{
_titleText = value;
if (TitleLabel != null)
- TitleLabel.Text = GodotSharp.Singleton.Tr(value);
+ TitleLabel.BbcodeText = GodotSharp.Singleton.Tr(value);
}
}