removes a bit of jank from bwoinkwindow

sorta fixes sorting
This commit is contained in:
Paul
2022-01-03 02:36:25 +01:00
parent df9aecb6a0
commit 7e266b41ff
5 changed files with 34 additions and 17 deletions

View File

@@ -1,4 +1,6 @@
#nullable enable
using System;
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
@@ -14,6 +16,7 @@ namespace Content.Client.Administration.UI.CustomControls
public readonly NetUserId ChannelId;
public int Unread { get; private set; } = 0;
public DateTime LastMessage { get; private set; }
public BwoinkPanel(BwoinkSystem bwoinkSys, NetUserId userId)
{
@@ -37,13 +40,15 @@ namespace Content.Client.Administration.UI.CustomControls
SenderLineEdit.Clear();
}
public void ReceiveLine(string text)
public void ReceiveLine(SharedBwoinkSystem.BwoinkTextMessage message)
{
if (!Visible)
Unread++;
var formatted = new FormattedMessage(1);
formatted.AddMarkup(text);
formatted.AddMarkup($"[color=gray]{message.SentAt.ToShortTimeString()}[/color] {message.Text}");
TextOutput.AddMessage(formatted);
LastMessage = message.SentAt;
}
}
}