Add toggle to TAStudio for including frame no. when copying rows

resolves #2643
This commit is contained in:
YoshiRulz 2021-08-23 13:12:46 +10:00
parent c4ff971113
commit a26753234b
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
4 changed files with 23 additions and 3 deletions

View File

@ -191,6 +191,7 @@ namespace BizHawk.Client.EmuHawk
this.BranchesMarkersSplit = new System.Windows.Forms.SplitContainer(); this.BranchesMarkersSplit = new System.Windows.Forms.SplitContainer();
this.MainVertialSplit = new System.Windows.Forms.SplitContainer(); this.MainVertialSplit = new System.Windows.Forms.SplitContainer();
this.SetFontMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.SetFontMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx();
this.CopyIncludesFrameNoMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx();
this.TASMenu.SuspendLayout(); this.TASMenu.SuspendLayout();
this.TasStatusStrip.SuspendLayout(); this.TasStatusStrip.SuspendLayout();
this.RightClickMenu.SuspendLayout(); this.RightClickMenu.SuspendLayout();
@ -481,6 +482,7 @@ namespace BizHawk.Client.EmuHawk
this.SetMaxUndoLevelsMenuItem, this.SetMaxUndoLevelsMenuItem,
this.SetBranchCellHoverIntervalMenuItem, this.SetBranchCellHoverIntervalMenuItem,
this.SetSeekingCutoffIntervalMenuItem, this.SetSeekingCutoffIntervalMenuItem,
this.CopyIncludesFrameNoMenuItem,
this.toolStripSeparator26, this.toolStripSeparator26,
this.autosaveToolStripMenuItem, this.autosaveToolStripMenuItem,
this.BackupPerFileSaveMenuItem, this.BackupPerFileSaveMenuItem,
@ -1176,6 +1178,11 @@ namespace BizHawk.Client.EmuHawk
this.SetFontMenuItem.Text = "Set Font"; this.SetFontMenuItem.Text = "Set Font";
this.SetFontMenuItem.Click += new System.EventHandler(this.SetFontMenuItem_Click); this.SetFontMenuItem.Click += new System.EventHandler(this.SetFontMenuItem_Click);
// //
// CopyIncludesFrameNoMenuItem
//
this.CopyIncludesFrameNoMenuItem.Text = "Include Frame No. When Copying Row(s)";
this.CopyIncludesFrameNoMenuItem.Click += new System.EventHandler(this.CopyIncludesFrameNoMenuItem_Click);
//
// TAStudio // TAStudio
// //
this.AllowDrop = true; this.AllowDrop = true;
@ -1374,5 +1381,6 @@ namespace BizHawk.Client.EmuHawk
private BizHawk.WinForms.Controls.ToolStripMenuItemEx SingleClickAxisEditMenuItem; private BizHawk.WinForms.Controls.ToolStripMenuItemEx SingleClickAxisEditMenuItem;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx LoadBranchOnDoubleclickMenuItem; private BizHawk.WinForms.Controls.ToolStripMenuItemEx LoadBranchOnDoubleclickMenuItem;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx SetFontMenuItem; private BizHawk.WinForms.Controls.ToolStripMenuItemEx SetFontMenuItem;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx CopyIncludesFrameNoMenuItem;
} }
} }

View File

@ -313,6 +313,10 @@ namespace BizHawk.Client.EmuHawk
} }
} }
/// <returns><paramref name="index"/> with leading zeroes such that every frame in the movie will be printed with the same number of digits</returns>
private string FrameToStringPadded(int index)
=> index.ToString().PadLeft(CurrentTasMovie.InputLogLength.ToString().Length, '0');
private void TasView_QueryItemText(int index, RollColumn column, out string text, ref int offsetX, ref int offsetY) private void TasView_QueryItemText(int index, RollColumn column, out string text, ref int offsetX, ref int offsetY)
{ {
if (!_engaged || _initializing) if (!_engaged || _initializing)
@ -344,7 +348,7 @@ namespace BizHawk.Client.EmuHawk
else if (columnName == FrameColumnName) else if (columnName == FrameColumnName)
{ {
offsetX = TasView.HorizontalOrientation ? 2 : 7; offsetX = TasView.HorizontalOrientation ? 2 : 7;
text = index.ToString().PadLeft(CurrentTasMovie.InputLogLength.ToString().Length, '0'); text = FrameToStringPadded(index);
} }
else else
{ {

View File

@ -461,8 +461,8 @@ namespace BizHawk.Client.EmuHawk
} }
_tasClipboard.Add(new TasClipboardEntry(index, input)); _tasClipboard.Add(new TasClipboardEntry(index, input));
var lg = CurrentTasMovie.LogGeneratorInstance(input); var logEntry = CurrentTasMovie.LogGeneratorInstance(input).GenerateLogEntry();
sb.AppendLine(lg.GenerateLogEntry()); sb.AppendLine(Settings.CopyIncludesFrameNo ? $"{FrameToStringPadded(index)} {logEntry}" : logEntry);
} }
Clipboard.SetDataObject(sb.ToString()); Clipboard.SetDataObject(sb.ToString());
@ -828,6 +828,7 @@ namespace BizHawk.Client.EmuHawk
OldControlSchemeForBranchesMenuItem.Checked = Settings.OldControlSchemeForBranches; OldControlSchemeForBranchesMenuItem.Checked = Settings.OldControlSchemeForBranches;
LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick; LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick;
BindMarkersToInputMenuItem.Checked = CurrentTasMovie.BindMarkersToInput; BindMarkersToInputMenuItem.Checked = CurrentTasMovie.BindMarkersToInput;
CopyIncludesFrameNoMenuItem.Checked = Settings.CopyIncludesFrameNo;
} }
private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e) private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
@ -901,6 +902,11 @@ namespace BizHawk.Client.EmuHawk
} }
} }
private void CopyIncludesFrameNoMenuItem_Click(object sender, EventArgs e)
{
Settings.CopyIncludesFrameNo ^= true;
}
private void SetAutosaveIntervalMenuItem_Click(object sender, EventArgs e) private void SetAutosaveIntervalMenuItem_Click(object sender, EventArgs e)
{ {
using var prompt = new InputPrompt using var prompt = new InputPrompt

View File

@ -75,6 +75,7 @@ namespace BizHawk.Client.EmuHawk
SingleClickAxisEdit = false; SingleClickAxisEdit = false;
OldControlSchemeForBranches = false; OldControlSchemeForBranches = false;
LoadBranchOnDoubleClick = true; LoadBranchOnDoubleClick = true;
CopyIncludesFrameNo = false;
// default to taseditor fashion // default to taseditor fashion
DenoteStatesWithIcons = false; DenoteStatesWithIcons = false;
@ -107,6 +108,7 @@ namespace BizHawk.Client.EmuHawk
public int MainVerticalSplitDistance { get; set; } public int MainVerticalSplitDistance { get; set; }
public int BranchMarkerSplitDistance { get; set; } public int BranchMarkerSplitDistance { get; set; }
public bool BindMarkersToInput { get; set; } public bool BindMarkersToInput { get; set; }
public bool CopyIncludesFrameNo { get; set; }
} }
public TAStudio() public TAStudio()