diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-09 19:09:34 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-09 19:09:34 -0300 |
| commit | c6bbb834f7758027c0df338f1520f34fad3befea (patch) | |
| tree | 1818cd23c24be16fbe19b16dd0a510874d440d83 /scripts/GUI/MessageLog.cs | |
| parent | f1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c (diff) | |
Organização
Diffstat (limited to 'scripts/GUI/MessageLog.cs')
| -rw-r--r-- | scripts/GUI/MessageLog.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/GUI/MessageLog.cs b/scripts/GUI/MessageLog.cs index d481b19..1fc59b6 100644 --- a/scripts/GUI/MessageLog.cs +++ b/scripts/GUI/MessageLog.cs @@ -1,24 +1,28 @@ using Godot; -using System; using System.Threading.Tasks; +using TheLegendOfGustav.Utils; + +namespace TheLegendOfGustav.GUI; public partial class MessageLog : ScrollContainer { - private VBoxContainer MessageList; + private VBoxContainer MessageList { get; set; } public override void _Ready() { base._Ready(); MessageList = GetNode<VBoxContainer>("MessageList"); - foreach (Message msg in MessageLogData.Instance.Messages) { + foreach (Message msg in MessageLogData.Instance.Messages) + { _ = AddMessageAsync(msg); } MessageLogData.Instance.messageSent += async (Message msg) => await AddMessageAsync(msg); } - private async Task AddMessageAsync(Message message) { + private async Task AddMessageAsync(Message message) + { MessageList.AddChild(message); await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame); EnsureControlVisible(message); |
