From 072aeb93d52c3e88959c928f6da414e3e1371bf3 Mon Sep 17 00:00:00 2001 From: Suuper Date: Fri, 24 Jul 2015 15:13:39 -0500 Subject: [PATCH] TAStudio: added an option to have the mouse wheel scroll TasView faster --- .../tools/TAStudio/InputRoll.cs | 11 +++++++ .../tools/TAStudio/TAStudio.Designer.cs | 30 +++++++++++++++---- .../tools/TAStudio/TAStudio.MenuItems.cs | 21 +++++++++---- .../tools/TAStudio/TAStudio.cs | 1 + 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index 3e858c54dc..4903cfaa40 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -22,6 +22,17 @@ namespace BizHawk.Client.EmuHawk private readonly VScrollBar VBar; private readonly HScrollBar HBar; + public int ScrollSpeed + { + get { return VBar.SmallChange; } + set + { + if (HorizontalOrientation) + HBar.SmallChange = value * CellWidth; + else + VBar.SmallChange = value * CellHeight; + } + } private RollColumns _columns = new RollColumns(); private bool _horizontalOrientation; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index f2bf3f8196..8cf7a3c0ee 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -173,6 +173,8 @@ namespace BizHawk.Client.EmuHawk this.StartNewProjectFromNowMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.BookMarkControl = new BizHawk.Client.EmuHawk.BookmarksBranchesBox(); + this.toolStripSeparator25 = new System.Windows.Forms.ToolStripSeparator(); + this.wheelScrollSpeedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TASMenu.SuspendLayout(); this.TasStatusStrip.SuspendLayout(); this.MarkerContextMenu.SuspendLayout(); @@ -827,7 +829,9 @@ namespace BizHawk.Client.EmuHawk this.RotateMenuItem, this.HideLagFramesSubMenu, this.toolStripSeparator23, - this.followCursorToolStripMenuItem}); + this.followCursorToolStripMenuItem, + this.toolStripSeparator25, + this.wheelScrollSpeedToolStripMenuItem}); this.SettingsSubMenu.Name = "SettingsSubMenu"; this.SettingsSubMenu.Size = new System.Drawing.Size(61, 20); this.SettingsSubMenu.Text = "&Settings"; @@ -836,7 +840,7 @@ namespace BizHawk.Client.EmuHawk // RotateMenuItem // this.RotateMenuItem.Name = "RotateMenuItem"; - this.RotateMenuItem.Size = new System.Drawing.Size(162, 22); + this.RotateMenuItem.Size = new System.Drawing.Size(183, 22); this.RotateMenuItem.Text = "Rotate"; this.RotateMenuItem.Click += new System.EventHandler(this.RotateMenuItem_Click); // @@ -850,7 +854,7 @@ namespace BizHawk.Client.EmuHawk this.toolStripSeparator12, this.hideWasLagFramesToolStripMenuItem}); this.HideLagFramesSubMenu.Name = "HideLagFramesSubMenu"; - this.HideLagFramesSubMenu.Size = new System.Drawing.Size(162, 22); + this.HideLagFramesSubMenu.Size = new System.Drawing.Size(183, 22); this.HideLagFramesSubMenu.Text = "Hide Lag Frames"; this.HideLagFramesSubMenu.DropDownOpened += new System.EventHandler(this.HideLagFramesSubMenu_DropDownOpened); // @@ -907,7 +911,7 @@ namespace BizHawk.Client.EmuHawk // toolStripSeparator23 // this.toolStripSeparator23.Name = "toolStripSeparator23"; - this.toolStripSeparator23.Size = new System.Drawing.Size(159, 6); + this.toolStripSeparator23.Size = new System.Drawing.Size(180, 6); // // followCursorToolStripMenuItem // @@ -919,7 +923,7 @@ namespace BizHawk.Client.EmuHawk this.scrollToBottomToolStripMenuItem, this.scrollToCenterToolStripMenuItem}); this.followCursorToolStripMenuItem.Name = "followCursorToolStripMenuItem"; - this.followCursorToolStripMenuItem.Size = new System.Drawing.Size(162, 22); + this.followCursorToolStripMenuItem.Size = new System.Drawing.Size(183, 22); this.followCursorToolStripMenuItem.Text = "Follow Cursor"; this.followCursorToolStripMenuItem.DropDownOpened += new System.EventHandler(this.followCursorToolStripMenuItem_DropDownOpened); // @@ -1173,7 +1177,7 @@ namespace BizHawk.Client.EmuHawk this.StartFromNowSeparator, this.StartNewProjectFromNowMenuItem}); this.RightClickMenu.Name = "RightClickMenu"; - this.RightClickMenu.Size = new System.Drawing.Size(273, 458); + this.RightClickMenu.Size = new System.Drawing.Size(273, 436); this.RightClickMenu.Opened += new System.EventHandler(this.RightClickMenu_Opened); // // SetMarkersContextMenuItem @@ -1365,6 +1369,18 @@ namespace BizHawk.Client.EmuHawk this.BookMarkControl.TabIndex = 8; this.BookMarkControl.Tastudio = null; // + // toolStripSeparator25 + // + this.toolStripSeparator25.Name = "toolStripSeparator25"; + this.toolStripSeparator25.Size = new System.Drawing.Size(180, 6); + // + // wheelScrollSpeedToolStripMenuItem + // + this.wheelScrollSpeedToolStripMenuItem.Name = "wheelScrollSpeedToolStripMenuItem"; + this.wheelScrollSpeedToolStripMenuItem.Size = new System.Drawing.Size(183, 22); + this.wheelScrollSpeedToolStripMenuItem.Text = "Wheel Scroll Speed..."; + this.wheelScrollSpeedToolStripMenuItem.Click += new System.EventHandler(this.wheelScrollSpeedToolStripMenuItem_Click); + // // TAStudio // this.AllowDrop = true; @@ -1545,5 +1561,7 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem onlyOnAutoFireColumnsToolStripMenuItem; private BookmarksBranchesBox BookMarkControl; private System.Windows.Forms.ToolStripMenuItem BranchContextMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator25; + private System.Windows.Forms.ToolStripMenuItem wheelScrollSpeedToolStripMenuItem; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index d236da2856..bfd6579403 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -521,12 +521,12 @@ namespace BizHawk.Client.EmuHawk private void InsertNumFramesMenuItem_Click(object sender, EventArgs e) { - var wasPaused = GlobalWin.MainForm.EmulatorPaused; - var insertionFrame = TasView.SelectedRows.Any() ? TasView.FirstSelectedIndex.Value : 0; - var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; + bool wasPaused = GlobalWin.MainForm.EmulatorPaused; + int insertionFrame = TasView.SelectedRows.Any() ? TasView.FirstSelectedIndex.Value : 0; + bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; - var framesPrompt = new FramesPrompt(); - var result = framesPrompt.ShowDialog(); + FramesPrompt framesPrompt = new FramesPrompt(); + DialogResult result = framesPrompt.ShowDialog(); if (result == DialogResult.OK) { CurrentTasMovie.InsertEmptyFrame(insertionFrame, framesPrompt.Frames); @@ -854,6 +854,17 @@ namespace BizHawk.Client.EmuHawk scrollToCenterToolStripMenuItem.Checked = true; } + private void wheelScrollSpeedToolStripMenuItem_Click(object sender, EventArgs e) + { + InputPrompt inputpromt = new InputPrompt(); + inputpromt.TextInputType = InputPrompt.InputType.Unsigned; + inputpromt.Message = "Frames per tick:"; + inputpromt.InitialValue = "1"; + inputpromt.ShowDialog(); + TasView.ScrollSpeed = int.Parse(inputpromt.PromptText); + + } + #endregion #region Columns diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 503865f2e4..c1fc45d618 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -56,6 +56,7 @@ namespace BizHawk.Client.EmuHawk public bool FollowCursor { get; set; } public bool EmptyMarkers { get; set; } } + int scrollSpeed = 1; // TODO: Save this value somewhere. public TasMovie CurrentTasMovie {