From d19fcb62ab04a3430239bb0eeb599815442ea4e3 Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 19 Feb 2017 10:30:10 +0300 Subject: [PATCH] tastudio: fix the first half of #806 --- .../tools/TAStudio/PlaybackBox.cs | 1 + .../tools/TAStudio/TAStudio.ListView.cs | 46 ++++++++----------- .../tools/TAStudio/TAStudio.cs | 4 +- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs index 6fb5f5f6ab..17836ddd76 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs @@ -159,6 +159,7 @@ namespace BizHawk.Client.EmuHawk private void RecordingModeCheckbox_MouseClick(object sender, MouseEventArgs e) { RecordingMode ^= true; + Tastudio.WasRecording = RecordingMode; // hard reset at manual click } private void RewindButton_MouseDown(object sender, MouseEventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index 69fafd87fb..4cd3c92cdb 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -24,23 +24,18 @@ namespace BizHawk.Client.EmuHawk private bool _selectionDragState; private bool _supressContextMenu; - // SuuperW: For editing analog input + // Editing analog input private string _floatEditColumn = string.Empty; private int _floatEditRow = -1; private string _floatTypedValue; private int _floatEditYPos = -1; - private int floatEditRow - { - set - { - _floatEditRow = value; - TasView.suspendHotkeys = FloatEditingMode; - } - } - public bool FloatEditingMode - { - get { return _floatEditRow != -1; } - } + private int floatEditRow { set { + _floatEditRow = value; + TasView.suspendHotkeys = FloatEditingMode; + } } + public bool FloatEditingMode { get { + return _floatEditRow != -1; + } } private List _extraFloatRows = new List(); // Right-click dragging @@ -50,20 +45,17 @@ namespace BizHawk.Client.EmuHawk private int _rightClickLastFrame = -1; private bool _rightClickShift, _rightClickControl, _rightClickAlt; private bool _leftButtonHeld = false; - private bool mouseButtonHeld - { - get { return _rightClickFrame != -1 || _leftButtonHeld; } - } - + private bool mouseButtonHeld { get { + return _rightClickFrame != -1 || _leftButtonHeld; + } } private bool _triggerAutoRestore; // If true, autorestore will be called on mouse up private bool? _autoRestorePaused = null; private int? _seekStartFrame = null; - private bool _wasRecording = false; private bool _shouldUnpauseFromRewind = false; - - private Emulation.Common.ControllerDefinition controllerType - { get { return Global.MovieSession.MovieControllerAdapter.Definition; } } - + private Emulation.Common.ControllerDefinition controllerType { get { + return Global.MovieSession.MovieControllerAdapter.Definition; + } } + public bool WasRecording = false; public AutoPatternBool[] BoolPatterns; public AutoPatternFloat[] FloatPatterns; @@ -100,10 +92,10 @@ namespace BizHawk.Client.EmuHawk public void StopSeeking() { _seekBackgroundWorker.CancelAsync(); - if (_wasRecording) + if (WasRecording) { TastudioRecordMode(); - _wasRecording = false; + WasRecording = false; } Mainform.PauseOnFrame = null; if (_shouldUnpauseFromRewind) @@ -498,6 +490,7 @@ namespace BizHawk.Client.EmuHawk else // User changed input { bool wasPaused = Mainform.EmulatorPaused; + WasRecording = CurrentTasMovie.IsRecording || WasRecording; if (Global.MovieSession.MovieControllerAdapter.Definition.BoolButtons.Contains(buttonName)) { @@ -897,7 +890,8 @@ namespace BizHawk.Client.EmuHawk // Left-click else if (TasView.IsPaintDown && e.NewCell.RowIndex.HasValue && !string.IsNullOrEmpty(_startBoolDrawColumn)) { - Global.MovieSession.Movie.IsCountingRerecords = false; + Global.MovieSession.Movie.IsCountingRerecords = false; + WasRecording = CurrentTasMovie.IsRecording || WasRecording; if (e.OldCell.RowIndex.HasValue && e.NewCell.RowIndex.HasValue) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 7c5ac42d94..92976dbb88 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -814,7 +814,7 @@ namespace BizHawk.Client.EmuHawk return; _shouldUnpauseFromRewind = fromRewinding && !Mainform.EmulatorPaused; - _wasRecording = CurrentTasMovie.IsRecording || _wasRecording; + WasRecording = CurrentTasMovie.IsRecording || WasRecording; TastudioPlayMode(); KeyValuePair closestState = CurrentTasMovie.TasStateManager.GetStateClosestToFrame(frame); if (closestState.Value != null && (frame < Emulator.Frame || closestState.Key > Emulator.Frame)) @@ -839,7 +839,7 @@ namespace BizHawk.Client.EmuHawk if(!wasPaused) Mainform.UnpauseEmulator(); //lua botting users will want to re-activate record mode automatically -- it should be like nothing ever happened - if (_wasRecording) + if (WasRecording) { TastudioRecordMode(); }