Enable comment and whitespace parsing where it is useful.

This commit is contained in:
Paul Chote
2018-05-07 19:07:21 +01:00
committed by reaperrr
parent df31690332
commit 82e2595beb
5 changed files with 19 additions and 17 deletions

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
foreach (var filename in modData.Manifest.ChromeLayout)
{
Console.WriteLine("# {0}:", filename);
var yaml = MiniYaml.FromFile(filename);
var yaml = MiniYaml.FromFile(filename, false);
FromChromeLayout(ref yaml, null,
translatableFields.Select(t => t.Name).Distinct(), null);
using (var file = new StreamWriter(filename))

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
{
include |= map.Package.Contains(f);
if (include)
nodes.AddRange(MiniYaml.FromStream(map.Open(f), f));
nodes.AddRange(MiniYaml.FromStream(map.Open(f), f, false));
else
includes.Add(f);
}

View File

@@ -62,8 +62,6 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (!args.Contains("--yes"))
{
Console.WriteLine("WARNING: This command will automatically rewrite your mod rules.");
Console.WriteLine("Side effects of this command may include changing the whitespace to ");
Console.WriteLine("match the default conventions, and any yaml comments will be removed.");
Console.WriteLine();
Console.WriteLine("We strongly recommend that you have a backup of your mod rules, and ");
Console.WriteLine("for best results, to use a Git client to review the line-by-line ");