From 1b8b4b492623f25b0aa322901c2009de9071ebb4 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 26 Nov 2019 18:54:46 -0600 Subject: [PATCH] Tastudio - rip out option to do autorestore on mouse up vs down, make it on up only, and fix autorestore logic --- .../tools/TAStudio/TAStudio.Designer.cs | 10 ----- .../tools/TAStudio/TAStudio.ListView.cs | 37 +++++-------------- .../tools/TAStudio/TAStudio.MenuItems.cs | 6 --- .../tools/TAStudio/TAStudio.cs | 2 - 4 files changed, 10 insertions(+), 45 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 5728aaf502..987d1276ff 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -90,7 +90,6 @@ this.AutosaveAsBackupFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.BackupPerFileSaveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); - this.AutoRestoreOnMouseUpOnlyMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AutoadjustInputMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DrawInputByDraggingMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.applyPatternToPaintedInputToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -631,7 +630,6 @@ this.autosaveToolStripMenuItem, this.BackupPerFileSaveMenuItem, this.toolStripSeparator9, - this.AutoRestoreOnMouseUpOnlyMenuItem, this.AutoadjustInputMenuItem, this.DrawInputByDraggingMenuItem, this.applyPatternToPaintedInputToolStripMenuItem, @@ -724,13 +722,6 @@ this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Size = new System.Drawing.Size(241, 6); // - // AutoRestoreOnMouseUpOnlyMenuItem - // - this.AutoRestoreOnMouseUpOnlyMenuItem.Name = "AutoRestoreOnMouseUpOnlyMenuItem"; - this.AutoRestoreOnMouseUpOnlyMenuItem.Size = new System.Drawing.Size(244, 22); - this.AutoRestoreOnMouseUpOnlyMenuItem.Text = "Auto-restore on Mouse Up only"; - this.AutoRestoreOnMouseUpOnlyMenuItem.Click += new System.EventHandler(this.AutoRestoreOnMouseUpOnlyMenuItem_Click); - // // AutoadjustInputMenuItem // this.AutoadjustInputMenuItem.CheckOnClick = true; @@ -1799,7 +1790,6 @@ private System.Windows.Forms.ToolStripMenuItem BackupPerFileSaveMenuItem; private System.Windows.Forms.ToolStripMenuItem SaveBackupMenuItem; private System.Windows.Forms.ToolStripMenuItem SaveBk2BackupMenuItem; - private System.Windows.Forms.ToolStripMenuItem AutoRestoreOnMouseUpOnlyMenuItem; private System.Windows.Forms.ToolStripMenuItem SingleClickFloatEditMenuItem; private System.Windows.Forms.ToolStripMenuItem LoadBranchOnDoubleclickMenuItem; private System.Windows.Forms.ToolStripMenuItem SetFontMenuItem; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index ba053b956c..9a4377935f 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -70,10 +70,6 @@ namespace BizHawk.Client.EmuHawk { GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastEditedFrame); } - else - { - _triggerAutoRestore = false; - } } private void StartSeeking(int? frame, bool fromMiddleClick = false) @@ -580,8 +576,10 @@ namespace BizHawk.Client.EmuHawk _floatEditYPos = e.Y; _floatPaintState = CurrentTasMovie.GetFloatState(frame, buttonName); + _triggerAutoRestore = true; JumpToGreenzone(); + return; } } @@ -662,11 +660,6 @@ namespace BizHawk.Client.EmuHawk JumpToGreenzone(); RefreshDialog(); } - - if (!Settings.AutoRestoreOnMouseUpOnly) - { - DoTriggeredAutoRestoreIfNeeded(); - } } else { @@ -842,6 +835,8 @@ namespace BizHawk.Client.EmuHawk { ClearLeftMouseStates(); } + + DoTriggeredAutoRestoreIfNeeded(); } if (e.Button == MouseButtons.Right) @@ -856,8 +851,6 @@ namespace BizHawk.Client.EmuHawk } _suppressContextMenu = false; - - DoTriggeredAutoRestoreIfNeeded(); } private void TasView_MouseWheel(object sender, MouseEventArgs e) @@ -1105,8 +1098,8 @@ namespace BizHawk.Client.EmuHawk if (_rightClickAlt || _rightClickControl || _rightClickShift) { - JumpToGreenzone(); _triggerAutoRestore = true; + JumpToGreenzone(); _suppressContextMenu = true; } } @@ -1134,14 +1127,12 @@ namespace BizHawk.Client.EmuHawk } } - CurrentTasMovie.SetBoolState(i, _startBoolDrawColumn, setVal); // Notice it uses new row, old column, you can only paint across a single column - JumpToGreenzone(); - } + CurrentTasMovie.SetBoolState(i, _startBoolDrawColumn, setVal); // Notice it uses new row, old column, you can only paint across a single column - if (!Settings.AutoRestoreOnMouseUpOnly) - { - _triggerAutoRestore = startVal < Emulator.Frame && endVal < Emulator.Frame; - DoTriggeredAutoRestoreIfNeeded(); + if (!_triggerAutoRestore) + { + JumpToGreenzone(); + } } } } @@ -1170,12 +1161,6 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.SetFloatState(i, _startFloatDrawColumn, setVal); // Notice it uses new row, old column, you can only paint across a single column JumpToGreenzone(); } - - if (!Settings.AutoRestoreOnMouseUpOnly) - { - _triggerAutoRestore = true; - DoTriggeredAutoRestoreIfNeeded(); - } } } @@ -1224,9 +1209,7 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.SetFloatState(_floatEditRow, _floatEditColumn, value); _floatTypedValue = value.ToString(); - _triggerAutoRestore = true; JumpToGreenzone(); - DoTriggeredAutoRestoreIfNeeded(); RefreshDialog(); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 9c34140b45..5f0b60ad3e 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -858,7 +858,6 @@ namespace BizHawk.Client.EmuHawk { DrawInputByDraggingMenuItem.Checked = Settings.DrawInput; AutopauseAtEndOfMovieMenuItem.Checked = Settings.AutoPause; - AutoRestoreOnMouseUpOnlyMenuItem.Checked = Settings.AutoRestoreOnMouseUpOnly; EmptyNewMarkerNotesMenuItem.Checked = Settings.EmptyMarkers; AutosaveAsBk2MenuItem.Checked = Settings.AutosaveAsBk2; AutosaveAsBackupFileMenuItem.Checked = Settings.AutosaveAsBackupFile; @@ -1003,11 +1002,6 @@ namespace BizHawk.Client.EmuHawk Settings.AutoPause ^= true; } - private void AutoRestoreOnMouseUpOnlyMenuItem_Click(object sender, EventArgs e) - { - Settings.AutoRestoreOnMouseUpOnly ^= true; - } - private void AutoHoldMenuItem_CheckedChanged(object sender, EventArgs e) { if (autoHoldToolStripMenuItem.Checked) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 9c24085c5a..b16295f047 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -69,7 +69,6 @@ namespace BizHawk.Client.EmuHawk FollowCursorScrollMethod = "near"; BranchCellHoverInterval = 1; SeekingCutoffInterval = 2; - AutoRestoreOnMouseUpOnly = false; AutosaveInterval = 120000; AutosaveAsBk2 = false; AutosaveAsBackupFile = false; @@ -96,7 +95,6 @@ namespace BizHawk.Client.EmuHawk public string FollowCursorScrollMethod { get; set; } public int BranchCellHoverInterval { get; set; } public int SeekingCutoffInterval { get; set; } // unused, relying on VisibleRows is smarter - public bool AutoRestoreOnMouseUpOnly { get; set; } // default to taseditor way, must be harmless since we suspend rerecord counting while drawing public uint AutosaveInterval { get; set; } public bool AutosaveAsBk2 { get; set; } public bool AutosaveAsBackupFile { get; set; }