fix autoloading of ram watch that was broken in the 2.5 releas

This commit is contained in:
adelikat 2021-04-18 09:54:30 -05:00
parent 9243a6a215
commit 82f26ee4ec
2 changed files with 16 additions and 3 deletions

View File

@ -2541,8 +2541,6 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<TI83KeyPad>();
}
Tools.AutoLoad();
if (Config.RecentWatches.AutoLoad)
{
Tools.LoadRamWatch(!Config.DisplayRamWatch);
@ -2553,6 +2551,7 @@ namespace BizHawk.Client.EmuHawk
Tools.Load<Cheats>();
}
Tools.AutoLoad();
HandlePlatformMenus();
}

View File

@ -227,7 +227,10 @@ namespace BizHawk.Client.EmuHawk
}
else
{
Load(t, false);
if (!IsLoaded(t))
{
Load(t, false);
}
}
}
}
@ -460,6 +463,17 @@ namespace BizHawk.Client.EmuHawk
return false;
}
public bool IsLoaded(Type toolType)
{
var existingTool = _tools.FirstOrDefault(t => t.GetType() == toolType);
if (existingTool != null)
{
return !existingTool.IsDisposed || (existingTool is RamWatch && _config.DisplayRamWatch);
}
return false;
}
public bool IsOnScreen(Point topLeft)
{
return Screen.AllScreens.Any(