fix lua poop
This commit is contained in:
parent
338f4230f1
commit
d0354fd1fe
|
@ -1675,7 +1675,13 @@ namespace BizHawk.MultiClient
|
|||
if (LuaConsole1.IsRunning())
|
||||
{
|
||||
Global.MainForm.MainWait.Set();
|
||||
LuaConsole1.WaitOne();
|
||||
for (; ; )
|
||||
{
|
||||
//we need to run DoEvents in here so that we can use Control.Invoke to interact with the gui
|
||||
//its all a godawful mess
|
||||
if (LuaConsole1.WaitOne(10)) break;
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -592,8 +592,11 @@ namespace BizHawk.MultiClient
|
|||
if (!OutputBox.IsHandleCreated || OutputBox.IsDisposed)
|
||||
return;
|
||||
|
||||
OutputBox.Text += message;
|
||||
OutputBox.Refresh();
|
||||
OutputBox.Invoke(() =>
|
||||
{
|
||||
OutputBox.Text += message;
|
||||
OutputBox.Refresh();
|
||||
});
|
||||
}
|
||||
|
||||
public void ClearOutputWindow()
|
||||
|
@ -601,8 +604,11 @@ namespace BizHawk.MultiClient
|
|||
if (!OutputBox.IsHandleCreated || OutputBox.IsDisposed)
|
||||
return;
|
||||
|
||||
OutputBox.Text = "";
|
||||
OutputBox.Refresh();
|
||||
OutputBox.Invoke(() =>
|
||||
{
|
||||
OutputBox.Text = "";
|
||||
OutputBox.Refresh();
|
||||
});
|
||||
}
|
||||
|
||||
private void openToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||
|
@ -694,12 +700,12 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public void WaitOne()
|
||||
public bool WaitOne(int timeout)
|
||||
{
|
||||
if (!this.IsHandleCreated || this.IsDisposed)
|
||||
return;
|
||||
return true;
|
||||
|
||||
this.LuaImp.LuaWait.WaitOne();
|
||||
return this.LuaImp.LuaWait.WaitOne(timeout);
|
||||
}
|
||||
|
||||
private void openToolStripButton_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -129,6 +129,7 @@
|
|||
<Compile Include="ToolStripEx.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util.cs" />
|
||||
<Compile Include="ViewportPanel.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
@ -185,4 +186,4 @@
|
|||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
//extension method to make Control.Invoke easier to use
|
||||
public static void Invoke(this Control control, Action action)
|
||||
{
|
||||
control.Invoke((Delegate)action);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue