From 8a09893818ccfd9fd00bb0fb61138bf3e1749c56 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sun, 30 May 2021 14:06:08 -0400 Subject: [PATCH] Basic Bot: Add same movie check condition as in Macro tool, fixes #2762 --- .../tools/BasicBot/BasicBot.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index 1dc4061074..2ae7e93681 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -84,6 +84,8 @@ namespace BizHawk.Client.EmuHawk protected override string WindowTitleStatic => "Basic Bot"; + private IMovie CurrentMovie => MovieSession.Movie; + public BasicBot() { InitializeComponent(); @@ -106,6 +108,16 @@ namespace BizHawk.Client.EmuHawk private void BasicBot_Load(object sender, EventArgs e) { + // 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()) + { + DialogController.ShowMessageBox("In order to use this tool you must be recording a movie."); + Close(); + DialogResult = DialogResult.Cancel; + return; + } + _previousInvisibleEmulation = InvisibleEmulationCheckBox.Checked = Settings.InvisibleEmulation; _previousDisplayMessage = Config.DisplayMessages; }