Fix edge case where minutes are same but hour is different

This commit is contained in:
Dean Herbert 2024-07-30 18:06:56 +09:00
parent 7229ae83ea
commit 25747fdeb3
No known key found for this signature in database

View File

@ -88,15 +88,17 @@ namespace osu.Game.Overlays.Chat
{
base.Update();
int? minute = null;
int? lastMinutes = null;
for (int i = 0; i < ChatLineFlow.Count; i++)
{
if (ChatLineFlow[i] is ChatLine chatline)
{
int minutes = chatline.Message.Timestamp.TotalOffsetMinutes;
chatline.AlternatingBackground = i % 2 == 0;
chatline.RequiresTimestamp = chatline.Message.Timestamp.Minute != minute;
minute = chatline.Message.Timestamp.Minute;
chatline.RequiresTimestamp = minutes != lastMinutes;
lastMinutes = minutes;
}
}
}