fixed #1263 - don't trash the current directory on exporting a minimap
This commit is contained in:
8
OpenRA.Editor/Form1.Designer.cs
generated
8
OpenRA.Editor/Form1.Designer.cs
generated
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user