Replace SelectionFocused variable I accidentally added

This commit is contained in:
RetroEdit 2020-09-18 19:53:07 +00:00
parent 9e4f81e3a4
commit 0d72cd901a
No known key found for this signature in database
GPG Key ID: CE9E2A36E1EFA76F
3 changed files with 14 additions and 19 deletions

View File

@ -946,11 +946,6 @@ namespace BizHawk.Client.EmuHawk
public bool AnyRowsSelected => _selectedItems.Any(cell => cell.RowIndex.HasValue); public bool AnyRowsSelected => _selectedItems.Any(cell => cell.RowIndex.HasValue);
/// <summary>
/// Rows are selected and the selection is in focus.
/// </summary>
public bool SelectionFocused => AnyRowsSelected && Focused;
public IEnumerable<ToolStripItem> GenerateContextMenuItems() public IEnumerable<ToolStripItem> GenerateContextMenuItems()
{ {
if (Rotatable) if (Rotatable)

View File

@ -205,7 +205,7 @@ namespace BizHawk.Client.EmuHawk
private void SaveSelectionToMacroMenuItem_Click(object sender, EventArgs e) private void SaveSelectionToMacroMenuItem_Click(object sender, EventArgs e)
{ {
if (!TasView.SelectionFocused) if (!TasView.Focused && TasView.AnyRowsSelected)
{ {
return; return;
} }
@ -230,7 +230,7 @@ namespace BizHawk.Client.EmuHawk
private void PlaceMacroAtSelectionMenuItem_Click(object sender, EventArgs e) private void PlaceMacroAtSelectionMenuItem_Click(object sender, EventArgs e)
{ {
if (!TasView.SelectionFocused) if (!TasView.Focused && TasView.AnyRowsSelected)
{ {
return; return;
} }
@ -392,7 +392,7 @@ namespace BizHawk.Client.EmuHawk
private void SelectBetweenMarkersMenuItem_Click(object sender, EventArgs e) private void SelectBetweenMarkersMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var prevMarker = CurrentTasMovie.Markers.PreviousOrCurrent(TasView.LastSelectedIndex ?? 0); var prevMarker = CurrentTasMovie.Markers.PreviousOrCurrent(TasView.LastSelectedIndex ?? 0);
var nextMarker = CurrentTasMovie.Markers.Next(TasView.LastSelectedIndex ?? 0); var nextMarker = CurrentTasMovie.Markers.Next(TasView.LastSelectedIndex ?? 0);
@ -424,7 +424,7 @@ namespace BizHawk.Client.EmuHawk
private void CopyMenuItem_Click(object sender, EventArgs e) private void CopyMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
_tasClipboard.Clear(); _tasClipboard.Clear();
var list = TasView.SelectedRows.ToArray(); var list = TasView.SelectedRows.ToArray();
@ -450,7 +450,7 @@ namespace BizHawk.Client.EmuHawk
private void PasteMenuItem_Click(object sender, EventArgs e) private void PasteMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
// TODO: if highlighting 2 rows and pasting 3, only paste 2 of them // TODO: if highlighting 2 rows and pasting 3, only paste 2 of them
// FCEUX Taseditor doesn't do this, but I think it is the expected behavior in editor programs // FCEUX Taseditor doesn't do this, but I think it is the expected behavior in editor programs
@ -493,7 +493,7 @@ namespace BizHawk.Client.EmuHawk
private void PasteInsertMenuItem_Click(object sender, EventArgs e) private void PasteInsertMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
// copy paste from PasteMenuItem_Click! // copy paste from PasteMenuItem_Click!
IDataObject data = Clipboard.GetDataObject(); IDataObject data = Clipboard.GetDataObject();
@ -534,7 +534,7 @@ namespace BizHawk.Client.EmuHawk
private void CutMenuItem_Click(object sender, EventArgs e) private void CutMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
var rollBackFrame = TasView.FirstSelectedIndex ?? 0; var rollBackFrame = TasView.FirstSelectedIndex ?? 0;
@ -572,7 +572,7 @@ namespace BizHawk.Client.EmuHawk
private void ClearFramesMenuItem_Click(object sender, EventArgs e) private void ClearFramesMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var firstWithInput = FirstNonEmptySelectedFrame; var firstWithInput = FirstNonEmptySelectedFrame;
bool needsToRollback = firstWithInput.HasValue && firstWithInput < Emulator.Frame; bool needsToRollback = firstWithInput.HasValue && firstWithInput < Emulator.Frame;
@ -598,7 +598,7 @@ namespace BizHawk.Client.EmuHawk
private void DeleteFramesMenuItem_Click(object sender, EventArgs e) private void DeleteFramesMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
var rollBackFrame = TasView.FirstSelectedIndex ?? 0; var rollBackFrame = TasView.FirstSelectedIndex ?? 0;
@ -640,7 +640,7 @@ namespace BizHawk.Client.EmuHawk
{ {
for (int i = 0; i < timesToClone; i++) for (int i = 0; i < timesToClone; i++)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var framesToInsert = TasView.SelectedRows; var framesToInsert = TasView.SelectedRows;
var insertionFrame = Math.Min((TasView.LastSelectedIndex ?? 0) + 1, CurrentTasMovie.InputLogLength); var insertionFrame = Math.Min((TasView.LastSelectedIndex ?? 0) + 1, CurrentTasMovie.InputLogLength);
@ -665,7 +665,7 @@ namespace BizHawk.Client.EmuHawk
private void InsertFrameMenuItem_Click(object sender, EventArgs e) private void InsertFrameMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var insertionFrame = TasView.FirstSelectedIndex ?? 0; var insertionFrame = TasView.FirstSelectedIndex ?? 0;
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
@ -684,7 +684,7 @@ namespace BizHawk.Client.EmuHawk
private void InsertNumFramesMenuItem_Click(object sender, EventArgs e) private void InsertNumFramesMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
int insertionFrame = TasView.FirstSelectedIndex ?? 0; int insertionFrame = TasView.FirstSelectedIndex ?? 0;
using var framesPrompt = new FramesPrompt(); using var framesPrompt = new FramesPrompt();
@ -697,7 +697,7 @@ namespace BizHawk.Client.EmuHawk
private void TruncateMenuItem_Click(object sender, EventArgs e) private void TruncateMenuItem_Click(object sender, EventArgs e)
{ {
if (TasView.SelectionFocused) if (TasView.Focused && TasView.AnyRowsSelected)
{ {
var rollbackFrame = TasView.LastSelectedIndex ?? 0; var rollbackFrame = TasView.LastSelectedIndex ?? 0;
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;

View File

@ -702,7 +702,7 @@ namespace BizHawk.Client.EmuHawk
private void DummyLoadMacro(string path) private void DummyLoadMacro(string path)
{ {
if (!TasView.SelectionFocused) if (!TasView.Focused && TasView.AnyRowsSelected)
{ {
return; return;
} }