Skip to content

Commit 319455c

Browse files
committed
Revert "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:"
This reverts commit bb226f6. This regressed #2965. Will attempt a different fix for the mentioned issues that doesn't regress anything.
1 parent 937b966 commit 319455c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

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

22+
private bool _hackyDontUpdate;
2223
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
2324

2425
private int _lastRefresh;
@@ -66,6 +67,11 @@ protected override void UpdateAfter()
6667
return;
6768
}
6869

70+
if (_hackyDontUpdate)
71+
{
72+
return;
73+
}
74+
6975
if (_exiting)
7076
{
7177
return;

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

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

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

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

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

976978
public void TogglePause()

0 commit comments

Comments
 (0)