Skip to content

Commit

Permalink
Fix Bwoink Player sorting again.... (space-wizards#30580)
Browse files Browse the repository at this point in the history
Keep players that have had messages in the round at the top
  • Loading branch information
Titian3 authored Aug 2, 2024
1 parent 858f954 commit a2f27f9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ public BwoinkControl()
if (a.IsPinned != b.IsPinned)
return a.IsPinned ? -1 : 1;
// First, sort by unread. Any chat with unread messages appears first. We just sort based on unread
// status, not number of unread messages, so that more recent unread messages take priority.
// First, sort by unread. Any chat with unread messages appears first.
var aUnread = ach.Unread > 0;
var bUnread = bch.Unread > 0;
if (aUnread != bUnread)
return aUnread ? -1 : 1;
// Sort by recent messages during the current round.
var aRecent = a.ActiveThisRound && ach.LastMessage != DateTime.MinValue;
var bRecent = b.ActiveThisRound && bch.LastMessage != DateTime.MinValue;
if (aRecent != bRecent)
return aRecent ? -1 : 1;
// Next, sort by connection status. Any disconnected players are grouped towards the end.
if (a.Connected != b.Connected)
return a.Connected ? -1 : 1;
Expand Down

0 comments on commit a2f27f9

Please sign in to comment.