Dragging A Lua Session Now Works. Script Errors From Dragging Sessions Now Appears In The Output Box.

This commit is contained in:
rolanmen1 2012-03-25 14:51:35 +00:00
parent 75c0a9f7d3
commit 35f42b94f3
1 changed files with 28 additions and 17 deletions

View File

@ -548,23 +548,34 @@ namespace BizHawk.MultiClient
return Validated;
}
private void LuaConsole_DragDrop(object sender, DragEventArgs e)
{
string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
if (Path.GetExtension(filePaths[0]) == (".lua") || Path.GetExtension(filePaths[0]) == (".txt"))
{
LoadLuaFile(filePaths[0]);
DisplayLuaList();
UpdateNumberOfScripts();
}
else if (Path.GetExtension(filePaths[0]) == (".luases"))
{
LoadLuaSession(filePaths[0]);
DisplayLuaList();
UpdateNumberOfScripts();
//ClearOutput();
}
}
private void LuaConsole_DragDrop(object sender, DragEventArgs e)
{
string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
try
{
if (Path.GetExtension(filePaths[0]) == (".lua") || Path.GetExtension(filePaths[0]) == (".txt"))
{
LoadLuaFile(filePaths[0]);
DisplayLuaList();
UpdateNumberOfScripts();
}
else if (Path.GetExtension(filePaths[0]) == (".luases"))
{
LoadLuaSession(filePaths[0]);
RunLuaScripts();
DisplayLuaList();
UpdateNumberOfScripts();
}
}
catch (Exception ex)
{
if (ex.ToString().Substring(0, 32) == "LuaInterface.LuaScriptException:")
{
AddText(ex.Message);
}
else MessageBox.Show(ex.Message);
}
}
private void LuaConsole_DragEnter(object sender, DragEventArgs e)
{