tastudio - some reorg

This commit is contained in:
adelikat 2014-07-09 15:04:16 +00:00
parent 5843a8f396
commit 9cc1fb4404
4 changed files with 78 additions and 68 deletions

View File

@ -835,6 +835,14 @@
<Compile Include="tools\TAStudio\LuaBox.Designer.cs">
<DependentUpon>LuaBox.cs</DependentUpon>
</Compile>
<Compile Include="tools\TAStudio\TAStudio.IControlMainForm.cs">
<DependentUpon>TAStudio.cs</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\TAStudio\TAStudio.IToolForm.cs">
<DependentUpon>TAStudio.cs</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\TAStudio\Marker.cs" />
<Compile Include="tools\TAStudio\MarkerControl.cs">
<SubType>UserControl</SubType>

View File

@ -0,0 +1,10 @@
namespace BizHawk.Client.EmuHawk
{
public partial class TAStudio : IControlMainform
{
public void ToggleReadOnly()
{
GlobalWin.OSD.AddMessage("TAStudio does not allow manual readonly toggle");
}
}
}

View File

@ -0,0 +1,60 @@
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;
}
TasView.ItemCount = _tas.InputLogLength;
if (_tas.IsRecording)
{
TasView.ensureVisible(_tas.InputLogLength - 1);
}
else
{
TasView.ensureVisible(Global.Emulator.Frame - 1);
}
}
public void Restart()
{
if (!IsHandleCreated || IsDisposed)
{
return;
}
}
public bool AskSave()
{
if (_tas.Changes)
{
GlobalWin.Sound.StopSound();
var result = MessageBox.Show("Save Changes?", "Tastudio", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
GlobalWin.Sound.StartSound();
if (result == DialogResult.Yes)
{
SaveTasMenuItem_Click(null, null);
}
else if (result == DialogResult.No)
{
return true;
}
else if (result == DialogResult.Cancel)
{
return false;
}
}
return true;
}
}
}

View File

@ -70,74 +70,6 @@ namespace BizHawk.Client.EmuHawk
TasView.PointedCellChanged += TasView_PointedCellChanged;
}
#region IToolForm implementation
public bool AskSave()
{
if (_tas.Changes)
{
GlobalWin.Sound.StopSound();
var result = MessageBox.Show("Save Changes?", "Tastudio", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
GlobalWin.Sound.StartSound();
if (result == DialogResult.Yes)
{
SaveTasMenuItem_Click(null, null);
}
else if (result == DialogResult.No)
{
return true;
}
else if (result == DialogResult.Cancel)
{
return false;
}
}
return true;
}
public bool UpdateBefore
{
get { return false; }
}
public void UpdateValues()
{
if (!IsHandleCreated || IsDisposed)
{
return;
}
TasView.ItemCount = _tas.InputLogLength;
if (_tas.IsRecording)
{
TasView.ensureVisible(_tas.InputLogLength - 1);
}
else
{
TasView.ensureVisible(Global.Emulator.Frame - 1);
}
}
public void Restart()
{
if (!IsHandleCreated || IsDisposed)
{
return;
}
}
#endregion
#region IControlMainform implementation
public void ToggleReadOnly()
{
GlobalWin.OSD.AddMessage("TAStudio does not allow manual readonly toggle");
}
#endregion
private void TasView_QueryItemBkColor(int index, int column, ref Color color)
{
var record = _tas[index];