From 1483addb996613daabb1679f0fe6a9b0cee5be52 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 10 May 2010 21:02:06 +1200 Subject: [PATCH] don't load mjolnir on startup; and use the mod specified on the commandline --- OpenRA.Editor/Form1.cs | 17 ++++++++++++----- OpenRA.Editor/Program.cs | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index 56f0d46628..3086d33e51 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -13,13 +13,22 @@ namespace OpenRA.Editor { public partial class Form1 : Form { - public Form1() + public Form1(string[] mods) { InitializeComponent(); AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly; LocateGameRoot(); - LoadMap(currentMod, "mjolnir"); + currentMod = mods.FirstOrDefault() ?? "ra"; + + var manifest = new Manifest(new[] { currentMod }); + Game.LoadModAssemblies(manifest); + + FileSystem.UnmountAll(); + foreach (var folder in manifest.Folders) FileSystem.Mount(folder); + foreach (var pkg in manifest.Packages) FileSystem.Mount(pkg); + + Rules.LoadRules(manifest, new Map()); } string loadedMapName; @@ -36,9 +45,7 @@ namespace OpenRA.Editor currentMod = mod; loadedMapName = mapname; - var mods = new[] { mod }; - - var manifest = new Manifest(mods); + var manifest = new Manifest(new[] { currentMod }); Game.LoadModAssemblies(manifest); FileSystem.UnmountAll(); diff --git a/OpenRA.Editor/Program.cs b/OpenRA.Editor/Program.cs index 950192b52f..90053d26d5 100644 --- a/OpenRA.Editor/Program.cs +++ b/OpenRA.Editor/Program.cs @@ -11,11 +11,11 @@ namespace OpenRA.Editor /// The main entry point for the application. /// [STAThread] - static void Main() + static void Main( string[] args ) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new Form1(args)); } } }