Fix removing of registered functions via Lua console

This commit is contained in:
adelikat 2013-12-19 01:02:50 +00:00
parent b604d81d10
commit b2b8edb319
4 changed files with 5 additions and 6 deletions

View File

@ -194,7 +194,7 @@ namespace BizHawk.Client.Common
{
foreach (var nlf in _luaFunctions.Where(nlf => nlf.Guid.ToString() == guid.ToString()))
{
_luaFunctions.RemoveFunction(nlf);
_luaFunctions.Remove(nlf);
return true;
}
@ -205,7 +205,7 @@ namespace BizHawk.Client.Common
{
foreach (var nlf in _luaFunctions.Where(nlf => nlf.Name == name.ToString()))
{
_luaFunctions.RemoveFunction(nlf);
_luaFunctions.Remove(nlf);
return true;
}

View File

@ -13,11 +13,11 @@ namespace BizHawk.Client.Common
}
}
public void RemoveFunction(NamedLuaFunction function)
public new bool Remove(NamedLuaFunction function)
{
Global.Emulator.CoreComm.InputCallback.Remove(function.Callback);
Global.Emulator.CoreComm.MemoryCallbackSystem.Remove(function.Callback);
Remove(function);
return base.Remove(function);
}
public void ClearAll()

View File

@ -703,7 +703,6 @@ namespace BizHawk.Client.EmuHawk
}
item.Stop();
}
}

View File

@ -87,7 +87,7 @@ namespace BizHawk.Client.EmuHawk
{
var guid = FunctionView.Items[index].SubItems[2].Text;
var nlf = GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions[guid];
GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions.RemoveFunction(nlf);
GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions.Remove(nlf);
}
PopulateListView();
}