summaryrefslogtreecommitdiff
path: root/Scripts/Game
diff options
context:
space:
mode:
authorSophia Pearson <codergal89@gmail.com>2022-10-03 22:22:50 +0200
committerSophia Pearson <codergal89@gmail.com>2022-10-04 22:18:18 +0200
commite127ad39e742396030352240d829bc903b1d4464 (patch)
tree10cc21d70bf13181aef7c8ad0344077ff63579a3 /Scripts/Game
parentddbb045f6387a8ba23b1210b27a745516a387a52 (diff)
downloadtexty-e127ad39e742396030352240d829bc903b1d4464.tar.xz
texty-e127ad39e742396030352240d829bc903b1d4464.zip
godot: inital Godot 4 migration
Diffstat (limited to 'Scripts/Game')
-rw-r--r--Scripts/Game/Command.cs2
-rw-r--r--Scripts/Game/CommandInputArea.cs12
-rw-r--r--Scripts/Game/CommandParser.cs2
-rw-r--r--Scripts/Game/Commands/LookCommand.cs2
-rw-r--r--Scripts/Game/Game.cs2
5 files changed, 10 insertions, 10 deletions
diff --git a/Scripts/Game/Command.cs b/Scripts/Game/Command.cs
index 07d7c84..20b8437 100644
--- a/Scripts/Game/Command.cs
+++ b/Scripts/Game/Command.cs
@@ -7,7 +7,7 @@ namespace Texty.Scripts.Game
Look
}
- public class Command : Object
+ public partial class Command : Object
{
public Command()
{
diff --git a/Scripts/Game/CommandInputArea.cs b/Scripts/Game/CommandInputArea.cs
index 2f1fc09..af54a15 100644
--- a/Scripts/Game/CommandInputArea.cs
+++ b/Scripts/Game/CommandInputArea.cs
@@ -4,10 +4,10 @@ using Texty.Scripts.Terminal;
namespace Texty.Scripts.Game
{
[Tool]
- public class CommandInputArea : InputArea
+ public partial class CommandInputArea : InputArea
{
- [Signal] public delegate void CommandSubmitted(Command command);
- [Signal] public delegate void UnknownInputSubmitted(string text);
+ [Signal] public delegate void CommandSubmittedEventHandler(Command command);
+ [Signal] public delegate void UnknownInputSubmittedEventHandler(string text);
private CommandParser CommandParser => GetNodeOrNull<CommandParser>($"%{nameof(CommandParser)}");
@@ -18,15 +18,15 @@ namespace Texty.Scripts.Game
public override void OnTextEntered(string text)
{
- if (text.Empty())
+ if (text.Length == 0)
return;
TextInput.Clear();
var command = CommandParser.TryParse(text);
if (command != null)
- EmitSignal(nameof(CommandSubmitted), command);
+ EmitSignal(SignalName.CommandSubmitted, command);
else
- EmitSignal(nameof(UnknownInputSubmitted), text);
+ EmitSignal(SignalName.UnknownInputSubmitted, text);
}
}
} \ No newline at end of file
diff --git a/Scripts/Game/CommandParser.cs b/Scripts/Game/CommandParser.cs
index 5f8249a..9b02ee5 100644
--- a/Scripts/Game/CommandParser.cs
+++ b/Scripts/Game/CommandParser.cs
@@ -4,7 +4,7 @@ using Texty.Scripts.Commands;
namespace Texty.Scripts.Game
{
- public class CommandParser : Node
+ public partial class CommandParser : Node
{
public override void _Ready()
{
diff --git a/Scripts/Game/Commands/LookCommand.cs b/Scripts/Game/Commands/LookCommand.cs
index b7910cc..22ba77e 100644
--- a/Scripts/Game/Commands/LookCommand.cs
+++ b/Scripts/Game/Commands/LookCommand.cs
@@ -9,7 +9,7 @@ namespace Texty.Scripts.Commands
Around
}
- public class LookCommand : Command
+ public partial class LookCommand : Command
{
public LookCommand()
{
diff --git a/Scripts/Game/Game.cs b/Scripts/Game/Game.cs
index ff7e4f7..07d42b2 100644
--- a/Scripts/Game/Game.cs
+++ b/Scripts/Game/Game.cs
@@ -3,7 +3,7 @@ using Texty.Scripts.Terminal;
namespace Texty.Scripts.Game
{
- public class Game : Node
+ public partial class Game : Node
{
private InputArea InputArea => GetNodeOrNull<InputArea>($"%{nameof(InputArea)}");
private OutputArea OutputArea => GetNodeOrNull<OutputArea>($"%{nameof(OutputArea)}");