From 7a0103963dc355c8c5553997ecc124a774c7177d Mon Sep 17 00:00:00 2001 From: Suuper Date: Sat, 25 Jul 2015 20:30:16 -0500 Subject: [PATCH] TAStudio: -History form's Auto Scroll now scrolls to current undo step instead of the last item in the list -Allow user to cancel setting wheel scroll speed --- .../tools/TAStudio/TAStudio.MenuItems.cs | 8 +++++--- BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 320a1c5960..6325904708 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -858,9 +858,11 @@ namespace BizHawk.Client.EmuHawk inputpromt.TextInputType = InputPrompt.InputType.Unsigned; inputpromt.Message = "Frames per tick:"; inputpromt.InitialValue = TasView.ScrollSpeed.ToString(); - inputpromt.ShowDialog(); - TasView.ScrollSpeed = int.Parse(inputpromt.PromptText); - Settings.ScrollSpeed = TasView.ScrollSpeed; + if (inputpromt.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + TasView.ScrollSpeed = int.Parse(inputpromt.PromptText); + Settings.ScrollSpeed = TasView.ScrollSpeed; + } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs index 25c53a3887..70779ccb64 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs @@ -49,13 +49,13 @@ namespace BizHawk.Client.EmuHawk color = Color.Red; } - private int _lastCount = -1; + private int _lastIndex = -1; public void UpdateValues() { HistoryView.ItemCount = log.Names.Count; - if (AutoScrollCheck.Checked && _lastCount != HistoryView.ItemCount) - HistoryView.ensureVisible(HistoryView.ItemCount - 1); - _lastCount = HistoryView.ItemCount; + if (AutoScrollCheck.Checked && _lastIndex != log.UndoIndex) + HistoryView.ensureVisible(log.UndoIndex - 1); + _lastIndex = log.UndoIndex; HistoryView.Refresh(); }