Lua - implement emu.displayvsync, also add on screen message when limit frame rate is toggled
This commit is contained in:
parent
2304b2d4e2
commit
fcac19aed9
|
@ -290,6 +290,7 @@ namespace BizHawk.MultiClient
|
|||
"frameskip",
|
||||
"minimizeframeskip",
|
||||
"limitframerate",
|
||||
"displayvsync",
|
||||
};
|
||||
|
||||
public static string[] MemoryFunctions = new string[]
|
||||
|
@ -880,6 +881,23 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public void emu_displayvsync(object boolean)
|
||||
{
|
||||
string temp = boolean.ToString();
|
||||
if (!String.IsNullOrWhiteSpace(temp))
|
||||
{
|
||||
if (temp == "0" || temp.ToLower() == "false")
|
||||
{
|
||||
Global.Config.DisplayVSync = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.Config.DisplayVSync = true;
|
||||
}
|
||||
Global.MainForm.VsyncMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public void emu_frameskip(object num_frames)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -72,6 +72,19 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
Global.Config.DisplayVSync ^= true;
|
||||
Global.RenderPanel.Resized = true;
|
||||
VsyncMessage();
|
||||
}
|
||||
|
||||
public void VsyncMessage()
|
||||
{
|
||||
if (Global.Config.DisplayVSync)
|
||||
{
|
||||
Global.OSD.AddMessage("Display Vsync is set to on");
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.OSD.AddMessage("Display Vsync is set to off");
|
||||
}
|
||||
}
|
||||
|
||||
private void miAutoMinimizeSkipping_Click(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in New Issue