From 2a95c5f668454996c4e5d66d1af0054144b7cd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jun 2012 11:56:52 +0200 Subject: [PATCH 1/3] fix PlayerColorPalette in Editor --- OpenRA.Editor/Surface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index 7cad793e53..a3fca5beda 100755 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -318,7 +318,7 @@ namespace OpenRA.Editor { var pr = Map.Players[name]; var pcpi = Rules.Info["player"].Traits.Get(); - var remap = new PlayerColorRemap(pcpi.PaletteFormat, pr.ColorRamp); + var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.ColorRamp); return new Palette(Palette, remap).AsSystemPalette(); } From 769b5d7dc6775aef08ba21150fa5377b223b30e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jun 2012 12:32:52 +0200 Subject: [PATCH 2/3] fixed OpenRA.Utility --remap now uses the mod parameter again --- OpenRA.Utility/Command.cs | 17 ++++++++++++++--- OpenRA.Utility/Program.cs | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) 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."); } From 79976a4bfe8a2cfa356a41904ff63ee98864fcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jun 2012 15:48:11 +0200 Subject: [PATCH 3/3] transpose infantry/ornithocopter --- .../Widgets/Logic/D2kExtractGameFilesLogic.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs index 7f40854a1a..c1e8d61a2f 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs @@ -453,6 +453,18 @@ namespace OpenRA.Mods.D2k.Widgets.Logic new string[] {"--shp", Path.Combine(PathToSHPs, "spice0.png"), "32"}, }; + var SHPsToTranspose = new string[][] + { + new string[] {"--transpose", Path.Combine(PathToSHPs, "orni.shp"), Path.Combine(PathToSHPs, "orni.shp"), "0", "32", "3"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "rifle.shp"), Path.Combine(PathToSHPs, "rifle.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "bazooka.shp"), Path.Combine(PathToSHPs, "bazooka.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "fremen.shp"), Path.Combine(PathToSHPs, "fremen.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "sardaukar.shp"), Path.Combine(PathToSHPs, "sardaukar.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "thumper.shp"), Path.Combine(PathToSHPs, "thumper.shp"), "8", "8", "6"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "engineer.shp"), Path.Combine(PathToSHPs, "engineer.shp"), "8", "8", "6"}, + new string[] {"--transpose", Path.Combine(PathToSHPs, "saboteur.shp"), Path.Combine(PathToSHPs, "saboteur.shp"), "8", "8", "4"}, + }; + var onError = (Action)(s => Game.RunAfterTick(() => { statusLabel.GetText = () => "Error: "+s; @@ -479,6 +491,13 @@ namespace OpenRA.Mods.D2k.Widgets.Logic File.Delete(SHPsToCreate[i][1]); } + for (int i = 0; i < SHPsToTranspose.Length; i++) + { + progressBar.Percentage = i*100/SHPsToTranspose.Count(); + statusLabel.GetText = () => "Transposing..."; + Utility.Command.TransposeShp(SHPsToTranspose[i]); + } + statusLabel.GetText = () => "Building tilesets..."; int c = 0; string[] TilesetArray = new string[] { "BASE", "BAT", "BGBS", "ICE", "TREE", "WAST" };