diff options
Diffstat (limited to 'Scripts/Game.cs')
| -rw-r--r-- | Scripts/Game.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Scripts/Game.cs b/Scripts/Game.cs new file mode 100644 index 0000000..645c922 --- /dev/null +++ b/Scripts/Game.cs @@ -0,0 +1,30 @@ +using System.Diagnostics; +using Godot; + +namespace Texty.Scripts +{ + public abstract class Game : MarginContainer + { + public VBoxContainer LayoutContainer; + public OutputContainer OutputContainer; + + [Export(PropertyHint.File, "*.tscn")] public PackedScene OutputRowScene; + + public override void _Ready() + { + Debug.Assert(OutputRowScene != null, $"The {nameof(OutputRowScene)} was not set!"); + + LayoutContainer = GetNode<VBoxContainer>(nameof(LayoutContainer)); + OutputContainer = LayoutContainer.GetNode<OutputContainer>(nameof(OutputContainer)); + } + + public void OnInputSubmitted(string text) + { + var newRow = OutputRowScene.Instance<OutputRow>(); + newRow.InputText = text; + newRow.OutputText = "THE OUTPUT SHOULD GO HERE!"; + + OutputContainer.Add(newRow); + } + } +}
\ No newline at end of file |
