Process shared map includes as part of the mod rules.

This ensures that they are only updated once instead
of repeating the updates for every map that includes them.
This commit is contained in:
Paul Chote
2018-03-30 16:04:58 +00:00
committed by abcdefg30
parent 02f769964e
commit 2400b152ea
3 changed files with 98 additions and 39 deletions

View File

@@ -82,9 +82,10 @@ namespace OpenRA.Mods.Common.UtilityCommands
Console.Write(" Updating map... ");
var externalFilenames = new HashSet<string>();
try
{
manualSteps = UpdateUtils.UpdateMap(modData, mapPackage, rule, out mapFiles);
manualSteps = UpdateUtils.UpdateMap(modData, mapPackage, rule, out mapFiles, externalFilenames);
}
catch (Exception ex)
{
@@ -104,6 +105,13 @@ namespace OpenRA.Mods.Common.UtilityCommands
mapFiles.Save();
Console.WriteLine("COMPLETE");
if (externalFilenames.Any())
{
Console.WriteLine(" The following shared yaml files referenced by the map have been ignored:");
Console.WriteLine(UpdateUtils.FormatMessageList(externalFilenames, 1));
Console.WriteLine(" These files are assumed to have already been updated by the --update-mod command");
}
if (manualSteps.Any())
{
Console.WriteLine(" Manual changes are required to complete this update:");

View File

@@ -146,15 +146,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
Console.Write(" Updating system maps... ");
if (!skipMaps)
{
var mapsFailed = false;
var externalFilenames = new HashSet<string>();
foreach (var package in modData.MapCache.EnumerateMapPackagesWithoutCaching())
{
try
{
YamlFileSet mapFiles;
var mapSteps = UpdateUtils.UpdateMap(modData, package, rule, out mapFiles);
var mapSteps = UpdateUtils.UpdateMap(modData, package, rule, out mapFiles, externalFilenames);
allFiles.AddRange(mapFiles);
if (mapSteps.Any())