diff --git a/OpenRA.Editor/Form1.Designer.cs b/OpenRA.Editor/Form1.Designer.cs index 0e0a2fa6b6..287be013d8 100755 --- a/OpenRA.Editor/Form1.Designer.cs +++ b/OpenRA.Editor/Form1.Designer.cs @@ -54,7 +54,6 @@ namespace OpenRA.Editor this.resourcePalette = new System.Windows.Forms.FlowLayoutPanel(); this.surface1 = new OpenRA.Editor.Surface(); this.tt = new System.Windows.Forms.ToolTip(this.components); - this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -263,12 +262,6 @@ namespace OpenRA.Editor // this.tt.ShowAlways = true; // - // saveFileDialog - // - this.saveFileDialog.DefaultExt = "*.png"; - this.saveFileDialog.Filter = "PNG Image (*.png)|"; - this.saveFileDialog.Title = "Export minimap to PNG"; - // // splitContainer3 // this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; @@ -568,7 +561,6 @@ namespace OpenRA.Editor private Surface surface1; private System.Windows.Forms.PictureBox pmMiniMap; private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.SaveFileDialog saveFileDialog; private System.Windows.Forms.SplitContainer splitContainer3; private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelMousePosition; diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index ce1c13bb7a..1ddd8d2db7 100755 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -419,11 +419,15 @@ namespace OpenRA.Editor void ExportMinimap(object sender, EventArgs e) { - saveFileDialog.InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps"); - saveFileDialog.FileName = Path.ChangeExtension(loadedMapName, ".png"); - - if (DialogResult.OK == saveFileDialog.ShowDialog()) - pmMiniMap.Image.Save(saveFileDialog.FileName); + using( var sfd = new SaveFileDialog() { + InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps"), + DefaultExt = "*.png", + Filter = "PNG Image (*.png)|*.png", + Title = "Export Minimap to PNG", + FileName = Path.ChangeExtension(loadedMapName, ".png"), + RestoreDirectory = true } ) + if (DialogResult.OK == sfd.ShowDialog()) + pmMiniMap.Image.Save(sfd.FileName); } void ShowActorNamesClicked(object sender, EventArgs e)