summaryrefslogtreecommitdiff
path: root/scripts/GUI/Message.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-09 19:09:34 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-09 19:09:34 -0300
commitc6bbb834f7758027c0df338f1520f34fad3befea (patch)
tree1818cd23c24be16fbe19b16dd0a510874d440d83 /scripts/GUI/Message.cs
parentf1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c (diff)
Organização
Diffstat (limited to 'scripts/GUI/Message.cs')
-rw-r--r--scripts/GUI/Message.cs45
1 files changed, 31 insertions, 14 deletions
diff --git a/scripts/GUI/Message.cs b/scripts/GUI/Message.cs
index b0472ee..11f3532 100644
--- a/scripts/GUI/Message.cs
+++ b/scripts/GUI/Message.cs
@@ -1,32 +1,49 @@
using Godot;
+namespace TheLegendOfGustav.GUI;
+
public partial class Message : Label
{
- private static LabelSettings baseSettings = GD.Load<LabelSettings>("res://assets/definitions/message_label_settings.tres");
+ private static readonly LabelSettings baseSettings = GD.Load<LabelSettings>("res://assets/definitions/message_label_settings.tres");
+
private string plainText;
- public string PlainText { get => plainText; }
private int count = 1;
- public int Count {
+
+ public Message(string text)
+ {
+ PlainText = text;
+ Text = text;
+ LabelSettings = (LabelSettings)baseSettings.Duplicate();
+ AutowrapMode = TextServer.AutowrapMode.WordSmart;
+ }
+
+ public string PlainText
+ {
+ get => plainText;
+ private set
+ {
+ plainText = value;
+ }
+ }
+ public int Count
+ {
get => count;
- set {
+ set
+ {
count = value;
Text = FullText;
}
}
- public string FullText {
- get {
- if (count > 1) {
+ public string FullText
+ {
+ get
+ {
+ if (count > 1)
+ {
return $"{plainText} ({count})";
}
return plainText;
}
}
-
- public Message(string text) {
- plainText = text;
- Text = text;
- LabelSettings = (LabelSettings) baseSettings.Duplicate();
- AutowrapMode = TextServer.AutowrapMode.WordSmart;
- }
}