Add a Utility class and update command interface.
This commit is contained in:
@@ -15,16 +15,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
|
||||
[Desc("ACTOR-TYPE [PATH/TO/MAP]", "Display the finalized, merged MiniYaml tree for the given actor type. Input values are case-sensitive.")]
|
||||
void IUtilityCommand.Run(ModData modData, string[] args)
|
||||
void IUtilityCommand.Run(Utility utility, string[] args)
|
||||
{
|
||||
// HACK: The engine code assumes that Game.modData is set.
|
||||
Game.ModData = modData;
|
||||
var modData = Game.ModData = utility.ModData;
|
||||
|
||||
var actorType = args[1];
|
||||
string mapPath = null;
|
||||
|
||||
Map map = null;
|
||||
if (args.Length == 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
mapPath = args[2];
|
||||
@@ -35,6 +36,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Console.WriteLine("Could not load map '{0}'.", mapPath);
|
||||
Environment.Exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
var fs = map ?? modData.DefaultFileSystem;
|
||||
var topLevelNodes = MiniYaml.Load(fs, modData.Manifest.Rules, map == null ? null : map.RuleDefinitions);
|
||||
|
||||
Reference in New Issue
Block a user