From 1b6d79888ff7de50a4b2ef6de2e05ebc032488ce Mon Sep 17 00:00:00 2001 From: Dan9550 <56kflyingtoaster@gmail.com> Date: Sun, 11 Aug 2013 12:47:34 +1000 Subject: [PATCH] Quick and esy way to get the hash of map files using OpenRA.Utility --- OpenRA.Utility/Command.cs | 6 ++++++ OpenRA.Utility/Program.cs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 168d3cc58c87..4ff823c9e36e 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -530,6 +530,12 @@ public static void ExtractTraitDocs(string[] args) Console.WriteLine(); Console.WriteLine("```"); + } + + public static void GetMapHash(string[] args) + { + var result = new Map(args[1]).Uid; + Console.WriteLine(result); } } } diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 9f63d468eb74..17660cc5135d 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -30,6 +30,7 @@ static void Main(string[] args) { "--r8", Command.ConvertR8ToPng }, { "--transpose", Command.TransposeShp }, { "--docs", Command.ExtractTraitDocs }, + { "--map-hash", Command.GetMapHash }, }; if (args.Length == 0) { PrintUsage(); return; } @@ -65,7 +66,8 @@ static void PrintUsage() Console.WriteLine(" --remap SRCMOD:PAL DESTMOD:PAL SRCSHP DESTSHP Remap SHPs to another palette"); Console.WriteLine(" --r8 R8FILE PALETTE START END FILENAME [--noshadow] [--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 removing the shadow."); Console.WriteLine(" --transpose SRCSHP DESTSHP START N M [START N M ...] Transpose the N*M block of frames starting at START."); - Console.WriteLine(" --docs MOD Generate trait documentation in MarkDown format."); + Console.WriteLine(" --docs MOD Generate trait documentation in MarkDown format."); + Console.WriteLine(" --map-hash MAPFILE Generate hash of specified oramap file."); } static string GetNamedArg(string[] args, string arg)