From 32b7358f07e97168b4b3a75aa90cb31020599df2 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 27 Sep 2020 11:16:18 -0500 Subject: [PATCH] Macro tool - fix NRE on File -> Load Macro, fxies #2375 --- src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs | 4 ++-- src/BizHawk.Client.EmuHawk/tools/Macros/MovieZone.cs | 3 ++- src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs index 8bfb88673d..d201b3c6ca 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs @@ -250,7 +250,7 @@ namespace BizHawk.Client.EmuHawk private void DummyLoadMacro(string path) { - MovieZone loadZone = new MovieZone(path, Emulator, Tools); + MovieZone loadZone = new MovieZone(path, Emulator, MovieSession, Tools); _zones.Add(loadZone); ZonesList.Items.Add($"{loadZone.Name} - length: {loadZone.Length}"); } @@ -311,7 +311,7 @@ namespace BizHawk.Client.EmuHawk } Config.RecentMacros.Add(dialog.FileName); - return new MovieZone(dialog.FileName, emulator ?? Emulator, tools ?? Tools); + return new MovieZone(dialog.FileName, emulator ?? Emulator, MovieSession, tools ?? Tools); } } } diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MovieZone.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MovieZone.cs index b26758e16b..a7fe60e9ce 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MovieZone.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MovieZone.cs @@ -211,7 +211,7 @@ namespace BizHawk.Client.EmuHawk File.AppendAllLines(fileName, _log); } - public MovieZone(string fileName, IEmulator emulator, ToolManager tools) + public MovieZone(string fileName, IEmulator emulator, IMovieSession movieSession, ToolManager tools) { if (!File.Exists(fileName)) { @@ -220,6 +220,7 @@ namespace BizHawk.Client.EmuHawk _emulator = emulator; _tools = tools; + _movieSession = movieSession; string[] readText = File.ReadAllLines(fileName); diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 2d9b95c7d5..770de09b71 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -707,7 +707,7 @@ namespace BizHawk.Client.EmuHawk return; } - var loadZone = new MovieZone(path, Emulator, Tools) + var loadZone = new MovieZone(path, Emulator, MovieSession, Tools) { Start = TasView.FirstSelectedIndex ?? 0 };