add an option to run lua scripts while turboing instead of bypassing them. Make this option true by default (a change to the current behavior). Add a checkbox in the customize dialog to toggle this option.

This commit is contained in:
adelikat 2015-07-09 20:14:52 -04:00
parent d015b1aed0
commit a9c460802b
4 changed files with 21 additions and 0 deletions

View File

@ -295,6 +295,7 @@ namespace BizHawk.Client.Common
public RecentFiles RecentLua = new RecentFiles(8);
public RecentFiles RecentLuaSession = new RecentFiles(8);
public bool DisableLuaScriptsOnLoad = false;
public bool RunLuaDuringTurbo = true;
// Watch Settings
public RecentFiles RecentWatches = new RecentFiles(8);

View File

@ -56,6 +56,7 @@
this.label4 = new System.Windows.Forms.Label();
this.LogWindowAsConsoleCheckbox = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.LuaDuringTurboCheckbox = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage3.SuspendLayout();
@ -248,6 +249,7 @@
//
// tabPage3
//
this.tabPage3.Controls.Add(this.LuaDuringTurboCheckbox);
this.tabPage3.Controls.Add(this.label12);
this.tabPage3.Controls.Add(this.label13);
this.tabPage3.Controls.Add(this.FrameAdvSkipLagCheckbox);
@ -338,6 +340,16 @@
this.LogWindowAsConsoleCheckbox.Text = "Create the log window as a console window";
this.LogWindowAsConsoleCheckbox.UseVisualStyleBackColor = true;
//
// LuaDuringTurboCheckbox
//
this.LuaDuringTurboCheckbox.AutoSize = true;
this.LuaDuringTurboCheckbox.Location = new System.Drawing.Point(6, 180);
this.LuaDuringTurboCheckbox.Name = "LuaDuringTurboCheckbox";
this.LuaDuringTurboCheckbox.Size = new System.Drawing.Size(166, 17);
this.LuaDuringTurboCheckbox.TabIndex = 15;
this.LuaDuringTurboCheckbox.Text = "Run lua scripts when turboing";
this.LuaDuringTurboCheckbox.UseVisualStyleBackColor = true;
//
// EmuHawkOptions
//
this.AcceptButton = this.OkBtn;
@ -391,5 +403,6 @@
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.CheckBox StartFullScreenCheckbox;
private System.Windows.Forms.CheckBox LuaDuringTurboCheckbox;
}
}

View File

@ -33,6 +33,7 @@ namespace BizHawk.Client.EmuHawk
BackupSRamCheckbox.Checked = Global.Config.BackupSaveram;
FrameAdvSkipLagCheckbox.Checked = Global.Config.SkipLagFrame;
LogWindowAsConsoleCheckbox.Checked = Global.Config.WIN32_CONSOLE;
LuaDuringTurboCheckbox.Checked = Global.Config.RunLuaDuringTurbo;
if (LogConsole.ConsoleVisible)
{
@ -58,6 +59,7 @@ namespace BizHawk.Client.EmuHawk
Global.Config.BackupSaveram = BackupSRamCheckbox.Checked;
Global.Config.SkipLagFrame = FrameAdvSkipLagCheckbox.Checked;
Global.Config.WIN32_CONSOLE = LogWindowAsConsoleCheckbox.Checked;
Global.Config.RunLuaDuringTurbo = LuaDuringTurboCheckbox.Checked;
Close();
DialogResult = DialogResult.OK;

View File

@ -549,6 +549,11 @@ namespace BizHawk.Client.EmuHawk
public void FastUpdateAfter()
{
if (Global.Config.RunLuaDuringTurbo && Has<LuaConsole>())
{
LuaConsole.ResumeScripts(true);
}
var afterList = _tools.Where(x => !x.UpdateBefore);
foreach (var tool in afterList)
{