diff options
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); |
