From 05d29ccce1898ed89c0b650c77242c2fa2805128 Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Fri, 20 May 2022 00:45:25 +0200 Subject: texty: initial commit --- Scripts/OutputRow.cs | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Scripts/OutputRow.cs (limited to 'Scripts/OutputRow.cs') diff --git a/Scripts/OutputRow.cs b/Scripts/OutputRow.cs new file mode 100644 index 0000000..15a6454 --- /dev/null +++ b/Scripts/OutputRow.cs @@ -0,0 +1,72 @@ +using System; +using Godot; + +namespace Texty.Scripts +{ + public abstract class OutputRow : VBoxContainer + { + [Signal] + public delegate void InputTextChanged(string newText); + + [Signal] + public delegate void OutputTextChanged(string newText); + + public Label Input; + public Label Output; + + private string _inputText = ""; + private string _outputText = ""; + + [Export] + public string InputText + { + get => _inputText; + set => UpdateText(Field.Input, value ?? ""); + } + + [Export] + public string OutputText + { + get => _outputText; + set => UpdateText(Field.Output, value ?? ""); + } + + public override void _Ready() + { + Input = GetNode