fixed #1263 - don't trash the current directory on exporting a minimap

This commit is contained in:
Chris Forbes
2011-11-04 19:28:19 +13:00
parent 4ad7af8a58
commit 718742be4a
2 changed files with 9 additions and 13 deletions

View File

@@ -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)