From bb226f694aa9a3e2322c03dbdeb07f93e0774204 Mon Sep 17 00:00:00 2001 From: SuuperW Date: Wed, 19 Jan 2022 16:03:30 -0600 Subject: [PATCH] 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. --- .../tools/TAStudio/TAStudio.IToolForm.cs | 6 ------ src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs index df60252446..772b08c130 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs @@ -19,7 +19,6 @@ 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; @@ -67,11 +66,6 @@ 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 c819c7460d..890abb3c3a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -961,18 +961,16 @@ namespace BizHawk.Client.EmuHawk Emulator.ResetCounters(); } - UpdateOtherTools(); + UpdateTools(); } public void AddBranchExternal() => BookMarkControl.AddBranchExternal(); public void RemoveBranchExternal() => BookMarkControl.RemoveBranchExternal(); - private void UpdateOtherTools() // a hack probably, surely there is a better way to do this + private void UpdateTools() { - _hackyDontUpdate = true; Tools.UpdateToolsBefore(); Tools.UpdateToolsAfter(); - _hackyDontUpdate = false; } public void TogglePause()