diff options
Diffstat (limited to 'Scripts/Terminal/OutputBlock.cs')
| -rw-r--r-- | Scripts/Terminal/OutputBlock.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Scripts/Terminal/OutputBlock.cs b/Scripts/Terminal/OutputBlock.cs new file mode 100644 index 0000000..b611cb5 --- /dev/null +++ b/Scripts/Terminal/OutputBlock.cs @@ -0,0 +1,28 @@ +using Godot; + +namespace Texty.Scripts.Terminal +{ + public class OutputBlock : MarginContainer + { + private string _content = ""; + + private RichTextLabel ContentLabel => GetNodeOrNull<RichTextLabel>($"%{nameof(ContentLabel)}"); + + [Export(PropertyHint.MultilineText)] + public string Content + { + get => ContentLabel?.BbcodeText ?? ""; + set + { + _content = value; + if (ContentLabel != null) + ContentLabel.BbcodeText = GodotSharp.Singleton.Tr(_content); + } + } + + public override void _Ready() + { + Content = _content; + } + } +}
\ No newline at end of file |
