Improve tastudio refresh behavior in tastudiolualibrary

should resolve #3969. Let's hope this doesn't break anything.

There still seems to be some overhead, but I can't profile this so I can't say whether it's from submitclearframes or applyinputchanges.
This commit is contained in:
Morilli 2024-07-20 07:56:36 +02:00
parent cee9661f0e
commit 5fd3575c0f
2 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
@ -327,6 +327,7 @@ namespace BizHawk.Client.EmuHawk
Tastudio.CurrentTasMovie.SetAxisState(_changeList[i].Frame, _changeList[i].Button, _changeList[i].ValueAxis); Tastudio.CurrentTasMovie.SetAxisState(_changeList[i].Frame, _changeList[i].Button, _changeList[i].ValueAxis);
break; break;
} }
Tastudio.RefreshForInputChange(_changeList[i].Frame);
break; break;
case LuaChangeTypes.InsertFrames: case LuaChangeTypes.InsertFrames:
Tastudio.InsertNumFrames(_changeList[i].Frame, _changeList[i].Number); Tastudio.InsertNumFrames(_changeList[i].Frame, _changeList[i].Number);
@ -340,7 +341,6 @@ namespace BizHawk.Client.EmuHawk
} }
} }
_changeList.Clear(); _changeList.Clear();
Tastudio.RefreshDialog();
Tastudio.JumpToGreenzone(); Tastudio.JumpToGreenzone();
Tastudio.DoAutoRestore(); Tastudio.DoAutoRestore();
} }

View File

@ -886,6 +886,14 @@ namespace BizHawk.Client.EmuHawk
} }
} }
public void RefreshForInputChange(int firstChangedFrame)
{
if (TasView.IsPartiallyVisible(firstChangedFrame) || firstChangedFrame < TasView.FirstVisibleRow)
{
RefreshDialog();
}
}
private void SetTasViewRowCount() private void SetTasViewRowCount()
{ {
TasView.RowCount = CurrentTasMovie.InputLogLength + 1; TasView.RowCount = CurrentTasMovie.InputLogLength + 1;
@ -1061,7 +1069,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
RefreshDialog(); RefreshForInputChange(insertionFrame);
} }
} }
} }
@ -1082,7 +1090,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
RefreshDialog(); RefreshForInputChange(beginningFrame);
} }
} }
} }
@ -1105,7 +1113,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
RefreshDialog(); RefreshForInputChange(beginningFrame);
} }
} }
} }