Move NES lua library to Client.Common
This commit is contained in:
parent
f7138e6514
commit
b3b21abe08
|
@ -1,11 +1,17 @@
|
||||||
using System.Linq;
|
using System;
|
||||||
using BizHawk.Client.Common;
|
using System.Linq;
|
||||||
using BizHawk.Emulation.Consoles.Nintendo;
|
using BizHawk.Emulation.Consoles.Nintendo;
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public class NESLuaLibrary : LuaLibraryBase
|
public class NESLuaLibrary : LuaLibraryBase
|
||||||
{
|
{
|
||||||
|
public NESLuaLibrary(Action updateCallback = null)
|
||||||
|
: base()
|
||||||
|
{
|
||||||
|
UpdateCallback = updateCallback;
|
||||||
|
}
|
||||||
|
|
||||||
public override string Name { get { return "nes"; } }
|
public override string Name { get { return "nes"; } }
|
||||||
public override string[] Functions
|
public override string[] Functions
|
||||||
{
|
{
|
||||||
|
@ -30,7 +36,17 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void nes_addgamegenie(string code)
|
private Action UpdateCallback;
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (UpdateCallback != null)
|
||||||
|
{
|
||||||
|
UpdateCallback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void nes_addgamegenie(string code)
|
||||||
{
|
{
|
||||||
if (Global.Emulator is NES)
|
if (Global.Emulator is NES)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +64,7 @@ namespace BizHawk.MultiClient
|
||||||
decoder.Value,
|
decoder.Value,
|
||||||
decoder.Compare
|
decoder.Compare
|
||||||
));
|
));
|
||||||
ToolHelpers.UpdateCheatRelatedTools();
|
Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +112,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void nes_removegamegenie(string code)
|
public void nes_removegamegenie(string code)
|
||||||
{
|
{
|
||||||
if (Global.Emulator is NES)
|
if (Global.Emulator is NES)
|
||||||
{
|
{
|
||||||
|
@ -104,7 +120,7 @@ namespace BizHawk.MultiClient
|
||||||
Global.CheatList.RemoveRange(
|
Global.CheatList.RemoveRange(
|
||||||
Global.CheatList.Where(x => x.Address == decoder.Address)
|
Global.CheatList.Where(x => x.Address == decoder.Address)
|
||||||
);
|
);
|
||||||
ToolHelpers.UpdateCheatRelatedTools();
|
Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace BizHawk.MultiClient
|
||||||
new MemoryLuaLibrary().LuaRegister(lua, Docs);
|
new MemoryLuaLibrary().LuaRegister(lua, Docs);
|
||||||
new MainMemoryLuaLibrary(_lua).LuaRegister(lua, Docs);
|
new MainMemoryLuaLibrary(_lua).LuaRegister(lua, Docs);
|
||||||
new MovieLuaLibrary(_lua).LuaRegister(lua, Docs);
|
new MovieLuaLibrary(_lua).LuaRegister(lua, Docs);
|
||||||
new NESLuaLibrary().LuaRegister(lua, Docs);
|
new NESLuaLibrary(ToolHelpers.UpdateCheatRelatedTools).LuaRegister(lua, Docs);
|
||||||
new SavestateLuaLibrary().LuaRegister(lua, Docs);
|
new SavestateLuaLibrary().LuaRegister(lua, Docs);
|
||||||
new SNESLuaLibrary().LuaRegister(lua, Docs);
|
new SNESLuaLibrary().LuaRegister(lua, Docs);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue