TAStudio: Ask to override existing bk2 file when exporting

This commit is contained in:
alyosha-tas 2019-01-19 14:02:45 -06:00
parent 2bddf3663e
commit 6e1a19b5f8
1 changed files with 27 additions and 3 deletions

View File

@ -267,17 +267,41 @@ namespace BizHawk.Client.EmuHawk
private void ToBk2MenuItem_Click(object sender, EventArgs e)
{
_autosaveTimer.Stop();
var bk2 = CurrentTasMovie.ToBk2(true);
var bk2 = CurrentTasMovie.ToBk2(true, true);
MessageStatusLabel.Text = "Exporting to .bk2...";
Cursor = Cursors.WaitCursor;
Update();
bk2.Save();
string d_exp = " not exported.";
var file = new FileInfo(bk2.Filename);
if (file.Exists)
{
GlobalWin.Sound.StopSound();
var result = MessageBox.Show(
"Overwrite Existing File?",
"Tastudio",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button3);
GlobalWin.Sound.StartSound();
if (result == DialogResult.Yes)
{
bk2.Save();
d_exp = " exported.";
}
}
else
{
bk2.Save();
d_exp = " exported.";
}
if (Settings.AutosaveInterval > 0)
{
_autosaveTimer.Start();
}
MessageStatusLabel.Text = bk2.Name + " exported.";
MessageStatusLabel.Text = bk2.Name + d_exp;
Cursor = Cursors.Default;
}