diff --git a/BizHawk.Client.Common/movie/TasMovie.cs b/BizHawk.Client.Common/movie/TasMovie.cs index 5dea877709..7d3db941ec 100644 --- a/BizHawk.Client.Common/movie/TasMovie.cs +++ b/BizHawk.Client.Common/movie/TasMovie.cs @@ -37,6 +37,16 @@ namespace BizHawk.Client.Common _records[frame].Buttons[buttonName] ^= true; } + public void SetButton(int frame, string buttonName, bool value) + { + _records[frame].Buttons[buttonName] = value; + } + + public bool IsPressed(int frame, string buttonName) + { + return _records[frame].Buttons[buttonName]; + } + #region Implementation public TasMovie(string filename, bool startsFromSavestate = false) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index ec4b9608b6..ac3410e548 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -248,12 +248,18 @@ namespace BizHawk.Client.EmuHawk #region TASView Events + private string StartDrawColumn = String.Empty; //TODO: move me + private bool StartOn = false; //TODO: move me + private void TASView_MouseDown(object sender, MouseEventArgs e) { if (TASView.PointedCell.Row.HasValue && !String.IsNullOrEmpty(TASView.PointedCell.Column)) { _tas.ToggleButton(TASView.PointedCell.Row.Value, TASView.PointedCell.Column); TASView.Refresh(); + + StartDrawColumn = TASView.PointedCell.Column; + StartOn = _tas.IsPressed(TASView.PointedCell.Row.Value, TASView.PointedCell.Column); } } @@ -261,18 +267,13 @@ namespace BizHawk.Client.EmuHawk private void TASView_PointedCellChanged(object sender, TasListView.CellEventArgs e) { - if (TASView.IsPaintDown) + if (TASView.IsPaintDown && e.NewCell.Row.HasValue && !String.IsNullOrEmpty(StartDrawColumn)) { - _tas.ToggleButton(TASView.PointedCell.Row.Value, TASView.PointedCell.Column); + _tas.SetButton(e.NewCell.Row.Value, StartDrawColumn, StartOn); //Notice it uses new row, old column, you can only paint across a single column TASView.Refresh(); } } #endregion - - #region Classes - // Everything in here will probably need to be moved at some point - - #endregion } }