Lua console - implement double click toggle

This commit is contained in:
adelikat 2019-10-19 10:11:04 -05:00
parent 571c172bd4
commit f802f48754
2 changed files with 16 additions and 0 deletions

View File

@ -815,6 +815,7 @@
this.LuaListView.UseCustomBackground = true;
this.LuaListView.ColumnClick += new BizHawk.Client.EmuHawk.InputRoll.ColumnClickEventHandler(this.LuaListView_ColumnClick);
this.LuaListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.LuaListView_KeyDown);
this.LuaListView.DoubleClick += new System.EventHandler(this.LuaListView_DoubleClick);
//
// splitContainer1
//

View File

@ -13,6 +13,7 @@ using BizHawk.Client.EmuHawk.ToolExtensions;
using BizHawk.Client.EmuHawk.WinFormExtensions;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using NLua;
namespace BizHawk.Client.EmuHawk
{
@ -1453,5 +1454,19 @@ namespace BizHawk.Client.EmuHawk
}
#endregion
private void LuaListView_DoubleClick(object sender, EventArgs e)
{
var index = LuaListView.CurrentCell?.RowIndex;
if (index < LuaImp.ScriptList.Count)
{
var file = LuaImp.ScriptList[index.Value];
if (!file.IsSeparator)
{
file.Toggle();
UpdateDialog();
}
}
}
}
}