From e127ad39e742396030352240d829bc903b1d4464 Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Mon, 3 Oct 2022 22:22:50 +0200 Subject: godot: inital Godot 4 migration --- Scripts/Game/Command.cs | 2 +- Scripts/Game/CommandInputArea.cs | 12 ++++++------ Scripts/Game/CommandParser.cs | 2 +- Scripts/Game/Commands/LookCommand.cs | 2 +- Scripts/Game/Game.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'Scripts/Game') 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($"%{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($"%{nameof(InputArea)}"); private OutputArea OutputArea => GetNodeOrNull($"%{nameof(OutputArea)}"); -- cgit v1.2.3