Introduce MapCache and MapPreview for improved UI map previews.

This commit is contained in:
Paul Chote
2014-03-14 13:30:03 +13:00
parent 63068d5a7c
commit c30b18a9d6
20 changed files with 407 additions and 290 deletions

View File

@@ -9,6 +9,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Traits;
@@ -52,14 +53,16 @@ namespace OpenRA.Lint
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
Game.modData = new ModData(mod);
var maps = new Map[] { new Map() };
if (!string.IsNullOrEmpty(map))
maps = new Map[] { new Map(map) };
else
IEnumerable<Map> maps;
if (string.IsNullOrEmpty(map))
{
Game.modData.LoadMaps();
maps = Game.modData.AvailableMaps.Values.ToArray();
Game.modData.MapCache.LoadMaps();
maps = Game.modData.MapCache
.Where(m => m.Status == MapStatus.Available)
.Select(m => m.Map);
}
else
maps = new [] { new Map(map) };
foreach (var testMap in maps)
{