From c6bbb834f7758027c0df338f1520f34fad3befea Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 9 Sep 2025 19:09:34 -0300 Subject: Organização MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/GUI/MessageLog.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts/GUI/MessageLog.cs') 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("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); -- cgit v1.2.3