From 2834f8aa39b8c870fc6a1a3865807c85d35aa9de Mon Sep 17 00:00:00 2001 From: SuuperW Date: Sat, 16 Jan 2021 09:11:27 -0600 Subject: [PATCH] TAStudio: -Dis/enable recent macros menu along with other macro menu items. -Remove redundant code from commit 350724a, make use of existing method. -Fix regressions from commits 0d72cd9 and cb912be in said method. --- .../tools/TAStudio/TAStudio.MenuItems.cs | 11 +++-------- src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 34501d6f95..4220f7759f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -21,6 +21,7 @@ namespace BizHawk.Client.EmuHawk saveSelectionToMacroToolStripMenuItem.Enabled = placeMacroAtSelectionToolStripMenuItem.Enabled = + recentMacrosToolStripMenuItem.Enabled = TasView.AnyRowsSelected; } @@ -265,14 +266,8 @@ namespace BizHawk.Client.EmuHawk if (file != null) { - var macro = new MovieZone(file.FullName, Emulator, MovieSession, Tools); - if (macro != null) - { - macro.Start = TasView.FirstSelectedIndex ?? 0; - macro.PlaceZone(CurrentTasMovie, Config); - - Config.RecentMacros.Add(file.FullName); - } + DummyLoadMacro(file.FullName); + Config.RecentMacros.Add(file.FullName); } } diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 1a70ee79f9..645862ad40 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -726,14 +726,14 @@ namespace BizHawk.Client.EmuHawk private void DummyLoadMacro(string path) { - if (!TasView.Focused && TasView.AnyRowsSelected) + if (!TasView.AnyRowsSelected) { return; } var loadZone = new MovieZone(path, Emulator, MovieSession, Tools) { - Start = TasView.FirstSelectedIndex ?? 0 + Start = TasView.FirstSelectedIndex.Value }; loadZone.PlaceZone(CurrentTasMovie, Config); }