Lua - implement client.setwindowsize()

This commit is contained in:
andres.delikat 2012-07-12 22:20:48 +00:00
parent e534c5b133
commit f5a7dc2191
2 changed files with 26 additions and 1 deletions

View File

@ -401,6 +401,7 @@ namespace BizHawk.MultiClient
};
public static string[] MultiClientFunctions = new string[] {
"setwindowsize",
"openrom",
"closerom",
"opentoolbox",
@ -1765,6 +1766,30 @@ namespace BizHawk.MultiClient
Global.MainForm.LoadTAStudio();
}
public void client_setwindowsize(object window_size)
{
try
{
string temp = window_size.ToString();
int size = Convert.ToInt32(temp);
if (size == 1 || size == 2 || size == 3 || size == 4 || size == 5 || size == 10)
{
Global.Config.TargetZoomFactor = size;
Global.MainForm.FrameBufferResized();
Global.OSD.AddMessage("Window size set to " + size.ToString() + "x");
}
else
{
console_log("Invalid window size");
}
}
catch
{
console_log("Invalid window size");
}
}
public void client_opencheats()
{
Global.MainForm.LoadCheatsWindow();

View File

@ -2372,7 +2372,7 @@ namespace BizHawk.MultiClient
Global.DisplayManager.UpdateSource(Global.Emulator.VideoProvider);
}
private void FrameBufferResized()
public void FrameBufferResized()
{
var video = Global.Emulator.VideoProvider;
int zoom = Global.Config.TargetZoomFactor;