Lua - implement emu.enablerewind(), also add on screen message when rewind is toggled

This commit is contained in:
andres.delikat 2012-07-12 19:42:13 +00:00
parent fcac19aed9
commit 15371b3cd9
2 changed files with 31 additions and 0 deletions

View File

@ -291,6 +291,7 @@ namespace BizHawk.MultiClient
"minimizeframeskip",
"limitframerate",
"displayvsync",
"enablerewind"
};
public static string[] MemoryFunctions = new string[]
@ -898,6 +899,23 @@ namespace BizHawk.MultiClient
}
}
public void emu_enablerewind(object boolean)
{
string temp = boolean.ToString();
if (!String.IsNullOrWhiteSpace(temp))
{
if (temp == "0" || temp.ToLower() == "false")
{
Global.Config.RewindEnabled = false;
}
else
{
Global.Config.RewindEnabled = true;
}
Global.MainForm.RewindMessage();
}
}
public void emu_frameskip(object num_frames)
{
try

View File

@ -476,6 +476,19 @@ namespace BizHawk.MultiClient
private void enableRewindToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RewindEnabled ^= true;
RewindMessage();
}
public void RewindMessage()
{
if (Global.Config.RewindEnabled)
{
Global.OSD.AddMessage("Rewind enabled");
}
else
{
Global.OSD.AddMessage("Rewind disabled");
}
}
private void hexEditorToolStripMenuItem_Click(object sender, EventArgs e)