From d8ec9e687895b4e59caeb4694d671d417f310a33 Mon Sep 17 00:00:00 2001 From: feos Date: Mon, 30 Nov 2015 23:44:31 +0300 Subject: [PATCH] tastudio: editable HoverInterval for BranchView (stored to TAStudioSettings). when comparing, we want them to show up instantly. --- .../TAStudio/BookmarksBranchesBox.Designer.cs | 2 +- .../tools/TAStudio/BookmarksBranchesBox.cs | 7 +++++- .../tools/TAStudio/TAStudio.Designer.cs | 10 +++++++++ .../tools/TAStudio/TAStudio.MenuItems.cs | 22 +++++++++++++++++++ .../tools/TAStudio/TAStudio.cs | 5 ++++- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs index 57655191eb..12ffa1d6bc 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs @@ -229,7 +229,7 @@ this.BranchView.FullRowSelect = true; this.BranchView.HideWasLagFrames = false; this.BranchView.HorizontalOrientation = false; - this.BranchView.HoverInterval = 500; + this.BranchView.HoverInterval = 1; this.BranchView.LagFramesToHide = 0; this.BranchView.Location = new System.Drawing.Point(6, 19); this.BranchView.MaxCharactersInHorizontal = 1; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index 1619599899..667ca02210 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -21,8 +21,13 @@ namespace BizHawk.Client.EmuHawk private const string TimeColumnName = "TimeColumn"; private readonly PlatformFrameRates FrameRates = new PlatformFrameRates(); - public TAStudio Tastudio { get; set; } private TasMovie Movie { get { return Tastudio.CurrentTasMovie; } } + public TAStudio Tastudio { get; set; } + + public int HoverInterval { + get { return BranchView.HoverInterval; } + set { BranchView.HoverInterval = value; } + } private TasBranch GetBranch(int id) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index db4e38d895..8da3e9fd26 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -81,6 +81,7 @@ namespace BizHawk.Client.EmuHawk this.StateHistoryIntegrityCheckMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ConfigSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.SetMaxUndoLevelsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SetBranchCellHoverIntervalMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.AutoadjustInputMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); @@ -599,6 +600,7 @@ namespace BizHawk.Client.EmuHawk // this.ConfigSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SetMaxUndoLevelsMenuItem, + this.SetBranchCellHoverIntervalMenuItem, this.toolStripSeparator9, this.AutoadjustInputMenuItem, this.toolStripSeparator11, @@ -628,6 +630,13 @@ namespace BizHawk.Client.EmuHawk this.SetMaxUndoLevelsMenuItem.Text = "Set max Undo Levels"; this.SetMaxUndoLevelsMenuItem.Click += new System.EventHandler(this.SetMaxUndoLevelsMenuItem_Click); // + // SetBranchCellHoverIntervalMenuItem + // + this.SetBranchCellHoverIntervalMenuItem.Name = "SetBranchCellHoverIntervalMenuItem"; + this.SetBranchCellHoverIntervalMenuItem.Size = new System.Drawing.Size(253, 22); + this.SetBranchCellHoverIntervalMenuItem.Text = "Set Branch Cell Hover Interval"; + this.SetBranchCellHoverIntervalMenuItem.Click += new System.EventHandler(this.SetBranchCellHoverIntervalMenuItem_Click); + // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; @@ -1667,5 +1676,6 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem NewFromSubMenu; private System.Windows.Forms.ToolStripMenuItem NewFromNowMenuItem; private System.Windows.Forms.ToolStripMenuItem NewFromCurrentSaveRamMenuItem; + private System.Windows.Forms.ToolStripMenuItem SetBranchCellHoverIntervalMenuItem; } } \ 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 62ecbb7c3e..585364f2e4 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -662,6 +662,28 @@ namespace BizHawk.Client.EmuHawk } } + private void SetBranchCellHoverIntervalMenuItem_Click(object sender, EventArgs e) + { + using (var prompt = new InputPrompt + { + TextInputType = InputPrompt.InputType.Unsigned, + Message = "ScreenshotPopUp Delay", + InitialValue = Settings.BranchCellHoverInterval.ToString() + }) + { + DialogResult result = prompt.ShowDialog(); + if (result == DialogResult.OK) + { + int val = int.Parse(prompt.PromptText); + if (val > 0) + { + Settings.BranchCellHoverInterval = val; + BookMarkControl.HoverInterval = val; + } + } + } + } + private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e) { DrawInputByDraggingMenuItem.Checked = Settings.DrawInput; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index f09ebbf656..ea9f86b65f 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -61,6 +61,7 @@ namespace BizHawk.Client.EmuHawk ScrollSpeed = 3; FollowCursorAlwaysScroll = false; FollowCursorScrollMethod = "near"; + BranchCellHoverInterval = 1; // default to taseditor fashion denoteStatesWithIcons = false; denoteStatesWithBGColor = true; @@ -77,6 +78,7 @@ namespace BizHawk.Client.EmuHawk public int ScrollSpeed { get; set; } public bool FollowCursorAlwaysScroll { get; set; } public string FollowCursorScrollMethod { get; set; } + public int BranchCellHoverInterval { get; set; } public bool denoteStatesWithIcons { get; set; } public bool denoteStatesWithBGColor { get; set; } @@ -202,7 +204,8 @@ namespace BizHawk.Client.EmuHawk TasView.InputPaintingMode = Settings.DrawInput; TasView.ScrollSpeed = Settings.ScrollSpeed; TasView.AlwaysScroll = Settings.FollowCursorAlwaysScroll; - TasView.ScrollMethod = Settings.FollowCursorScrollMethod; + TasView.ScrollMethod = Settings.FollowCursorScrollMethod; + BookMarkControl.HoverInterval = Settings.BranchCellHoverInterval; TasView.denoteStatesWithIcons = Settings.denoteStatesWithIcons; TasView.denoteStatesWithBGColor = Settings.denoteStatesWithBGColor;