From a3914e84a4905117b4afe09d9f5b2ac748945718 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 25 Jul 2014 00:57:06 +0000 Subject: [PATCH] TAStudio - make a RightScrolled event for when the right mouse is clicked and the mouse wheel is scrolled, as refactored some code, this give better (but still broken) refreshing. Now the main window updates when the mouse wheel is done movie at least, as opposed to when the right mouse button is released. --- .../CustomControls/TasListView.cs | 23 +++++++++++++++ .../tools/TAStudio/TAStudio.Designer.cs | 2 +- .../tools/TAStudio/TAStudio.ListView.cs | 28 ------------------- .../tools/TAStudio/TAStudio.cs | 28 +++++++++++++++++++ 4 files changed, 52 insertions(+), 29 deletions(-) diff --git a/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs b/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs index e76b7f0a04..5f532be77d 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs @@ -149,5 +149,28 @@ namespace BizHawk.Client.EmuHawk base.OnMouseUp(e); } + + protected override void OnMouseWheel(MouseEventArgs e) + { + if (RightButtonHeld) + { + DoRightMouseScroll(this, e); + } + else + { + base.OnMouseWheel(e); + } + } + + public delegate void RightMouseScrollEventHandler(object sender, MouseEventArgs e); + public event RightMouseScrollEventHandler RightMouseScrolled; + + private void DoRightMouseScroll(object sender, MouseEventArgs e) + { + if (RightMouseScrolled != null) + { + RightMouseScrolled(sender, e); + } + } } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 99fb77f757..7c4758cd77 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -697,7 +697,7 @@ namespace BizHawk.Client.EmuHawk this.TasView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDoubleClick); this.TasView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDown); this.TasView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseUp); - this.TasView.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseWheel); + this.TasView.RightMouseScrolled += new TasListView.RightMouseScrollEventHandler(this.TasView_MouseWheel); // // Frame // diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index ae57e83ba6..2f991ab69d 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -201,34 +201,6 @@ namespace BizHawk.Client.EmuHawk } } - // TODO: move me - // Sets either the pending frame or the tas input log - private void ToggleBoolState(int frame, string buttonName) - { - if (frame < _tas.InputLogLength) - { - _tas.ToggleBoolState(frame, buttonName); - } - else if (frame == Global.Emulator.Frame && frame == _tas.InputLogLength) - { - Global.ClickyVirtualPadController.Toggle(buttonName); - } - } - - // TODO: move me - // Sets either the pending frame or the tas input log - private void SetBoolState(int frame, string buttonName, bool value) - { - if (frame < _tas.InputLogLength) - { - _tas.SetBoolState(frame, buttonName, value); - } - else if (frame == Global.Emulator.Frame && frame == _tas.InputLogLength) - { - Global.ClickyVirtualPadController.SetBool(buttonName, value); - } - } - private void TasView_MouseUp(object sender, MouseEventArgs e) { _startMarkerDrag = false; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index c490fbcc27..bfedb53ef7 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -459,6 +459,34 @@ namespace BizHawk.Client.EmuHawk // TODO } + // TODO: move me + // Sets either the pending frame or the tas input log + private void ToggleBoolState(int frame, string buttonName) + { + if (frame < _tas.InputLogLength) + { + _tas.ToggleBoolState(frame, buttonName); + } + else if (frame == Global.Emulator.Frame && frame == _tas.InputLogLength) + { + Global.ClickyVirtualPadController.Toggle(buttonName); + } + } + + // TODO: move me + // Sets either the pending frame or the tas input log + private void SetBoolState(int frame, string buttonName, bool value) + { + if (frame < _tas.InputLogLength) + { + _tas.SetBoolState(frame, buttonName, value); + } + else if (frame == Global.Emulator.Frame && frame == _tas.InputLogLength) + { + Global.ClickyVirtualPadController.SetBool(buttonName, value); + } + } + #region Events #region File Menu