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.
This commit is contained in:
SuuperW 2021-01-16 09:11:27 -06:00
parent 4d06fb1fde
commit 2834f8aa39
2 changed files with 5 additions and 10 deletions

View File

@ -21,6 +21,7 @@ namespace BizHawk.Client.EmuHawk
saveSelectionToMacroToolStripMenuItem.Enabled = saveSelectionToMacroToolStripMenuItem.Enabled =
placeMacroAtSelectionToolStripMenuItem.Enabled = placeMacroAtSelectionToolStripMenuItem.Enabled =
recentMacrosToolStripMenuItem.Enabled =
TasView.AnyRowsSelected; TasView.AnyRowsSelected;
} }
@ -265,16 +266,10 @@ namespace BizHawk.Client.EmuHawk
if (file != null) if (file != null)
{ {
var macro = new MovieZone(file.FullName, Emulator, MovieSession, Tools); DummyLoadMacro(file.FullName);
if (macro != null)
{
macro.Start = TasView.FirstSelectedIndex ?? 0;
macro.PlaceZone(CurrentTasMovie, Config);
Config.RecentMacros.Add(file.FullName); Config.RecentMacros.Add(file.FullName);
} }
} }
}
private void RecentMacrosMenuItem_DropDownOpened(object sender, EventArgs e) private void RecentMacrosMenuItem_DropDownOpened(object sender, EventArgs e)
{ {

View File

@ -726,14 +726,14 @@ namespace BizHawk.Client.EmuHawk
private void DummyLoadMacro(string path) private void DummyLoadMacro(string path)
{ {
if (!TasView.Focused && TasView.AnyRowsSelected) if (!TasView.AnyRowsSelected)
{ {
return; return;
} }
var loadZone = new MovieZone(path, Emulator, MovieSession, Tools) var loadZone = new MovieZone(path, Emulator, MovieSession, Tools)
{ {
Start = TasView.FirstSelectedIndex ?? 0 Start = TasView.FirstSelectedIndex.Value
}; };
loadZone.PlaceZone(CurrentTasMovie, Config); loadZone.PlaceZone(CurrentTasMovie, Config);
} }