remove remaining globals in LuaFunctionList
This commit is contained in:
parent
42c6168c7e
commit
e0df266cb7
|
@ -42,16 +42,16 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
public void Clear(IEmulator emulator)
|
||||
{
|
||||
if (Global.Emulator.InputCallbacksAvailable())
|
||||
if (emulator.InputCallbacksAvailable())
|
||||
{
|
||||
Global.Emulator.AsInputPollable().InputCallbacks.RemoveAll(_functions.Select(w => w.Callback));
|
||||
emulator.AsInputPollable().InputCallbacks.RemoveAll(_functions.Select(w => w.Callback));
|
||||
}
|
||||
|
||||
if (Global.Emulator.MemoryCallbacksAvailable())
|
||||
if (emulator.MemoryCallbacksAvailable())
|
||||
{
|
||||
var memoryCallbacks = Global.Emulator.AsDebuggable().MemoryCallbacks;
|
||||
var memoryCallbacks = emulator.AsDebuggable().MemoryCallbacks;
|
||||
memoryCallbacks.RemoveAll(_functions.Select(w => w.MemCallback));
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override void Close()
|
||||
{
|
||||
RegisteredFunctions.Clear();
|
||||
RegisteredFunctions.Clear(Global.Emulator); // TODO: don't use globals
|
||||
FormsLibrary.DestroyAll();
|
||||
_lua.Close();
|
||||
_lua = new Lua();
|
||||
|
|
|
@ -1257,7 +1257,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ClearRegisteredFunctionsContextMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
LuaImp.RegisteredFunctions.Clear();
|
||||
LuaImp.RegisteredFunctions.Clear(Emulator);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue