add a toggle all cheats hotkey

This commit is contained in:
adelikat 2017-02-25 15:32:18 -06:00
parent 98a390b3c6
commit dec3a31d2b
2 changed files with 22 additions and 2 deletions

View File

@ -254,7 +254,9 @@ namespace BizHawk.Client.Common
Bind("Analog", "X Up Large", toolTip: "For Virtual Pad"),
Bind("Analog", "X Down Small", toolTip: "For Virtual Pad"),
Bind("Analog", "X Down Large", toolTip: "For Virtual Pad"),
Bind("Tools", "Toggle All Cheats"),
};
//set ordinals based on order in list

View File

@ -1,4 +1,6 @@
using BizHawk.Client.Common;
using System.Linq;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common.IEmulatorExtensions;
namespace BizHawk.Client.EmuHawk
@ -321,6 +323,22 @@ namespace BizHawk.Client.EmuHawk
case "Cheats":
GlobalWin.Tools.Load<Cheats>();
break;
case "Toggle All Cheats":
if (Global.CheatList.Any())
{
string type = " (mixed)";
if (Global.CheatList.All(c => c.Enabled))
{
type = " (off)";
}
else if (Global.CheatList.All(c => !c.Enabled))
{
type = " (on)";
}
Global.CheatList.ToList().ForEach(x => x.Toggle());
GlobalWin.OSD.AddMessage("Cheats toggled" + type);
}
break;
case "TAStudio":
GlobalWin.Tools.Load<TAStudio>();
break;