Include undo history form refreshing with TAStudio's refresh logic. Fix a bug that could cause an invalid scroll in undo history form.
This commit is contained in:
parent
ab05b87a7d
commit
c027fda27f
|
@ -8,7 +8,6 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
List<string> Names { get; }
|
||||
int UndoIndex { get; }
|
||||
string NextUndoStepName { get; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the movie is recording action history.
|
||||
/// This is not intended to turn off the ChangeLog, but to disable the normal recording process.
|
||||
|
@ -226,19 +225,6 @@ namespace BizHawk.Client.Common
|
|||
public bool CanUndo => UndoIndex > -1;
|
||||
public bool CanRedo => UndoIndex < _history.Count - 1;
|
||||
|
||||
public string NextUndoStepName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Names.Count == 0 || UndoIndex < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Names[UndoIndex];
|
||||
}
|
||||
}
|
||||
|
||||
private void AddMovieAction(string name)
|
||||
{
|
||||
if (UndoIndex + 1 != _history.Count)
|
||||
|
|
|
@ -852,11 +852,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshDialog();
|
||||
return true;
|
||||
}
|
||||
else if (TasView.RowCount != CurrentTasMovie.InputLogLength + 1)
|
||||
else
|
||||
{
|
||||
// Row count must always be kept up to date even if last row is not directly visible.
|
||||
TasView.RowCount = CurrentTasMovie.InputLogLength + 1;
|
||||
return true;
|
||||
if (_undoForm != null && !_undoForm.IsDisposed)
|
||||
{
|
||||
_undoForm.UpdateValues();
|
||||
}
|
||||
if (TasView.RowCount != CurrentTasMovie.InputLogLength + 1)
|
||||
{
|
||||
// Row count must always be kept up to date even if last row is not directly visible.
|
||||
TasView.RowCount = CurrentTasMovie.InputLogLength + 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private const string UndoColumnName = "Undo Step";
|
||||
|
||||
private readonly TAStudio _tastudio;
|
||||
private string _lastUndoAction;
|
||||
private int _lastUndoAction;
|
||||
private IMovieChangeLog Log => _tastudio.CurrentTasMovie.ChangeLog;
|
||||
|
||||
public UndoHistoryForm(TAStudio owner)
|
||||
|
@ -50,14 +50,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
public void UpdateValues()
|
||||
{
|
||||
HistoryView.RowCount = Log.Names.Count;
|
||||
if (AutoScrollCheck.Checked && _lastUndoAction != Log.NextUndoStepName)
|
||||
if (AutoScrollCheck.Checked && _lastUndoAction != Log.UndoIndex)
|
||||
{
|
||||
HistoryView.ScrollToIndex(Log.UndoIndex);
|
||||
HistoryView.ScrollToIndex(Math.Max(Log.UndoIndex, 0));
|
||||
HistoryView.DeselectAll();
|
||||
HistoryView.SelectRow(Log.UndoIndex - 1, true);
|
||||
}
|
||||
|
||||
_lastUndoAction = Log.NextUndoStepName;
|
||||
_lastUndoAction = Log.UndoIndex;
|
||||
|
||||
HistoryView.Refresh();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue