From 525c9c2f9c1cea2b241faad684c86253a02713af Mon Sep 17 00:00:00 2001 From: James Groom Date: Thu, 23 Nov 2023 06:34:29 +0000 Subject: [PATCH] Use `MainForm.QuicksaveLoad` directly for RA --- src/BizHawk.Client.EmuHawk/MainForm.cs | 2 -- .../RetroAchievements/IMainFormForRetroAchievements.cs | 4 ++-- src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs | 4 ++-- src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs | 4 ++-- src/BizHawk.Client.EmuHawk/tools/ToolManager.cs | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 19dbc6b6bf..ac8049d399 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -1012,8 +1012,6 @@ namespace BizHawk.Client.EmuHawk } } - public EmuClientApi EmuClient { get; set; } - public event BeforeQuickLoadEventHandler QuicksaveLoad; public event BeforeQuickSaveEventHandler QuicksaveSave; diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/IMainFormForRetroAchievements.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/IMainFormForRetroAchievements.cs index ff3407fdd4..9ff4d5a22c 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/IMainFormForRetroAchievements.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/IMainFormForRetroAchievements.cs @@ -9,8 +9,6 @@ namespace BizHawk.Client.EmuHawk { LoadRomArgs CurrentlyOpenRomArgs { get; } - EmuClientApi EmuClient { get; } - IEmulator Emulator { get; } bool FrameInch { get; set; } @@ -23,6 +21,8 @@ namespace BizHawk.Client.EmuHawk IMovieSession MovieSession { get; } + event BeforeQuickLoadEventHandler QuicksaveLoad; + SettingsAdapter GetSettingsAdapterForLoadedCoreUntyped(); bool LoadRom(string path, LoadRomArgs args); diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs index ffcc0e6f33..3c3fa731f9 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs @@ -142,7 +142,7 @@ namespace BizHawk.Client.EmuHawk { RA?.Shutdown(); _memGuard.Dispose(); - _mainForm.EmuClient.BeforeQuickLoad -= QuickLoadCallback; + _mainForm.QuicksaveLoad -= QuickLoadCallback; } public override void OnSaveState(string path) @@ -232,7 +232,7 @@ namespace BizHawk.Client.EmuHawk _mainForm.UpdateWindowTitle(); // note: this can only catch quicksaves (probably only case of accidential use from hotkeys) - _mainForm.EmuClient.BeforeQuickLoad += QuickLoadCallback; + _mainForm.QuicksaveLoad += QuickLoadCallback; } public bool OverlayActive => RA.IsOverlayFullyVisible(); diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs index 16a22645d2..65b43a6b2e 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs @@ -250,7 +250,7 @@ namespace BizHawk.Client.EmuHawk #if false _lboardListForm.Dispose(); #endif - _mainForm.EmuClient.BeforeQuickLoad -= QuickLoadCallback; + _mainForm.QuicksaveLoad -= QuickLoadCallback; } public override void OnSaveState(string path) @@ -428,7 +428,7 @@ namespace BizHawk.Client.EmuHawk Update(); // note: this can only catch quicksaves (probably only case of accidential use from hotkeys) - _mainForm.EmuClient.BeforeQuickLoad += QuickLoadCallback; + _mainForm.QuicksaveLoad += QuickLoadCallback; } public override void Update() diff --git a/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs index b2c55fed72..45a4e1cac9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk private IExternalApiProvider ApiProvider { get => _apiProvider; - set => _owner.EmuClient = (EmuClientApi) (_apiProvider = value).GetApi(); + set => _apiProvider = value; } ///