diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-09-04 15:43:12 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-09-04 15:44:04 +0200 |
| commit | 2f3abbb6f1141f15ef77ac27e431bc66bb0c7899 (patch) | |
| tree | 17f7ee50161e1de1c11c6dd14a54a11614e7de03 /Scripts/Game/OutputBlock.cs | |
| parent | 0967a4654c9fa67b5cfc19edf3cfc075bf6bde92 (diff) | |
| download | texty-2f3abbb6f1141f15ef77ac27e431bc66bb0c7899.tar.xz texty-2f3abbb6f1141f15ef77ac27e431bc66bb0c7899.zip | |
game: adapt scripts to new design
Diffstat (limited to 'Scripts/Game/OutputBlock.cs')
| -rw-r--r-- | Scripts/Game/OutputBlock.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Scripts/Game/OutputBlock.cs b/Scripts/Game/OutputBlock.cs new file mode 100644 index 0000000..491958c --- /dev/null +++ b/Scripts/Game/OutputBlock.cs @@ -0,0 +1,28 @@ +using Godot; + +namespace Texty.Scripts.Game +{ + 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 |
