From 948084a97e4bfc9e5c9132cf5123430d9b39f339 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Mon, 7 Nov 2022 06:10:37 +1000 Subject: [PATCH] Use `Movie.NotActive` extension instead of negated `IsActive` --- src/BizHawk.Client.Common/movie/MovieSession.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.Events.cs | 8 +++----- src/BizHawk.Client.EmuHawk/MainForm.Movie.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.cs | 2 +- src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs | 2 +- src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/BizHawk.Client.Common/movie/MovieSession.cs b/src/BizHawk.Client.Common/movie/MovieSession.cs index afb9aa2ff6..ad6d1e8c51 100644 --- a/src/BizHawk.Client.Common/movie/MovieSession.cs +++ b/src/BizHawk.Client.Common/movie/MovieSession.cs @@ -64,7 +64,7 @@ namespace BizHawk.Client.Common public void HandleFrameBefore() { - if (!Movie.IsActive()) + if (Movie.NotActive()) { LatchInputToUser(); } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index 460153584a..b4c8ddc990 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1251,7 +1251,7 @@ namespace BizHawk.Client.EmuHawk return; } const int DONT_PROMPT_BEFORE_FRAME = 2 * 60 * 60; // 2 min @ 60 fps - if (!MovieSession.Movie.IsActive() && Emulator.Frame > DONT_PROMPT_BEFORE_FRAME // if playing casually (not recording) AND played for enough frames (prompting always would be annoying)... + if (MovieSession.Movie.NotActive() && Emulator.Frame > DONT_PROMPT_BEFORE_FRAME // if playing casually (not recording) AND played for enough frames (prompting always would be annoying)... && !this.ModalMessageBox2("This will reload the rom without saving. Launch TAStudio anyway?", "Confirmation")) // ...AND user responds "No" to "Open TAStudio?", then cancel { return; @@ -1326,11 +1326,9 @@ namespace BizHawk.Client.EmuHawk || (Emulator is SubNESHawk sub && sub.IsVs); NESSoundChannelsMenuItem.Enabled = Tools.IsAvailable(); - MovieSettingsMenuItem.Enabled = (Emulator is NES || Emulator is SubNESHawk) - && !MovieSession.Movie.IsActive(); + MovieSettingsMenuItem.Enabled = Emulator is NES or SubNESHawk && MovieSession.Movie.NotActive(); - NesControllerSettingsMenuItem.Enabled = Tools.IsAvailable() - && !MovieSession.Movie.IsActive(); + NesControllerSettingsMenuItem.Enabled = Tools.IsAvailable() && MovieSession.Movie.NotActive(); BarcodeReaderMenuItem.Enabled = ServiceInjector.IsAvailable(Emulator.ServiceProvider, typeof(BarcodeEntry)); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs b/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs index 7283f736b9..91a9ec4bab 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs @@ -75,7 +75,7 @@ namespace BizHawk.Client.EmuHawk PlayRecordStatusButton.ToolTipText = "Movie is in record mode"; PlayRecordStatusButton.Visible = true; } - else if (!MovieSession.Movie.IsActive()) + else if (MovieSession.Movie.NotActive()) { PlayRecordStatusButton.Image = Properties.Resources.Blank; PlayRecordStatusButton.ToolTipText = "No movie is active"; diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 75a4aeaac9..0dbd0658b6 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -4006,7 +4006,7 @@ namespace BizHawk.Client.EmuHawk Config.PutCoreSettings(settable.GetSettings(), t); } - if (settable.HasSyncSettings && !MovieSession.Movie.IsActive()) + if (settable.HasSyncSettings && MovieSession.Movie.NotActive()) { // don't trample config with loaded-from-movie settings Config.PutCoreSyncSettings(settable.GetSyncSettings(), t); diff --git a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index ea22411174..b1d7205643 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -125,7 +125,7 @@ namespace BizHawk.Client.EmuHawk { // Movie recording must be active (check TAStudio because opening a project re-loads the ROM, // which resets tools before the movie session becomes active) - if (!CurrentMovie.IsActive() && !Tools.IsLoaded()) + if (CurrentMovie.NotActive() && !Tools.IsLoaded()) { DialogController.ShowMessageBox("In order to use this tool you must be recording a movie."); Close(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs index 11b6e0a9b2..9584e87dad 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs @@ -41,7 +41,7 @@ namespace BizHawk.Client.EmuHawk { // Movie recording must be active (check TAStudio because opening a project re-loads the ROM, // which resets tools before the movie session becomes active) - if (!CurrentMovie.IsActive() && !Tools.IsLoaded()) + if (CurrentMovie.NotActive() && !Tools.IsLoaded()) { DialogController.ShowMessageBox("In order to use this tool you must be recording a movie."); Close();