Tastudio - when clearing, invalidate on the first non-empty input rather than first selected row
This commit is contained in:
parent
5bbdf2a49e
commit
cb912bea58
|
@ -625,11 +625,32 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private int? FirstNonEmptySelectedFrame
|
||||
{
|
||||
get
|
||||
{
|
||||
var lg = CurrentTasMovie.LogGeneratorInstance();
|
||||
lg.SetSource(Global.MovieSession.MovieControllerInstance());
|
||||
var empty = lg.EmptyEntry;
|
||||
foreach (var row in TasView.SelectedRows)
|
||||
{
|
||||
|
||||
if (CurrentTasMovie[row].LogEntry != empty)
|
||||
{
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearFramesMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TasView.AnyRowsSelected)
|
||||
{
|
||||
bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||
var firstWithInput = FirstNonEmptySelectedFrame;
|
||||
bool needsToRollback = firstWithInput.HasValue && firstWithInput < Emulator.Frame;
|
||||
int rollBackFrame = TasView.FirstSelectedIndex ?? 0;
|
||||
|
||||
CurrentTasMovie.ChangeLog.BeginNewBatch($"Clear frames {TasView.SelectedRows.Min()}-{TasView.SelectedRows.Max()}");
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public TAStudioSettings Settings { get; set; }
|
||||
|
||||
[ConfigPersist]
|
||||
public Font TasViewFont { get; set; } = new Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
|
||||
public Font TasViewFont { get; set; } = new Font("Arial", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
|
||||
|
||||
public class TAStudioSettings
|
||||
{
|
||||
|
@ -706,7 +706,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
var loadZone = new MovieZone(path)
|
||||
{
|
||||
Start = TasView.FirstSelectedIndex.Value
|
||||
Start = TasView.FirstSelectedIndex ?? 0
|
||||
};
|
||||
loadZone.PlaceZone(CurrentTasMovie);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue