1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-07 21:33:16 +08:00

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(); base.Update();
int? minute = null; int? lastMinutes = null;
for (int i = 0; i < ChatLineFlow.Count; i++) for (int i = 0; i < ChatLineFlow.Count; i++)
{ {
if (ChatLineFlow[i] is ChatLine chatline) if (ChatLineFlow[i] is ChatLine chatline)
{ {
int minutes = chatline.Message.Timestamp.TotalOffsetMinutes;
chatline.AlternatingBackground = i % 2 == 0; chatline.AlternatingBackground = i % 2 == 0;
chatline.RequiresTimestamp = chatline.Message.Timestamp.Minute != minute; chatline.RequiresTimestamp = minutes != lastMinutes;
minute = chatline.Message.Timestamp.Minute; lastMinutes = minutes;
} }
} }
} }