Smarter state management.
Don't focus on TasView if TAStudio doesn't have focus. Bugfix: Scrolling with wheel didn't update pointed cell Setting: Scroll to top/bottom/center Follow cursor hotkey
This commit is contained in:
parent
1a0476892f
commit
c661591c5c
|
@ -53,6 +53,9 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
private int _lastCapture = 0;
|
||||
|
||||
private int maxStates
|
||||
{ get { return Settings.Cap / _expectedStateSize; } }
|
||||
|
||||
public TasStateManager(TasMovie movie)
|
||||
{
|
||||
_movie = movie;
|
||||
|
@ -132,13 +135,13 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
shouldCapture = true;
|
||||
}
|
||||
else if (_movie.Markers.IsMarker(frame))
|
||||
else if (_movie.Markers.IsMarker(frame + 1))
|
||||
{
|
||||
shouldCapture = true; // Markers shoudl always get priority
|
||||
}
|
||||
else
|
||||
{
|
||||
shouldCapture = frame - _lastCapture >= StateFrequency;
|
||||
shouldCapture = frame - States.Keys.Last(k => k < frame) >= StateFrequency;
|
||||
}
|
||||
|
||||
if (shouldCapture)
|
||||
|
@ -151,10 +154,10 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
else
|
||||
{
|
||||
States.Add(frame, state);
|
||||
Used += state.Length;
|
||||
MaybeRemoveState(); // Remove before adding so this state won't be removed.
|
||||
|
||||
MaybeRemoveState();
|
||||
States.Add(frame, state);
|
||||
}
|
||||
|
||||
_lastCapture = frame;
|
||||
|
@ -166,25 +169,31 @@ namespace BizHawk.Client.Common
|
|||
int shouldRemove = -1;
|
||||
if (Used >= Settings.Cap)
|
||||
shouldRemove = _movie.StartsFromSavestate ? 0 : 1;
|
||||
if (shouldRemove != -1)
|
||||
{ // Which one to remove?
|
||||
// No need to have two savestates with only lag frames between them.
|
||||
for (int i = shouldRemove; i < States.Count - 1; i++)
|
||||
{
|
||||
if (AllLag(States.ElementAt(i).Key, States.ElementAt(i + 1).Key))
|
||||
{
|
||||
shouldRemove = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldRemove != -1) // Which one to remove?
|
||||
{
|
||||
int markerSkips = maxStates / 3;
|
||||
|
||||
// Keep cap/2 (3?) marker saves
|
||||
int maxMarkers = Settings.Cap / 2;
|
||||
shouldRemove--;
|
||||
do
|
||||
{
|
||||
shouldRemove++;
|
||||
} while (_movie.Markers.IsMarker(States.ElementAt(shouldRemove).Key));
|
||||
|
||||
// No need to have two savestates with only lag frames between them.
|
||||
for (int i = shouldRemove + 1; i < States.Count - 1; i++)
|
||||
{
|
||||
if (AllLag(States.ElementAt(i).Key, States.ElementAt(i + 1).Key))
|
||||
{
|
||||
shouldRemove = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Keep marker states
|
||||
markerSkips--;
|
||||
if (markerSkips < 0)
|
||||
shouldRemove = _movie.StartsFromSavestate ? 0 : 1;
|
||||
} while (_movie.Markers.IsMarker(States.ElementAt(shouldRemove).Key + 1) && markerSkips > -1);
|
||||
int element = States.ElementAt(shouldRemove).Key;
|
||||
|
||||
// Remove
|
||||
Used -= States.ElementAt(shouldRemove).Value.Length;
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
CellWidthPadding = 3;
|
||||
CellHeightPadding = 1;
|
||||
CurrentCell = null;
|
||||
ScrollMethod = "near";
|
||||
|
||||
NormalFont = new Font("Courier New", 8); // Only support fixed width
|
||||
|
||||
|
@ -213,6 +214,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
[Category("Behavior")]
|
||||
public IEnumerable<RollColumn> VisibleColumns { get { return _columns.VisibleColumns; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets how the InputRoll scrolls when calling ScrollToIndex.
|
||||
/// </summary>
|
||||
[DefaultValue("near")]
|
||||
[Category("Behavior")]
|
||||
public string ScrollMethod { get; set; }
|
||||
|
||||
[Category("Behavior")]
|
||||
public bool AlwaysScroll { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns all columns including those that are not visible
|
||||
/// </summary>
|
||||
|
@ -553,7 +564,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (NeedsHScrollbar)
|
||||
{
|
||||
_programmaticallyUpdatingScrollBarValues = true;
|
||||
HBar.Value = value * CellWidth;
|
||||
if (value * CellWidth <= HBar.Maximum)
|
||||
HBar.Value = value * CellWidth;
|
||||
else
|
||||
HBar.Value = HBar.Maximum;
|
||||
_programmaticallyUpdatingScrollBarValues = false;
|
||||
}
|
||||
}
|
||||
|
@ -562,7 +576,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (NeedsVScrollbar)
|
||||
{
|
||||
_programmaticallyUpdatingScrollBarValues = true;
|
||||
VBar.Value = value * CellHeight;
|
||||
if (value * CellHeight <= VBar.Maximum)
|
||||
VBar.Value = value * CellHeight;
|
||||
else
|
||||
VBar.Value = VBar.Maximum;
|
||||
_programmaticallyUpdatingScrollBarValues = false;
|
||||
}
|
||||
}
|
||||
|
@ -683,6 +700,49 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public void ScrollToIndex(int index)
|
||||
{
|
||||
if (ScrollMethod == "near" && !IsVisible(index))
|
||||
{
|
||||
if (FirstVisibleRow > index)
|
||||
FirstVisibleRow = index;
|
||||
else
|
||||
LastVisibleRow = index;
|
||||
}
|
||||
if (!IsVisible(index) || AlwaysScroll)
|
||||
{
|
||||
if (ScrollMethod == "top")
|
||||
FirstVisibleRow = index;
|
||||
else if (ScrollMethod == "bottom")
|
||||
LastVisibleRow = index;
|
||||
else if (ScrollMethod == "center")
|
||||
{
|
||||
if (LagFramesToHide == 0)
|
||||
FirstVisibleRow = Math.Max(index - (VisibleRows / 2), 0);
|
||||
else
|
||||
{
|
||||
if (Math.Abs(FirstVisibleRow + CountLagFramesDisplay(VisibleRows / 2) - index) > VisibleRows) // Big jump
|
||||
{
|
||||
FirstVisibleRow = Math.Max(index - (ExpectedDisplayRange() / 2), 0);
|
||||
SetLagFramesArray();
|
||||
}
|
||||
|
||||
// Small jump, more accurate
|
||||
int lastVisible = FirstVisibleRow + CountLagFramesDisplay(VisibleRows / 2);
|
||||
do
|
||||
{
|
||||
if ((lastVisible - index) / (LagFramesToHide + 1) != 0)
|
||||
FirstVisibleRow = Math.Max(FirstVisibleRow - ((lastVisible - index) / (LagFramesToHide + 1)), 0);
|
||||
else
|
||||
FirstVisibleRow -= Math.Sign(lastVisible - index);
|
||||
SetLagFramesArray();
|
||||
lastVisible = FirstVisibleRow + CountLagFramesDisplay(VisibleRows / 2);
|
||||
} while ((lastVisible - index < 0 || lastVisible - index > lagFrames[VisibleRows]) && FirstVisibleRow != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
|
||||
public IEnumerable<int> SelectedRows
|
||||
|
@ -1546,6 +1606,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
} while (lagFrames[0] != 0 && VBar.Value != 0 && VBar.Value != VBar.Maximum);
|
||||
}
|
||||
|
||||
OnMouseMove(new MouseEventArgs(System.Windows.Forms.MouseButtons.None, 0, _currentX.Value, _currentY.Value, 0));
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
set
|
||||
{
|
||||
FollowCursorCheckbox.Checked = Tastudio.Settings.FollowCursor = value;
|
||||
FollowCursorCheckbox.Checked = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,10 +130,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void FollowCursorCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Tastudio.Settings.FollowCursor ^= true;
|
||||
|
||||
if (!_programmaticallyChangingValue)
|
||||
{
|
||||
Tastudio.Settings.FollowCursor ^= true;
|
||||
|
||||
if (Tastudio.Settings.FollowCursor)
|
||||
{
|
||||
Tastudio.SetVisibleIndex();
|
||||
|
|
|
@ -43,6 +43,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.saveSelectionToMacroToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.placeMacroAtSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.recentMacrosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripSeparator20 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.ToBk2MenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
|
@ -115,6 +117,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.HideLagFrames3 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.hideWasLagFramesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.followCursorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.alwaysScrollToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator24 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.scrollToViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.scrollToTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.scrollToBottomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.scrollToCenterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ColumnsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.HelpSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -158,8 +168,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.StartFromNowSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.StartNewProjectFromNowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.recentMacrosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.TASMenu.SuspendLayout();
|
||||
this.TasStatusStrip.SuspendLayout();
|
||||
this.MarkerContextMenu.SuspendLayout();
|
||||
|
@ -251,7 +259,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(57, 6);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
|
@ -272,6 +280,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.placeMacroAtSelectionToolStripMenuItem.Text = "Place Macro at Selection";
|
||||
this.placeMacroAtSelectionToolStripMenuItem.Click += new System.EventHandler(this.placeMacroAtSelectionToolStripMenuItem_Click);
|
||||
//
|
||||
// recentMacrosToolStripMenuItem
|
||||
//
|
||||
this.recentMacrosToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripSeparator22});
|
||||
this.recentMacrosToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
|
||||
this.recentMacrosToolStripMenuItem.Name = "recentMacrosToolStripMenuItem";
|
||||
this.recentMacrosToolStripMenuItem.Size = new System.Drawing.Size(203, 22);
|
||||
this.recentMacrosToolStripMenuItem.Text = "Recent Macros";
|
||||
this.recentMacrosToolStripMenuItem.DropDownOpened += new System.EventHandler(this.recentMacrosToolStripMenuItem_DropDownOpened);
|
||||
//
|
||||
// toolStripSeparator22
|
||||
//
|
||||
this.toolStripSeparator22.Name = "toolStripSeparator22";
|
||||
this.toolStripSeparator22.Size = new System.Drawing.Size(57, 6);
|
||||
//
|
||||
// toolStripSeparator20
|
||||
//
|
||||
this.toolStripSeparator20.Name = "toolStripSeparator20";
|
||||
|
@ -777,7 +800,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
//
|
||||
this.SettingsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.RotateMenuItem,
|
||||
this.HideLagFramesSubMenu});
|
||||
this.HideLagFramesSubMenu,
|
||||
this.toolStripSeparator23,
|
||||
this.followCursorToolStripMenuItem});
|
||||
this.SettingsSubMenu.Name = "SettingsSubMenu";
|
||||
this.SettingsSubMenu.Size = new System.Drawing.Size(61, 20);
|
||||
this.SettingsSubMenu.Text = "&Settings";
|
||||
|
@ -854,6 +879,72 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.hideWasLagFramesToolStripMenuItem.Text = "Hide WasLag Frames";
|
||||
this.hideWasLagFramesToolStripMenuItem.Click += new System.EventHandler(this.hideWasLagFramesToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator23
|
||||
//
|
||||
this.toolStripSeparator23.Name = "toolStripSeparator23";
|
||||
this.toolStripSeparator23.Size = new System.Drawing.Size(159, 6);
|
||||
//
|
||||
// followCursorToolStripMenuItem
|
||||
//
|
||||
this.followCursorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.alwaysScrollToolStripMenuItem,
|
||||
this.toolStripSeparator24,
|
||||
this.scrollToViewToolStripMenuItem,
|
||||
this.scrollToTopToolStripMenuItem,
|
||||
this.scrollToBottomToolStripMenuItem,
|
||||
this.scrollToCenterToolStripMenuItem});
|
||||
this.followCursorToolStripMenuItem.Name = "followCursorToolStripMenuItem";
|
||||
this.followCursorToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
|
||||
this.followCursorToolStripMenuItem.Text = "Follow Cursor";
|
||||
this.followCursorToolStripMenuItem.DropDownOpened += new System.EventHandler(this.followCursorToolStripMenuItem_DropDownOpened);
|
||||
//
|
||||
// alwaysScrollToolStripMenuItem
|
||||
//
|
||||
this.alwaysScrollToolStripMenuItem.CheckOnClick = true;
|
||||
this.alwaysScrollToolStripMenuItem.Name = "alwaysScrollToolStripMenuItem";
|
||||
this.alwaysScrollToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.alwaysScrollToolStripMenuItem.Text = "Always Scroll";
|
||||
this.alwaysScrollToolStripMenuItem.Click += new System.EventHandler(this.alwaysScrollToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator24
|
||||
//
|
||||
this.toolStripSeparator24.Name = "toolStripSeparator24";
|
||||
this.toolStripSeparator24.Size = new System.Drawing.Size(157, 6);
|
||||
//
|
||||
// scrollToViewToolStripMenuItem
|
||||
//
|
||||
this.scrollToViewToolStripMenuItem.Checked = true;
|
||||
this.scrollToViewToolStripMenuItem.CheckOnClick = true;
|
||||
this.scrollToViewToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.scrollToViewToolStripMenuItem.Name = "scrollToViewToolStripMenuItem";
|
||||
this.scrollToViewToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.scrollToViewToolStripMenuItem.Text = "Scroll to View";
|
||||
this.scrollToViewToolStripMenuItem.Click += new System.EventHandler(this.scrollToViewToolStripMenuItem_Click);
|
||||
//
|
||||
// scrollToTopToolStripMenuItem
|
||||
//
|
||||
this.scrollToTopToolStripMenuItem.CheckOnClick = true;
|
||||
this.scrollToTopToolStripMenuItem.Name = "scrollToTopToolStripMenuItem";
|
||||
this.scrollToTopToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.scrollToTopToolStripMenuItem.Text = "Scroll to Top";
|
||||
this.scrollToTopToolStripMenuItem.Click += new System.EventHandler(this.scrollToTopToolStripMenuItem_Click);
|
||||
//
|
||||
// scrollToBottomToolStripMenuItem
|
||||
//
|
||||
this.scrollToBottomToolStripMenuItem.CheckOnClick = true;
|
||||
this.scrollToBottomToolStripMenuItem.Name = "scrollToBottomToolStripMenuItem";
|
||||
this.scrollToBottomToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.scrollToBottomToolStripMenuItem.Text = "Scroll to Bottom";
|
||||
this.scrollToBottomToolStripMenuItem.Click += new System.EventHandler(this.scrollToBottomToolStripMenuItem_Click);
|
||||
//
|
||||
// scrollToCenterToolStripMenuItem
|
||||
//
|
||||
this.scrollToCenterToolStripMenuItem.CheckOnClick = true;
|
||||
this.scrollToCenterToolStripMenuItem.Name = "scrollToCenterToolStripMenuItem";
|
||||
this.scrollToCenterToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.scrollToCenterToolStripMenuItem.Text = "Scroll to Center";
|
||||
this.scrollToCenterToolStripMenuItem.Click += new System.EventHandler(this.scrollToCenterToolStripMenuItem_Click);
|
||||
//
|
||||
// ColumnsSubMenu
|
||||
//
|
||||
this.ColumnsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -900,6 +991,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
//
|
||||
this.TasView.AllowColumnReorder = false;
|
||||
this.TasView.AllowColumnResize = false;
|
||||
this.TasView.AlwaysScroll = false;
|
||||
this.TasView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
|
@ -1222,21 +1314,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Markers";
|
||||
//
|
||||
// recentMacrosToolStripMenuItem
|
||||
//
|
||||
this.recentMacrosToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripSeparator22});
|
||||
this.recentMacrosToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
|
||||
this.recentMacrosToolStripMenuItem.Name = "recentMacrosToolStripMenuItem";
|
||||
this.recentMacrosToolStripMenuItem.Size = new System.Drawing.Size(203, 22);
|
||||
this.recentMacrosToolStripMenuItem.Text = "Recent Macros";
|
||||
this.recentMacrosToolStripMenuItem.DropDownOpened += new System.EventHandler(this.recentMacrosToolStripMenuItem_DropDownOpened);
|
||||
//
|
||||
// toolStripSeparator22
|
||||
//
|
||||
this.toolStripSeparator22.Name = "toolStripSeparator22";
|
||||
this.toolStripSeparator22.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// TAStudio
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
@ -1249,6 +1326,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.Controls.Add(this.TASMenu);
|
||||
this.Controls.Add(this.TasView);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.KeyPreview = true;
|
||||
this.MainMenuStrip = this.TASMenu;
|
||||
this.MinimumSize = new System.Drawing.Size(437, 148);
|
||||
this.Name = "TAStudio";
|
||||
|
@ -1258,6 +1336,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.Load += new System.EventHandler(this.Tastudio_Load);
|
||||
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragDrop);
|
||||
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragEnter);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TAStudio_KeyDown);
|
||||
this.MouseLeave += new System.EventHandler(this.TAStudio_MouseLeave);
|
||||
this.TASMenu.ResumeLayout(false);
|
||||
this.TASMenu.PerformLayout();
|
||||
|
@ -1401,5 +1480,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
private System.Windows.Forms.ToolStripMenuItem ToBk2MenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem recentMacrosToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator22;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator23;
|
||||
private System.Windows.Forms.ToolStripMenuItem followCursorToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem alwaysScrollToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator24;
|
||||
private System.Windows.Forms.ToolStripMenuItem scrollToViewToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem scrollToTopToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem scrollToBottomToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem scrollToCenterToolStripMenuItem;
|
||||
}
|
||||
}
|
|
@ -121,23 +121,5 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetVisibleIndex(int? indexThatMustBeVisible = null)
|
||||
{
|
||||
if (!indexThatMustBeVisible.HasValue)
|
||||
{
|
||||
indexThatMustBeVisible = CurrentTasMovie.IsRecording
|
||||
? CurrentTasMovie.InputLogLength
|
||||
: Emulator.Frame;
|
||||
}
|
||||
|
||||
if (!TasView.IsVisible(indexThatMustBeVisible.Value))
|
||||
{
|
||||
if (TasView.FirstVisibleRow > indexThatMustBeVisible.Value)
|
||||
TasView.FirstVisibleRow = indexThatMustBeVisible.Value;
|
||||
else
|
||||
TasView.LastVisibleRow = indexThatMustBeVisible.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,7 +283,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void TasView_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
TasView.Focus();
|
||||
if (this.ContainsFocus)
|
||||
TasView.Focus();
|
||||
}
|
||||
|
||||
private void TasView_MouseDown(object sender, MouseEventArgs e)
|
||||
|
|
|
@ -801,6 +801,47 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
TasView.HideWasLagFrames ^= true;
|
||||
}
|
||||
|
||||
private void alwaysScrollToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
TasView.AlwaysScroll = alwaysScrollToolStripMenuItem.Checked;
|
||||
}
|
||||
|
||||
private void scrollToViewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
TasView.ScrollMethod = "near";
|
||||
}
|
||||
|
||||
private void scrollToTopToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
TasView.ScrollMethod = "top";
|
||||
}
|
||||
|
||||
private void scrollToBottomToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
TasView.ScrollMethod = "bottom";
|
||||
}
|
||||
|
||||
private void scrollToCenterToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
TasView.ScrollMethod = "center";
|
||||
}
|
||||
|
||||
private void followCursorToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
scrollToViewToolStripMenuItem.Checked = false;
|
||||
scrollToTopToolStripMenuItem.Checked = false;
|
||||
scrollToBottomToolStripMenuItem.Checked = false;
|
||||
scrollToCenterToolStripMenuItem.Checked = false;
|
||||
if (TasView.ScrollMethod == "near")
|
||||
scrollToViewToolStripMenuItem.Checked = true;
|
||||
else if (TasView.ScrollMethod == "top")
|
||||
scrollToTopToolStripMenuItem.Checked = true;
|
||||
else if (TasView.ScrollMethod == "bottom")
|
||||
scrollToBottomToolStripMenuItem.Checked = true;
|
||||
else
|
||||
scrollToCenterToolStripMenuItem.Checked = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -155,5 +155,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
GoToFrame(marker.Frame);
|
||||
}
|
||||
|
||||
public void SetVisibleIndex(int? indexThatMustBeVisible = null)
|
||||
{
|
||||
if (!indexThatMustBeVisible.HasValue)
|
||||
{
|
||||
indexThatMustBeVisible = CurrentTasMovie.IsRecording
|
||||
? CurrentTasMovie.InputLogLength
|
||||
: Emulator.Frame;
|
||||
}
|
||||
|
||||
TasView.ScrollToIndex(indexThatMustBeVisible.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -781,5 +781,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void TAStudio_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.F)
|
||||
TasPlaybackBox.FollowCursor ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue