From b2e341e2df18174c71ca05372d7b5857285f1c8e Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 17 Nov 2013 16:43:12 +0000 Subject: [PATCH] Lua Registered Functions dialog - fix bug where Call and Remove were affecting the wrong scripts --- BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs | 10 ++-------- .../tools/Lua/LuaRegisteredFunctionsList.cs | 6 ++++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs index cea0ffea6e..40a54ab25b 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs @@ -93,10 +93,7 @@ namespace BizHawk.Client.EmuHawk public int Column { - get - { - return _column; - } + get { return _column; } set { if (_column == value) @@ -109,10 +106,7 @@ namespace BizHawk.Client.EmuHawk public bool Descending { - get - { - return _desc; - } + get { return _desc; } } } diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs index 481481781c..e7f4dd7332 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs @@ -63,7 +63,8 @@ namespace BizHawk.Client.EmuHawk { foreach (int index in indices) { - GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions[index].Call(); + string guid = FunctionView.Items[index].SubItems[2].Text; + GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions[guid].Call(); } } } @@ -75,7 +76,8 @@ namespace BizHawk.Client.EmuHawk { foreach (int index in indices) { - NamedLuaFunction nlf = GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions[index]; + string guid = FunctionView.Items[index].SubItems[2].Text; + NamedLuaFunction nlf = GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions[guid]; GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions.RemoveFunction(nlf); } PopulateListView();