BizHawk/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs

78 lines
1.3 KiB
C#
Raw Normal View History

2014-07-09 15:04:16 +00:00
using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public partial class TAStudio : IToolForm
{
public bool UpdateBefore { get { return false; } }
public void UpdateValues()
{
if (!IsHandleCreated || IsDisposed)
{
return;
}
RefreshDialog();
2014-07-09 15:04:16 +00:00
if (_tas.IsRecording)
{
TasView.ensureVisible(_tas.InputLogLength - 1);
}
else
{
2014-07-10 20:15:46 +00:00
TasView.ensureVisible(Global.Emulator.Frame);
2014-07-09 15:04:16 +00:00
}
}
public void FastUpdate()
{
// TODO: think more about this
}
2014-07-09 15:04:16 +00:00
public void Restart()
{
if (!IsHandleCreated || IsDisposed)
{
return;
}
if (_tas != null)
{
RefreshDialog();
}
2014-07-09 15:04:16 +00:00
}
public bool AskSave()
{
2014-07-09 21:56:27 +00:00
if (_tas != null && _tas.Changes)
2014-07-09 15:04:16 +00:00
{
GlobalWin.Sound.StopSound();
var result = MessageBox.Show(
"Save Changes?",
"Tastudio",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button3);
2014-07-09 15:04:16 +00:00
GlobalWin.Sound.StartSound();
if (result == DialogResult.Yes)
{
SaveTasMenuItem_Click(null, null);
}
else if (result == DialogResult.No)
{
_tas.ClearChanges();
2014-07-09 15:04:16 +00:00
return true;
}
else if (result == DialogResult.Cancel)
{
return false;
}
}
return true;
}
}
}