Sort 'Playing' games in the lobby by play time. #12959

This commit is contained in:
rob-v
2017-03-16 17:17:35 +01:00
parent eb77c57ac3
commit f38c5f3380

View File

@@ -391,10 +391,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return 3;
};
foreach (var loop in modGames.OrderBy(listOrder).ThenByDescending(g => g.Players))
foreach (var modGamesByState in modGames.GroupBy(listOrder).OrderBy(g => g.Key))
{
var game = loop;
if (game == null || Filtered(game))
// Sort 'Playing' games by Started, others by number of players
foreach (var game in modGamesByState.Key == 2 ? modGamesByState.OrderByDescending(g => g.Started) : modGamesByState.OrderByDescending(g => g.Players))
{
if (Filtered(game))
continue;
var canJoin = game.IsJoinable;
@@ -451,6 +453,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
rows.Add(item);
}
}
}
Game.RunAfterTick(() =>
{