diff --git a/OpenRA.Mods.TS/UtilityCommands/LegacySequenceImporter.cs b/OpenRA.Mods.TS/UtilityCommands/LegacySequenceImporter.cs index aab43e75f1..29018ef6ab 100644 --- a/OpenRA.Mods.TS/UtilityCommands/LegacySequenceImporter.cs +++ b/OpenRA.Mods.TS/UtilityCommands/LegacySequenceImporter.cs @@ -27,6 +27,7 @@ namespace OpenRA.Mods.TS.UtilityCommands public string Name { get { return "--sequence-import"; } } IniFile file; + MapGrid grid; [Desc("FILENAME", "Convert ART.INI to the OpenRA sequence definition format.")] public void Run(ModData modData, string[] args) @@ -34,6 +35,8 @@ namespace OpenRA.Mods.TS.UtilityCommands // HACK: The engine code assumes that Game.modData is set. Game.ModData = modData; + grid = Game.ModData.Manifest.Get(); + file = new IniFile(File.Open(args[1], FileMode.Open)); foreach (var section in file.Sections) @@ -54,6 +57,21 @@ namespace OpenRA.Mods.TS.UtilityCommands Console.WriteLine("\tDefaults:"); + var foundation = section.GetValue("Foundation", string.Empty); + if (!string.IsNullOrEmpty(foundation)) + { + var size = foundation.Split('x'); + if (size.Length == 2) + { + var x = int.Parse(size[0]); + var y = int.Parse(size[1]); + + var xOffset = (x - y) * grid.TileSize.Width / 4; + var yOffset = (x + y) * grid.TileSize.Height / 4; + Console.WriteLine("\t\tOffset: {0},{1}", -xOffset, -yOffset); + } + } + var theater = section.GetValue("Theater", string.Empty); if (!string.IsNullOrEmpty(theater) && theater == "yes") Console.WriteLine("\t\tUseTilesetExtension: true");