summaryrefslogtreecommitdiff
path: root/Scripts/Terminal/StatusArea.cs
blob: 83577358ab75d3f2818040405143107a52bf437f (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
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;
    }
}