2011-02-19 22:42:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
2011-02-20 19:18:27 +00:00
|
|
|
|
using LuaInterface;
|
2011-02-19 22:42:35 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.MultiClient.tools
|
|
|
|
|
{
|
|
|
|
|
public partial class LuaWindow : Form
|
2011-02-20 19:18:27 +00:00
|
|
|
|
{
|
|
|
|
|
LuaImplementation LuaImp;
|
2011-02-19 22:42:35 +00:00
|
|
|
|
public LuaWindow()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2011-02-20 19:18:27 +00:00
|
|
|
|
LuaImp = new LuaImplementation(this);
|
|
|
|
|
}
|
|
|
|
|
public LuaWindow get()
|
|
|
|
|
{
|
|
|
|
|
return this;
|
2011-02-19 22:42:35 +00:00
|
|
|
|
}
|
|
|
|
|
private void IDB_BROWSE_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
OpenFileDialog fdlg = new OpenFileDialog();
|
|
|
|
|
fdlg.Title = "Open Lua Script";
|
2011-02-20 20:14:55 +00:00
|
|
|
|
fdlg.InitialDirectory = @".\"; //Switch this to a better default directory
|
2011-02-19 22:42:35 +00:00
|
|
|
|
fdlg.Filter = "Lua files (*.lua)|*.lua|All files (*.*)|*.*";
|
|
|
|
|
fdlg.FilterIndex = 1;
|
|
|
|
|
fdlg.RestoreDirectory = true;
|
|
|
|
|
if (fdlg.ShowDialog(this) == DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
IDT_SCRIPTFILE.Text = fdlg.FileName;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-02-20 19:18:27 +00:00
|
|
|
|
public void AddText(string s)
|
|
|
|
|
{
|
|
|
|
|
IDT_OUTPUT.Text += s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void IDB_RUN_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LuaImp.DoLuaFile(IDT_SCRIPTFILE.Text);
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-19 22:42:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|