Lua - Implement client.clearautohold()

This commit is contained in:
adelikat 2014-01-21 00:36:22 +00:00
parent 8f7ac5755f
commit 614d457de4
2 changed files with 24 additions and 14 deletions

View File

@ -465,6 +465,17 @@ namespace BizHawk.Client.EmuHawk
#region Public Methods
public void ClearHolds()
{
Global.StickyXORAdapter.ClearStickies();
Global.AutofireStickyXORAdapter.ClearStickies();
if (GlobalWin.Tools.Has<VirtualPadForm>())
{
GlobalWin.Tools.VirtualPad.ClearVirtualPadHolds();
}
}
public void FlagNeedsReboot()
{
RebootStatusBarIcon.Visible = true;
@ -960,6 +971,12 @@ namespace BizHawk.Client.EmuHawk
#region Private methods
private void ClearAutohold()
{
ClearHolds();
GlobalWin.OSD.AddMessage("Autohold keys cleared");
}
private static void UpdateToolsLoadstate()
{
if (GlobalWin.Tools.Has<SNESGraphicsDebugger>())
@ -974,19 +991,6 @@ namespace BizHawk.Client.EmuHawk
HandleToggleLight();
}
private static void ClearAutohold()
{
Global.StickyXORAdapter.ClearStickies();
Global.AutofireStickyXORAdapter.ClearStickies();
if (GlobalWin.Tools.Has<VirtualPadForm>())
{
GlobalWin.Tools.VirtualPad.ClearVirtualPadHolds();
}
GlobalWin.OSD.AddMessage("Autohold keys cleared");
}
private void UpdateDumpIcon()
{
DumpStatusButton.Image = Properties.Resources.Blank;

View File

@ -30,6 +30,7 @@ namespace BizHawk.Client.EmuHawk
{
return new []
{
"clearautohold",
"closerom",
"enablerewind",
"frameskip",
@ -62,13 +63,18 @@ namespace BizHawk.Client.EmuHawk
"unpause",
"unpause_av",
"xpos",
"ypos",
"ypos"
};
}
}
public Action<string> LogOutputCallback = null;
public void client_clearautohold()
{
GlobalWin.MainForm.ClearHolds();
}
public static void client_closerom()
{
GlobalWin.MainForm.CloseRom();