Hotkeys that operate on tools - check that the core has the proper prerequisites before opening them

This commit is contained in:
adelikat 2014-11-30 18:35:25 +00:00
parent f77fdf81d8
commit 773a53d2e3
2 changed files with 31 additions and 7 deletions

View File

@ -315,7 +315,10 @@ namespace BizHawk.Client.EmuHawk
} }
break; break;
case "TAStudio": case "TAStudio":
GlobalWin.Tools.Load<TAStudio>(); if (Global.Emulator.HasSavestates())
{
GlobalWin.Tools.Load<TAStudio>();
}
break; break;
case "ToolBox": case "ToolBox":
GlobalWin.Tools.Load<ToolBox>(); GlobalWin.Tools.Load<ToolBox>();
@ -326,22 +329,40 @@ namespace BizHawk.Client.EmuHawk
// Ram Search // Ram Search
case "Do Search": case "Do Search":
GlobalWin.Tools.RamSearch.DoSearch(); if (Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.RamSearch.DoSearch();
}
break; break;
case "New Search": case "New Search":
GlobalWin.Tools.RamSearch.NewSearch(); if (Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.RamSearch.NewSearch();
}
break; break;
case "Previous Compare To": case "Previous Compare To":
GlobalWin.Tools.RamSearch.NextCompareTo(reverse: true); if (Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.RamSearch.NextCompareTo(reverse: true);
}
break; break;
case "Next Compare To": case "Next Compare To":
GlobalWin.Tools.RamSearch.NextCompareTo(); if (Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.RamSearch.NextCompareTo();
}
break; break;
case "Previous Operator": case "Previous Operator":
GlobalWin.Tools.RamSearch.NextOperator(reverse: true); if (Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.RamSearch.NextOperator(reverse: true);
}
break; break;
case "Next Operator": case "Next Operator":
GlobalWin.Tools.RamSearch.NextOperator(); if (Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.RamSearch.NextOperator();
}
break; break;
// SNES // SNES

View File

@ -2,6 +2,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using BizHawk.Emulation.Common.IEmulatorExtensions;
using BizHawk.Client.Common; using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
@ -448,6 +450,7 @@ namespace BizHawk.Client.EmuHawk
public void LoadRamWatch(bool loadDialog) public void LoadRamWatch(bool loadDialog)
{ {
if (Global.Emulator.HasMemoryDomains())
if (!IsLoaded<RamWatch>() && Global.Config.RecentWatches.AutoLoad && !Global.Config.RecentWatches.Empty) if (!IsLoaded<RamWatch>() && Global.Config.RecentWatches.AutoLoad && !Global.Config.RecentWatches.Empty)
{ {
GlobalWin.Tools.RamWatch.LoadFileFromRecent(Global.Config.RecentWatches.MostRecent); GlobalWin.Tools.RamWatch.LoadFileFromRecent(Global.Config.RecentWatches.MostRecent);