Skip to content

Commit

Permalink
fix TAStudio input roll display issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Dec 5, 2024
1 parent 29b848d commit 49458ab
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,11 @@ public void InvalidateEntireGreenzone()
/// </summary>
public string DisplayValue(int frame, string buttonName)
{
// TODO: there are display issues in TAStudio when less than 3 frames are visible
// this is because the Bk2Controller returned from GetInputState is a shared object and mutated elsewhere (like the OSDManager),
// but it's getting cached here. this "works" in the >= 2 frames case because the _displayCache.Frame != frame condition
// will invalidate the cache. Can we do this properly somehow?
if (_displayCache.Frame != frame || FrameCount < 3)
if (_displayCache.Frame != frame)
{
_displayCache = (frame, GetInputState(frame));
_displayCache.Controller ??= new Bk2Controller(Session.MovieController.Definition, LogKey);
_displayCache.Controller.SetFromMnemonic(Log[frame]);
_displayCache.Frame = frame;
}

return CreateDisplayValueForButton(_displayCache.Controller, buttonName);
Expand Down

0 comments on commit 49458ab

Please sign in to comment.