summaryrefslogtreecommitdiff
path: root/Scripts/Game/StatusLine.cs
diff options
context:
space:
mode:
authorSophia Pearson <codergal89@gmail.com>2022-09-04 15:43:12 +0200
committerSophia Pearson <codergal89@gmail.com>2022-09-04 15:44:04 +0200
commit2f3abbb6f1141f15ef77ac27e431bc66bb0c7899 (patch)
tree17f7ee50161e1de1c11c6dd14a54a11614e7de03 /Scripts/Game/StatusLine.cs
parent0967a4654c9fa67b5cfc19edf3cfc075bf6bde92 (diff)
downloadtexty-2f3abbb6f1141f15ef77ac27e431bc66bb0c7899.tar.xz
texty-2f3abbb6f1141f15ef77ac27e431bc66bb0c7899.zip
game: adapt scripts to new design
Diffstat (limited to 'Scripts/Game/StatusLine.cs')
-rw-r--r--Scripts/Game/StatusLine.cs45
1 files changed, 21 insertions, 24 deletions
diff --git a/Scripts/Game/StatusLine.cs b/Scripts/Game/StatusLine.cs
index 4a3fb23..ef98a0a 100644
--- a/Scripts/Game/StatusLine.cs
+++ b/Scripts/Game/StatusLine.cs
@@ -2,29 +2,26 @@ using Godot;
namespace Texty.Scripts.Game
{
- public class StatusLine : PanelContainer
- {
- private string _titleText = "Title Text";
-
- [Export]
- public string Title
- {
- get => _titleText;
- set
- {
- if (TitleLabel != null)
- TitleLabel.Text = value;
- _titleText = value;
- }
- }
+ public class StatusLine : PanelContainer
+ {
+ private string _titleText = "Title Text";
+ private RichTextLabel TitleLabel => GetNodeOrNull<RichTextLabel>($"%{nameof(TitleLabel)}");
- public RichTextLabel TitleLabel;
-
- public override void _Ready()
- {
- TitleLabel = GetNode<RichTextLabel>($"%{nameof(TitleLabel)}");
- TitleLabel.Text = _titleText;
- }
- }
-}
+ [Export]
+ public string Title
+ {
+ get => _titleText;
+ set
+ {
+ _titleText = value;
+ if (TitleLabel != null)
+ TitleLabel.Text = GodotSharp.Singleton.Tr(value);
+ }
+ }
+ public override void _Ready()
+ {
+ Title = _titleText;
+ }
+ }
+} \ No newline at end of file