TAStudio - Basic input toggling via clicking cells in the listview

This commit is contained in:
adelikat 2013-12-08 18:44:41 +00:00
parent a07ef9f011
commit 14184c9ae9
4 changed files with 21 additions and 2 deletions

View File

@ -32,6 +32,11 @@ namespace BizHawk.Client.Common
}
}
public void ToggleButton(int frame, string buttonName)
{
_records[frame].Buttons[buttonName] ^= true;
}
#region Implementation
public TasMovie(string filename, bool startsFromSavestate = false)

View File

@ -8,8 +8,8 @@ namespace BizHawk.Client.EmuHawk
{
public class TasListView : VirtualListView
{
public string PointedColumnName = String.Empty;
public int? PointedRowIndex = null;
public string PointedColumnName { get; private set; }
public int? PointedRowIndex { get; private set; }
private void CalculatePointedCell(int x, int y)
{

View File

@ -666,6 +666,7 @@ namespace BizHawk.Client.EmuHawk
this.TASView.TabIndex = 1;
this.TASView.UseCompatibleStateImageBehavior = false;
this.TASView.View = System.Windows.Forms.View.Details;
this.TASView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TASView_MouseDown);
//
// Frame
//

View File

@ -228,6 +228,19 @@ namespace BizHawk.Client.EmuHawk
#endregion
#region TASView Events
private void TASView_MouseDown(object sender, MouseEventArgs e)
{
if (TASView.PointedRowIndex.HasValue && !String.IsNullOrEmpty(TASView.PointedColumnName))
{
_tas.ToggleButton(TASView.PointedRowIndex.Value, TASView.PointedColumnName);
TASView.Refresh();
}
}
#endregion
#endregion
}
}