From 319455c2ea791c90af16a99806dea816d980d455 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:56:43 +0100 Subject: [PATCH] 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 bb226f694aa9a3e2322c03dbdeb07f93e0774204. This regressed #2965. Will attempt a different fix for the mentioned issues that doesn't regress anything. --- .../tools/TAStudio/TAStudio.IToolForm.cs | 6 ++++++ src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs index 772b08c130..df60252446 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs @@ -19,6 +19,7 @@ namespace BizHawk.Client.EmuHawk [OptionalService] public ISaveRam SaveRamEmulator { get; private set; } + private bool _hackyDontUpdate; 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 private int _lastRefresh; @@ -66,6 +67,11 @@ namespace BizHawk.Client.EmuHawk return; } + if (_hackyDontUpdate) + { + return; + } + if (_exiting) { return; diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 890abb3c3a..c819c7460d 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -961,16 +961,18 @@ namespace BizHawk.Client.EmuHawk Emulator.ResetCounters(); } - UpdateTools(); + UpdateOtherTools(); } public void AddBranchExternal() => BookMarkControl.AddBranchExternal(); public void RemoveBranchExternal() => BookMarkControl.RemoveBranchExternal(); - private void UpdateTools() + private void UpdateOtherTools() // a hack probably, surely there is a better way to do this { + _hackyDontUpdate = true; Tools.UpdateToolsBefore(); Tools.UpdateToolsAfter(); + _hackyDontUpdate = false; } public void TogglePause()