diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-09-07 11:22:35 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-09-07 11:22:35 +0200 |
| commit | ccd374cbedd87528c85d497fa7bef9b0c90815e9 (patch) | |
| tree | d146de06e0d91a30d37b6d8ccb4d6e5b7dceda03 /Scripts/Terminal/MenuScreen.cs | |
| parent | 23a3b14f4d3662f20d7202aeb569b789b520ba57 (diff) | |
| download | texty-ccd374cbedd87528c85d497fa7bef9b0c90815e9.tar.xz texty-ccd374cbedd87528c85d497fa7bef9b0c90815e9.zip | |
menus: implement main menu and building blocks
Diffstat (limited to 'Scripts/Terminal/MenuScreen.cs')
| -rw-r--r-- | Scripts/Terminal/MenuScreen.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Scripts/Terminal/MenuScreen.cs b/Scripts/Terminal/MenuScreen.cs new file mode 100644 index 0000000..5c3abfb --- /dev/null +++ b/Scripts/Terminal/MenuScreen.cs @@ -0,0 +1,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; + } + } +}
\ No newline at end of file |
