From 614d457de4c7d911d831eb9e572951839538f694 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 21 Jan 2014 00:36:22 +0000 Subject: [PATCH] Lua - Implement client.clearautohold() --- BizHawk.Client.EmuHawk/MainForm.cs | 30 +++++++++++-------- .../Lua/Libraries/EmuLuaLibrary.Client.cs | 8 ++++- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index ed577f5f9f..e2bf099222 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -465,6 +465,17 @@ namespace BizHawk.Client.EmuHawk #region Public Methods + public void ClearHolds() + { + Global.StickyXORAdapter.ClearStickies(); + Global.AutofireStickyXORAdapter.ClearStickies(); + + if (GlobalWin.Tools.Has()) + { + 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()) @@ -974,19 +991,6 @@ namespace BizHawk.Client.EmuHawk HandleToggleLight(); } - private static void ClearAutohold() - { - Global.StickyXORAdapter.ClearStickies(); - Global.AutofireStickyXORAdapter.ClearStickies(); - - if (GlobalWin.Tools.Has()) - { - GlobalWin.Tools.VirtualPad.ClearVirtualPadHolds(); - } - - GlobalWin.OSD.AddMessage("Autohold keys cleared"); - } - private void UpdateDumpIcon() { DumpStatusButton.Image = Properties.Resources.Blank; diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs index d75bf2e24a..e0a050bc64 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs @@ -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 LogOutputCallback = null; + public void client_clearautohold() + { + GlobalWin.MainForm.ClearHolds(); + } + public static void client_closerom() { GlobalWin.MainForm.CloseRom();