diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj
index 245102a7f8..53fc04d49a 100644
--- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj
+++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj
@@ -3,7 +3,7 @@
Debug
AnyCPU
- 9.0.30729
+ 9.0.21022
2.0
{DD448B37-BA3F-4544-9754-5406E8094723}
Exe
@@ -36,6 +36,10 @@
x86
+
+ False
+ .\LuaInterface.dll
+
False
..\Newtonsoft.Json.dll
@@ -96,6 +100,7 @@
+
Form
diff --git a/BizHawk.MultiClient/LuaImplementation.cs b/BizHawk.MultiClient/LuaImplementation.cs
new file mode 100644
index 0000000000..af523130f7
--- /dev/null
+++ b/BizHawk.MultiClient/LuaImplementation.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using LuaInterface;
+using System.Windows.Forms;
+using BizHawk.MultiClient.tools;
+
+namespace BizHawk.MultiClient
+{
+ class LuaImplementation
+ {
+ Lua lua = new Lua();
+ LuaWindow Caller;
+ public LuaImplementation(LuaWindow passed)
+ {
+ Caller = passed.get();
+ lua.RegisterFunction("print",this, this.GetType().GetMethod("print"));
+ }
+ public void DoLuaFile(string File)
+ {
+ lua.DoFile(File);
+ }
+ public void print(string s)
+ {
+ Caller.AddText(s);
+ }
+ }
+}
diff --git a/BizHawk.MultiClient/tools/LuaWindow.Designer.cs b/BizHawk.MultiClient/tools/LuaWindow.Designer.cs
index 1319505775..0505263ba0 100644
--- a/BizHawk.MultiClient/tools/LuaWindow.Designer.cs
+++ b/BizHawk.MultiClient/tools/LuaWindow.Designer.cs
@@ -72,6 +72,7 @@
this.IDB_RUN.TabIndex = 4;
this.IDB_RUN.Text = "Run";
this.IDB_RUN.UseVisualStyleBackColor = true;
+ this.IDB_RUN.Click += new System.EventHandler(this.IDB_RUN_Click);
//
// IDB_STOP
//
diff --git a/BizHawk.MultiClient/tools/LuaWindow.cs b/BizHawk.MultiClient/tools/LuaWindow.cs
index 3a9bc0be72..dff41d94c2 100644
--- a/BizHawk.MultiClient/tools/LuaWindow.cs
+++ b/BizHawk.MultiClient/tools/LuaWindow.cs
@@ -6,16 +6,22 @@ using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
+using LuaInterface;
namespace BizHawk.MultiClient.tools
{
public partial class LuaWindow : Form
- {
+ {
+ LuaImplementation LuaImp;
public LuaWindow()
{
InitializeComponent();
+ LuaImp = new LuaImplementation(this);
+ }
+ public LuaWindow get()
+ {
+ return this;
}
-
private void IDB_BROWSE_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
@@ -29,5 +35,15 @@ namespace BizHawk.MultiClient.tools
IDT_SCRIPTFILE.Text = fdlg.FileName;
}
}
+ public void AddText(string s)
+ {
+ IDT_OUTPUT.Text += s;
+ }
+
+ private void IDB_RUN_Click(object sender, EventArgs e)
+ {
+ LuaImp.DoLuaFile(IDT_SCRIPTFILE.Text);
+ }
+
}
}