TAstudio - on some editing functions, dont' pause the emulator if it wasn't paused to begin with
This commit is contained in:
parent
32cdc80639
commit
2e7546c67a
|
@ -203,6 +203,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
// 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 does't do this, but I think it is the expected behavior in editor programs
|
// FCEUX Taseditor does't do this, but I think it is the expected behavior in editor programs
|
||||||
|
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
|
|
||||||
if (_tasClipboard.Any())
|
if (_tasClipboard.Any())
|
||||||
{
|
{
|
||||||
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
||||||
|
@ -212,7 +215,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(TasView.FirstSelectedIndex.Value);
|
GoToLastEmulatedFrameIfNecessary(TasView.FirstSelectedIndex.Value);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -223,6 +233,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void PasteInsertMenuItem_Click(object sender, EventArgs e)
|
private void PasteInsertMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
|
|
||||||
if (_tasClipboard.Any())
|
if (_tasClipboard.Any())
|
||||||
{
|
{
|
||||||
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
||||||
|
@ -232,7 +244,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(TasView.FirstSelectedIndex.Value);
|
GoToLastEmulatedFrameIfNecessary(TasView.FirstSelectedIndex.Value);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -245,6 +264,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.SelectedRows.Any())
|
if (TasView.SelectedRows.Any())
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
var needsToRollback = !(TasView.FirstSelectedIndex.Value > Global.Emulator.Frame);
|
var needsToRollback = !(TasView.FirstSelectedIndex.Value > Global.Emulator.Frame);
|
||||||
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
||||||
|
|
||||||
|
@ -268,7 +288,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(rollBackFrame);
|
GoToLastEmulatedFrameIfNecessary(rollBackFrame);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -281,6 +308,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.SelectedRows.Any())
|
if (TasView.SelectedRows.Any())
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
||||||
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
||||||
|
|
||||||
|
@ -292,7 +320,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(rollBackFrame);
|
GoToLastEmulatedFrameIfNecessary(rollBackFrame);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -305,6 +340,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.SelectedRows.Any())
|
if (TasView.SelectedRows.Any())
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
var needsToRollback = !(TasView.FirstSelectedIndex > Global.Emulator.Frame);
|
||||||
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
||||||
|
|
||||||
|
@ -315,7 +351,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(rollBackFrame);
|
GoToLastEmulatedFrameIfNecessary(rollBackFrame);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -328,6 +371,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.SelectedRows.Any())
|
if (TasView.SelectedRows.Any())
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
var framesToInsert = TasView.SelectedRows.ToList();
|
var framesToInsert = TasView.SelectedRows.ToList();
|
||||||
var insertionFrame = TasView.LastSelectedIndex.Value + 1;
|
var insertionFrame = TasView.LastSelectedIndex.Value + 1;
|
||||||
var needsToRollback = !(insertionFrame > Global.Emulator.Frame);
|
var needsToRollback = !(insertionFrame > Global.Emulator.Frame);
|
||||||
|
@ -341,8 +385,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(insertionFrame);
|
GoToLastEmulatedFrameIfNecessary(insertionFrame);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
RefreshDialog();
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -353,6 +403,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void InsertFrameMenuItem_Click(object sender, EventArgs e)
|
private void InsertFrameMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
var insertionFrame = TasView.SelectedRows.Any() ? TasView.FirstSelectedIndex.Value : 0;
|
var insertionFrame = TasView.SelectedRows.Any() ? TasView.FirstSelectedIndex.Value : 0;
|
||||||
var needsToRollback = insertionFrame <= Global.Emulator.Frame;
|
var needsToRollback = insertionFrame <= Global.Emulator.Frame;
|
||||||
|
|
||||||
|
@ -361,8 +412,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(insertionFrame);
|
GoToLastEmulatedFrameIfNecessary(insertionFrame);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
RefreshDialog();
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -372,6 +429,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void InsertNumFramesMenuItem_Click(object sender, EventArgs e)
|
private void InsertNumFramesMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
var insertionFrame = TasView.SelectedRows.Any() ? TasView.FirstSelectedIndex.Value : 0;
|
var insertionFrame = TasView.SelectedRows.Any() ? TasView.FirstSelectedIndex.Value : 0;
|
||||||
var needsToRollback = insertionFrame <= Global.Emulator.Frame;
|
var needsToRollback = insertionFrame <= Global.Emulator.Frame;
|
||||||
|
|
||||||
|
@ -385,8 +443,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (needsToRollback)
|
if (needsToRollback)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(insertionFrame);
|
GoToLastEmulatedFrameIfNecessary(insertionFrame);
|
||||||
DoAutoRestore();
|
if (wasPaused)
|
||||||
RefreshDialog();
|
{
|
||||||
|
DoAutoRestore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue