summaryrefslogtreecommitdiff
path: root/Scripts/Terminal/StatusArea.cs
blob: 3099168d732c62a7ebf7e79fb1fc87a892119f8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Godot;

namespace Texty.Scripts.Terminal
{
    [Tool]
    public partial class StatusArea : HBoxContainer
    {
        private string _titleText = "";
        private RichTextLabel TitleLabel => GetNodeOrNull<RichTextLabel>($"%{nameof(TitleLabel)}");

        [Export]
        public string Title
        {
            get => _titleText;
            set
            {
                _titleText = value;
                if (TitleLabel != null)
                    TitleLabel.Text = GodotSharp.Singleton.Tr(value);
            }
        }

        public override void _Ready()
        {
            Title = _titleText;
        }
    }
}