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
|
|
|
|
|
{
|
2014-09-17 23:51:16 +00:00
|
|
|
|
public bool UpdateBefore { get { return false; } }
|
|
|
|
|
|
2014-09-27 15:19:07 +00:00
|
|
|
|
private bool _hackyDontUpdate = false;
|
|
|
|
|
|
2014-07-09 15:04:16 +00:00
|
|
|
|
public void UpdateValues()
|
|
|
|
|
{
|
2014-08-30 18:42:14 +00:00
|
|
|
|
if (!IsHandleCreated || IsDisposed || _currentTasMovie == null)
|
2014-08-23 20:17:06 +00:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-27 15:19:07 +00:00
|
|
|
|
if (_hackyDontUpdate)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-11 19:43:05 +00:00
|
|
|
|
if (TasPlaybackBox.FollowCursor)
|
|
|
|
|
{
|
|
|
|
|
SetVisibleIndex();
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-23 15:19:48 +00:00
|
|
|
|
RefreshDialog();
|
2014-07-09 15:04:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-25 01:55:21 +00:00
|
|
|
|
public void FastUpdate()
|
|
|
|
|
{
|
2014-08-31 16:51:19 +00:00
|
|
|
|
if (!IsHandleCreated || IsDisposed || _currentTasMovie == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-19 20:40:40 +00:00
|
|
|
|
TasView.RowCount = _currentTasMovie.InputLogLength + 1;
|
2014-10-11 19:43:05 +00:00
|
|
|
|
|
|
|
|
|
if (TasPlaybackBox.FollowCursor)
|
|
|
|
|
{
|
|
|
|
|
SetVisibleIndex();
|
|
|
|
|
}
|
2014-07-25 01:55:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-09 15:04:16 +00:00
|
|
|
|
public void Restart()
|
|
|
|
|
{
|
|
|
|
|
if (!IsHandleCreated || IsDisposed)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-07-10 20:06:23 +00:00
|
|
|
|
|
2014-08-19 19:24:17 +00:00
|
|
|
|
if (_currentTasMovie != null)
|
2014-07-10 20:06:23 +00:00
|
|
|
|
{
|
|
|
|
|
RefreshDialog();
|
|
|
|
|
}
|
2014-07-09 15:04:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-08-19 19:24:17 +00:00
|
|
|
|
|
|
|
|
|
public bool AskSaveChanges()
|
2014-07-09 15:04:16 +00:00
|
|
|
|
{
|
2014-08-19 19:24:17 +00:00
|
|
|
|
if (_currentTasMovie != null && _currentTasMovie.Changes)
|
2014-07-09 15:04:16 +00:00
|
|
|
|
{
|
|
|
|
|
GlobalWin.Sound.StopSound();
|
2014-07-27 15:11:59 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2014-08-19 19:24:17 +00:00
|
|
|
|
_currentTasMovie.ClearChanges();
|
2014-07-09 15:04:16 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (result == DialogResult.Cancel)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2014-08-19 19:24:17 +00:00
|
|
|
|
|
2014-10-11 19:43:05 +00:00
|
|
|
|
public void SetVisibleIndex(int? indexThatMustBeVisible = null)
|
2014-09-17 23:51:16 +00:00
|
|
|
|
{
|
2014-09-25 01:38:01 +00:00
|
|
|
|
if (!indexThatMustBeVisible.HasValue)
|
|
|
|
|
{
|
|
|
|
|
indexThatMustBeVisible = _currentTasMovie.IsRecording
|
|
|
|
|
? _currentTasMovie.InputLogLength
|
|
|
|
|
: Global.Emulator.Frame + 1;
|
|
|
|
|
}
|
2014-09-17 23:51:16 +00:00
|
|
|
|
|
2014-09-25 01:38:01 +00:00
|
|
|
|
if (!TasView.IsVisible(indexThatMustBeVisible.Value))
|
2014-09-17 23:51:16 +00:00
|
|
|
|
{
|
2014-09-25 01:38:01 +00:00
|
|
|
|
TasView.LastVisibleRow = indexThatMustBeVisible.Value;
|
2014-09-17 23:51:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-09 15:04:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|