Allow editor to load a map via commandline.

This commit is contained in:
Paul Chote
2011-02-18 15:11:12 +13:00
parent 05e5ee7ca4
commit ecf866f28a

View File

@@ -21,12 +21,12 @@ namespace OpenRA.Editor
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
public Form1(string[] mods) public Form1(string[] args)
{ {
InitializeComponent(); InitializeComponent();
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly; AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
currentMod = mods.FirstOrDefault() ?? "ra"; currentMod = args.FirstOrDefault() ?? "ra";
toolStripComboBox1.Items.AddRange(Mod.AllMods.Keys.ToArray()); toolStripComboBox1.Items.AddRange(Mod.AllMods.Keys.ToArray());
@@ -56,6 +56,9 @@ namespace OpenRA.Editor
surface1.AfterChange += OnMapChanged; surface1.AfterChange += OnMapChanged;
surface1.MousePositionChanged += s => toolStripStatusLabelMousePosition.Text = s; surface1.MousePositionChanged += s => toolStripStatusLabelMousePosition.Text = s;
if (args.Length >= 2)
LoadMap(args[1]);
} }
void OnMapChanged() void OnMapChanged()