Move/rename Lua library classes
This commit is contained in:
parent
e226ff102b
commit
e514dfd117
|
@ -8,15 +8,15 @@ using NLua;
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("A library for interacting with the currently loaded emulator core")]
|
||||
public sealed class EmulatorLuaLibrary : DelegatingLuaLibrary
|
||||
public sealed class EmulationLuaLibrary : DelegatingLuaLibrary
|
||||
{
|
||||
public Action FrameAdvanceCallback { get; set; }
|
||||
public Action YieldCallback { get; set; }
|
||||
|
||||
public EmulatorLuaLibrary(Lua lua)
|
||||
public EmulationLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public EmulatorLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public EmulationLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "emu";
|
|
@ -5,12 +5,12 @@ using NLua;
|
|||
// ReSharper disable UnusedAutoPropertyAccessor.Local
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class MemorySavestateEmuLuaLibrary : DelegatingLuaLibrary
|
||||
public sealed class MemorySavestateLuaLibrary : DelegatingLuaLibrary
|
||||
{
|
||||
public MemorySavestateEmuLuaLibrary(Lua lua)
|
||||
public MemorySavestateLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public MemorySavestateEmuLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public MemorySavestateLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "memorysavestate";
|
|
@ -8,12 +8,12 @@ using NLua;
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("A library for performing SQLite operations.")]
|
||||
public sealed class SqlLuaLibrary : DelegatingLuaLibrary
|
||||
public sealed class SQLiteLuaLibrary : DelegatingLuaLibrary
|
||||
{
|
||||
public SqlLuaLibrary(Lua lua)
|
||||
public SQLiteLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public SqlLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public SQLiteLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "SQL";
|
|
@ -6,12 +6,12 @@ using NLua;
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("A library for setting and retrieving dynamic data that will be saved and loaded with savestates")]
|
||||
public sealed class UserDataLibrary : DelegatingLuaLibrary
|
||||
public sealed class UserDataLuaLibrary : DelegatingLuaLibrary
|
||||
{
|
||||
public UserDataLibrary(Lua lua)
|
||||
public UserDataLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public UserDataLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public UserDataLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "userdata";
|
|
@ -10,7 +10,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("A library for registering lua functions to emulator events.\n All events support multiple registered methods.\nAll registered event methods can be named and return a Guid when registered")]
|
||||
public sealed class EventLuaLibrary : LuaLibraryBase
|
||||
public sealed class EventsLuaLibrary : LuaLibraryBase
|
||||
{
|
||||
[OptionalService]
|
||||
private IInputPollable InputPollableCore { get; set; }
|
||||
|
@ -24,10 +24,10 @@ namespace BizHawk.Client.Common
|
|||
[OptionalService]
|
||||
private IMemoryDomains Domains { get; set; }
|
||||
|
||||
public EventLuaLibrary(Lua lua)
|
||||
public EventsLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public EventLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public EventsLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "event";
|
|
@ -14,7 +14,7 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("Functions related specifically to Nes Cores")]
|
||||
public sealed class NesLuaLibrary : DelegatingLuaLibrary
|
||||
public sealed class NESLuaLibrary : DelegatingLuaLibrary
|
||||
{
|
||||
// TODO:
|
||||
// perhaps with the new core config system, one could
|
||||
|
@ -23,10 +23,10 @@ namespace BizHawk.Client.Common
|
|||
[OptionalService]
|
||||
private IMemoryDomains MemoryDomains { get; set; }
|
||||
|
||||
public NesLuaLibrary(Lua lua)
|
||||
public NESLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public NesLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public NESLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "nes";
|
|
@ -8,12 +8,12 @@ using BizHawk.Emulation.Cores.Nintendo.SNES;
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("Functions specific to SNESHawk (functions may not run when an SNES game is not loaded)")]
|
||||
public sealed class SnesLuaLibrary : DelegatingLuaLibrary
|
||||
public sealed class SNESLuaLibrary : DelegatingLuaLibrary
|
||||
{
|
||||
public SnesLuaLibrary(Lua lua)
|
||||
public SNESLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public SnesLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public SNESLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "snes";
|
|
@ -701,8 +701,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// The most common use case is CamHack for Sonic games.
|
||||
/// Accessing this from Lua allows to keep internal code hacks to minimum.
|
||||
/// <list type="bullet">
|
||||
/// <item><description><see cref="EmuHawkLuaLibrary.InvisibleEmulation(bool)"/></description></item>
|
||||
/// <item><description><see cref="EmuHawkLuaLibrary.SeekFrame(int)"/></description></item>
|
||||
/// <item><description><see cref="ClientLuaLibrary.InvisibleEmulation(bool)"/></description></item>
|
||||
/// <item><description><see cref="ClientLuaLibrary.SeekFrame(int)"/></description></item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
public bool InvisibleEmulation { get; set; }
|
||||
|
|
|
@ -68,9 +68,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
// TODO: make EmuHawk libraries have a base class with common properties such as this
|
||||
// and inject them here
|
||||
if (instance is EmuHawkLuaLibrary emuHawkLibrary)
|
||||
if (instance is ClientLuaLibrary clientLib)
|
||||
{
|
||||
emuHawkLibrary.MainForm = _mainForm;
|
||||
clientLib.MainForm = _mainForm;
|
||||
}
|
||||
|
||||
ApiContainerInstance = InitApiContainer(serviceProvider, ConsoleLuaLibrary.LogOutput);
|
||||
|
@ -83,8 +83,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
_lua.RegisterFunction("print", this, GetType().GetMethod("Print"));
|
||||
|
||||
EmulatorLuaLibrary.FrameAdvanceCallback = Frameadvance;
|
||||
EmulatorLuaLibrary.YieldCallback = EmuYield;
|
||||
EmulationLuaLibrary.FrameAdvanceCallback = Frameadvance;
|
||||
EmulationLuaLibrary.YieldCallback = EmuYield;
|
||||
|
||||
// Add LuaCanvas to Docs
|
||||
Type luaCanvas = typeof(LuaCanvas);
|
||||
|
@ -106,9 +106,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private FormsLuaLibrary FormsLibrary => (FormsLuaLibrary)Libraries[typeof(FormsLuaLibrary)];
|
||||
|
||||
private EventLuaLibrary EventsLibrary => (EventLuaLibrary)Libraries[typeof(EventLuaLibrary)];
|
||||
private EventsLuaLibrary EventsLibrary => (EventsLuaLibrary)Libraries[typeof(EventsLuaLibrary)];
|
||||
|
||||
private EmulatorLuaLibrary EmulatorLuaLibrary => (EmulatorLuaLibrary)Libraries[typeof(EmulatorLuaLibrary)];
|
||||
private EmulationLuaLibrary EmulationLuaLibrary => (EmulationLuaLibrary)Libraries[typeof(EmulationLuaLibrary)];
|
||||
|
||||
public override void Restart(IEmulatorServiceProvider newServiceProvider)
|
||||
{
|
|
@ -16,7 +16,7 @@ using BizHawk.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Description("A library for manipulating the EmuHawk client UI")]
|
||||
public sealed class EmuHawkLuaLibrary : DelegatingLuaLibraryEmu
|
||||
public sealed class ClientLuaLibrary : DelegatingLuaLibraryEmu
|
||||
{
|
||||
[RequiredService]
|
||||
private IEmulator Emulator { get; set; }
|
||||
|
@ -26,10 +26,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public MainForm MainForm { get; set; }
|
||||
|
||||
public EmuHawkLuaLibrary(Lua lua)
|
||||
public ClientLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public EmuHawkLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public ClientLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "client";
|
|
@ -7,12 +7,12 @@ using System.Text;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Description("A library for communicating with other programs")]
|
||||
public sealed class CommunicationLuaLibrary : LuaLibraryBase
|
||||
public sealed class CommLuaLibrary : LuaLibraryBase
|
||||
{
|
||||
public CommunicationLuaLibrary(Lua lua)
|
||||
public CommLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public CommunicationLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public CommLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "comm";
|
||||
|
@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public static string GetLuaFunctionsList()
|
||||
{
|
||||
var list = new StringBuilder();
|
||||
foreach (var function in typeof(CommunicationLuaLibrary).GetMethods())
|
||||
foreach (var function in typeof(CommLuaLibrary).GetMethods())
|
||||
{
|
||||
list.AppendLine(function.ToString());
|
||||
}
|
|
@ -14,12 +14,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
[Description("A library for manipulating the Tastudio dialog of the EmuHawk client")]
|
||||
[LuaLibrary(released: true)]
|
||||
public sealed class TastudioLuaLibrary : LuaLibraryBase
|
||||
public sealed class TAStudioLuaLibrary : LuaLibraryBase
|
||||
{
|
||||
public TastudioLuaLibrary(Lua lua)
|
||||
public TAStudioLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
||||
public TastudioLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
public TAStudioLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback) { }
|
||||
|
||||
public override string Name => "tastudio";
|
Loading…
Reference in New Issue