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; return Validated;
} }
private void LuaConsole_DragDrop(object sender, DragEventArgs e) private void LuaConsole_DragDrop(object sender, DragEventArgs e)
{ {
string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
if (Path.GetExtension(filePaths[0]) == (".lua") || Path.GetExtension(filePaths[0]) == (".txt")) try
{ {
LoadLuaFile(filePaths[0]); if (Path.GetExtension(filePaths[0]) == (".lua") || Path.GetExtension(filePaths[0]) == (".txt"))
DisplayLuaList(); {
UpdateNumberOfScripts(); LoadLuaFile(filePaths[0]);
} DisplayLuaList();
else if (Path.GetExtension(filePaths[0]) == (".luases")) UpdateNumberOfScripts();
{ }
LoadLuaSession(filePaths[0]); else if (Path.GetExtension(filePaths[0]) == (".luases"))
DisplayLuaList(); {
UpdateNumberOfScripts(); LoadLuaSession(filePaths[0]);
//ClearOutput(); 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) private void LuaConsole_DragEnter(object sender, DragEventArgs e)
{ {