summaryrefslogtreecommitdiff
path: root/Scripts/Terminal/MenuScreen.cs
blob: 5c3abfb577508e388838a0e510310c50b7fe3362 (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 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;
        }
    }
}