From 260681d0484c98ab469153325a93b737036afd79 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 11 Jan 2016 23:54:55 +0000 Subject: [PATCH] Sort missions by their order in missions.yaml. --- OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index 329eeaaa88..8cce2ffbb3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -103,11 +103,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic var yaml = MiniYaml.ApplyRemovals(partial); foreach (var kv in yaml) { - var missionMapPaths = kv.Value.Nodes.Select(n => Path.GetFullPath(n.Key)); + var missionMapPaths = kv.Value.Nodes.Select(n => Path.GetFullPath(n.Key)).ToList(); var maps = Game.ModData.MapCache .Where(p => p.Status == MapStatus.Available && missionMapPaths.Contains(Path.GetFullPath(p.Map.Path))) - .Select(p => p.Map); + .Select(p => p.Map) + .OrderBy(m => missionMapPaths.IndexOf(Path.GetFullPath(m.Path))); CreateMissionGroup(kv.Key, maps); allMaps.AddRange(maps);