summaryrefslogtreecommitdiff
path: root/Scripts/Terminal/MenuScreen.cs
blob: ee6e7659f2fdd564bd5bb2d684ad732d89945fe9 (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
using Godot;

namespace Texty.Scripts.Terminal;

[Tool]
public partial class MenuScreen : Control
{
    private string _title = "";
    private StatusArea TitleArea => GetNodeOrNull<StatusArea>($"%{nameof(TitleArea)}");

    [Export]
    public string Title
    {
        get => _title;
        set
        {
            _title = value;
            if (TitleArea != null) TitleArea.Title = $"[center]{GodotSharp.Singleton.Tr(_title)}[/center]";
        }
    }

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