Skip to content

Commit bb226f6

Browse files
committed
TAStudio: Update self after loading a state. There doesn't seem to be any reason to not update TAStudio, and doing so fixes two bugs that were most evident when loading the state for frame 0:
-The UI was not updated. -TasSession.UpdateValues was not called. So saving the movie and then re-loading it would result in the previous frame being loaded/seeked to.
1 parent 822cc53 commit bb226f6

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public partial class TAStudio : IToolForm
1919
[OptionalService]
2020
public ISaveRam SaveRamEmulator { get; private set; }
2121

22-
private bool _hackyDontUpdate;
2322
private bool _initializing; // If true, will bypass restart logic, this is necessary since loading projects causes a movie to load which causes a rom to reload causing dialogs to restart
2423

2524
private int _lastRefresh;
@@ -67,11 +66,6 @@ protected override void UpdateAfter()
6766
return;
6867
}
6968

70-
if (_hackyDontUpdate)
71-
{
72-
return;
73-
}
74-
7569
if (_exiting)
7670
{
7771
return;

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,18 +961,16 @@ public void LoadState(KeyValuePair<int, Stream> state)
961961
Emulator.ResetCounters();
962962
}
963963

964-
UpdateOtherTools();
964+
UpdateTools();
965965
}
966966

967967
public void AddBranchExternal() => BookMarkControl.AddBranchExternal();
968968
public void RemoveBranchExternal() => BookMarkControl.RemoveBranchExternal();
969969

970-
private void UpdateOtherTools() // a hack probably, surely there is a better way to do this
970+
private void UpdateTools()
971971
{
972-
_hackyDontUpdate = true;
973972
Tools.UpdateToolsBefore();
974973
Tools.UpdateToolsAfter();
975-
_hackyDontUpdate = false;
976974
}
977975

978976
public void TogglePause()

0 commit comments

Comments
 (0)