add a new menu item to setup default players in editor

This commit is contained in:
Chris Forbes
2011-10-15 12:28:59 +13:00
parent d202f9627f
commit 3991026cf3
3 changed files with 21 additions and 5 deletions

View File

@@ -80,6 +80,7 @@ namespace OpenRA.Editor
this.toolStripStatusLabelFiller = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelFiller = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelMousePosition = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelMousePosition = new System.Windows.Forms.ToolStripStatusLabel();
this.fixOpenAreasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fixOpenAreasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setupDefaultPlayersMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
@@ -397,7 +398,8 @@ namespace OpenRA.Editor
this.resizeToolStripMenuItem, this.resizeToolStripMenuItem,
this.showActorNamesToolStripMenuItem, this.showActorNamesToolStripMenuItem,
this.showGridToolStripMenuItem, this.showGridToolStripMenuItem,
this.fixOpenAreasToolStripMenuItem}); this.fixOpenAreasToolStripMenuItem,
this.setupDefaultPlayersMenuItem});
this.mapToolStripMenuItem.Name = "mapToolStripMenuItem"; this.mapToolStripMenuItem.Name = "mapToolStripMenuItem";
this.mapToolStripMenuItem.Size = new System.Drawing.Size(43, 23); this.mapToolStripMenuItem.Size = new System.Drawing.Size(43, 23);
this.mapToolStripMenuItem.Text = "&Map"; this.mapToolStripMenuItem.Text = "&Map";
@@ -479,6 +481,13 @@ namespace OpenRA.Editor
this.fixOpenAreasToolStripMenuItem.Text = "&Fix Open Areas"; this.fixOpenAreasToolStripMenuItem.Text = "&Fix Open Areas";
this.fixOpenAreasToolStripMenuItem.Click += new System.EventHandler(this.FixOpenAreas); this.fixOpenAreasToolStripMenuItem.Click += new System.EventHandler(this.FixOpenAreas);
// //
// setupDefaultPlayersMenuItem
//
this.setupDefaultPlayersMenuItem.Name = "setupDefaultPlayersMenuItem";
this.setupDefaultPlayersMenuItem.Size = new System.Drawing.Size(175, 22);
this.setupDefaultPlayersMenuItem.Text = "&Setup Default Players";
this.setupDefaultPlayersMenuItem.Click += new System.EventHandler(this.SetupDefaultPlayers);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -561,6 +570,7 @@ namespace OpenRA.Editor
private System.Windows.Forms.ToolStripMenuItem showActorNamesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showActorNamesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showGridToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showGridToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fixOpenAreasToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fixOpenAreasToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem setupDefaultPlayersMenuItem;
} }
} }

View File

@@ -447,5 +447,14 @@ namespace OpenRA.Editor
surface1.Chunks.Clear(); surface1.Chunks.Clear();
surface1.Invalidate(); surface1.Invalidate();
} }
void SetupDefaultPlayers(object sender, EventArgs e)
{
dirty = true;
surface1.Map.MakeDefaultPlayers();
surface1.Chunks.Clear();
surface1.Invalidate();
}
} }
} }

View File

@@ -41,9 +41,6 @@ namespace OpenRA.FileFormats
public string[] Enemies = {}; public string[] Enemies = {};
public PlayerReference() {} public PlayerReference() {}
public PlayerReference(MiniYaml my) public PlayerReference(MiniYaml my) { FieldLoader.Load(this, my); }
{
FieldLoader.Load(this, my);
}
} }
} }