Merge pull request #12973 from rob-v/SortPlayingGamesInLobby

Sort 'Playing' games in the lobby by play time. #12959
This commit is contained in:
Oliver Brakmann
2017-04-01 19:20:01 +02:00
committed by GitHub

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(() =>
{