tastudio: AutoadjustInput
remove all consecutive was-lag frames in batch like taseditor does. current frame has no lag so they will all have to go anyway still need to fix wrong pausing
This commit is contained in:
parent
cf464d4481
commit
1da3e4d773
File diff suppressed because it is too large
Load Diff
|
@ -70,7 +70,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
var refreshNeeded = false;
|
var refreshNeeded = false;
|
||||||
if (AutoadjustInputMenuItem.Checked)
|
if (Settings.AutoadjustInput)
|
||||||
{
|
{
|
||||||
refreshNeeded = AutoAdjustInput();
|
refreshNeeded = AutoAdjustInput();
|
||||||
}
|
}
|
||||||
|
|
|
@ -768,6 +768,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick;
|
LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick;
|
||||||
BindMarkersToInputMenuItem.Checked = CurrentTasMovie.BindMarkersToInput;
|
BindMarkersToInputMenuItem.Checked = CurrentTasMovie.BindMarkersToInput;
|
||||||
CopyIncludesFrameNoMenuItem.Checked = Settings.CopyIncludesFrameNo;
|
CopyIncludesFrameNoMenuItem.Checked = Settings.CopyIncludesFrameNo;
|
||||||
|
AutoadjustInputMenuItem.Checked = Settings.AutoadjustInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
|
private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
|
||||||
|
@ -802,6 +803,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void CopyIncludesFrameNoMenuItem_Click(object sender, EventArgs e)
|
private void CopyIncludesFrameNoMenuItem_Click(object sender, EventArgs e)
|
||||||
=> Settings.CopyIncludesFrameNo = !Settings.CopyIncludesFrameNo;
|
=> Settings.CopyIncludesFrameNo = !Settings.CopyIncludesFrameNo;
|
||||||
|
|
||||||
|
private void AutoadjustInputMenuItem_Click(object sender, EventArgs e)
|
||||||
|
=> Settings.AutoadjustInput = !Settings.AutoadjustInput;
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -78,6 +78,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
OldControlSchemeForBranches = false;
|
OldControlSchemeForBranches = false;
|
||||||
LoadBranchOnDoubleClick = true;
|
LoadBranchOnDoubleClick = true;
|
||||||
CopyIncludesFrameNo = false;
|
CopyIncludesFrameNo = false;
|
||||||
|
AutoadjustInput = false;
|
||||||
|
|
||||||
// default to taseditor fashion
|
// default to taseditor fashion
|
||||||
DenoteStatesWithIcons = false;
|
DenoteStatesWithIcons = false;
|
||||||
|
@ -110,8 +111,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
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 bool CopyIncludesFrameNo { get; set; }
|
||||||
|
public bool AutoadjustInput { get; set; }
|
||||||
public TAStudioPalette Palette { get; set; }
|
public TAStudioPalette Palette { get; set; }
|
||||||
public int MaxUndoSteps { get; set; } = 100;
|
public int MaxUndoSteps { get; set; } = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TAStudio()
|
public TAStudio()
|
||||||
|
@ -1099,16 +1101,31 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (lagLog.WasLagged.Value && !isLag)
|
if (lagLog.WasLagged.Value && !isLag)
|
||||||
{
|
{
|
||||||
|
// remove all consecutive was-lag frames in batch like taseditor
|
||||||
|
// current frame has no lag so they will all have to go anyway
|
||||||
|
var framesToRemove = new List<int>{ Emulator.Frame - 1 };
|
||||||
|
for (int frame = Emulator.Frame; CurrentTasMovie[frame].WasLagged.HasValue; frame++)
|
||||||
|
{
|
||||||
|
if (CurrentTasMovie[frame].WasLagged.Value)
|
||||||
|
{
|
||||||
|
framesToRemove.Add(frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Deleting this frame requires rewinding a frame.
|
// Deleting this frame requires rewinding a frame.
|
||||||
CurrentTasMovie.ChangeLog.AddInputBind(Emulator.Frame - 1, true, $"Bind Input; Delete {Emulator.Frame - 1}");
|
CurrentTasMovie.ChangeLog.AddInputBind(Emulator.Frame - 1, true, $"Bind Input; Delete {Emulator.Frame - 1}");
|
||||||
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
|
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
|
||||||
CurrentTasMovie.ChangeLog.IsRecording = false;
|
CurrentTasMovie.ChangeLog.IsRecording = false;
|
||||||
|
|
||||||
CurrentTasMovie.RemoveFrame(Emulator.Frame - 1);
|
CurrentTasMovie.RemoveFrames(framesToRemove);
|
||||||
CurrentTasMovie.LagLog.RemoveHistoryAt(Emulator.Frame); // Removes from WasLag
|
foreach (int f in framesToRemove)
|
||||||
|
{
|
||||||
|
CurrentTasMovie.LagLog.RemoveHistoryAt(f + 1); // Removes from WasLag
|
||||||
|
}
|
||||||
|
|
||||||
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
||||||
GoToFrame(Emulator.Frame - 1);
|
GoToLastEmulatedFrameIfNecessary(Emulator.Frame - 1);
|
||||||
|
DoAutoRestore();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue