diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 3831273ccf..2adb1a3159 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -18,6 +18,7 @@ using System.Runtime.InteropServices; using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; using OpenRA.GameRules; +using OpenRA.Traits; namespace OpenRA.Utility { @@ -371,9 +372,19 @@ namespace OpenRA.Utility for (var i = 0; i < 4; i++) remap[i] = i; - // TODO: should read that from mods/*/system.yaml - var srcRemapIndex = Enum.Parse(args[1].Split(':')[0]); - var destRemapIndex = Enum.Parse(args[2].Split(':')[0]); + var srcMod = Enum.Parse(args[1].Split(':')[0]); + Game.modData = new ModData(srcMod); + FileSystem.LoadFromManifest(Game.modData.Manifest); + Rules.LoadRules(Game.modData.Manifest, new Map()); + var srcPaletteInfo = Rules.Info["player"].Traits.Get(); + int[] srcRemapIndex = srcPaletteInfo.RemapIndex; + + var destMod = Enum.Parse(args[2].Split(':')[0]); + Game.modData = new ModData(destMod); + FileSystem.LoadFromManifest(Game.modData.Manifest); + Rules.LoadRules(Game.modData.Manifest, new Map()); + var destPaletteInfo = Rules.Info["player"].Traits.Get(); + int[] destRemapIndex = destPaletteInfo.RemapIndex; // the remap range is always 16 entries, but their location and order changes for (var i = 0; i < 16; i++) diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 08674a384c..d46783c004 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -60,7 +60,7 @@ namespace OpenRA.Utility Console.WriteLine(" --png SHPFILE PALETTE [--transparent] Convert a SHP to a PNG containing all of its frames, optionally setting up transparency"); Console.WriteLine(" --extract MOD[,MOD]* FILES Extract files from mod packages"); Console.WriteLine(" --tmp-png MOD[,MOD]* THEATER FILES Extract terrain tiles to PNG"); - Console.WriteLine(" --remap SRCREMAPINDEX:PAL DESTREMAPINDEX:PAL SRCSHP DESTSHP Remap SHPs to another palette"); + Console.WriteLine(" --remap SRCMOD:PAL DESTMOD:PAL SRCSHP DESTSHP Remap SHPs to another palette"); Console.WriteLine(" --r8 R8FILE PALETTE START END FILENAME [--transparent] [--infrantry] [--vehicle] [--projectile] [--building] [--wall] [--tileset] Convert Dune 2000 DATA.R8 to PNGs choosing start- and endframe as well as type for correct offset to append multiple frames to one PNG named by filename optionally setting up transparency."); Console.WriteLine(" --transpose SRCSHP DESTSHP START N M [START N M ...] Transpose the N*M block of frames starting at START."); }