From a54aa0706d09726087b3f1bbc963101983677fba Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 4 Dec 2020 23:46:15 +1000 Subject: [PATCH] Deprecate emu.getluacore in favour of new func client.get_lua_engine --- .../lua/CommonLibs/ClientLuaLibrary.cs | 3 +++ .../lua/CommonLibs/EmulationLuaLibrary.cs | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs index c86faf836b..7270d4bb0c 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs @@ -77,6 +77,9 @@ namespace BizHawk.Client.Common [LuaMethod("frameskip", "Sets the frame skip value of the client UI (use 0 to disable)")] public void FrameSkip(int numFrames) => APIs.EmuClient.FrameSkip(numFrames); + [LuaMethod("get_lua_engine", "returns the name of the Lua engine currently in use")] + public string GetLuaEngine() => _luaLibsImpl.EngineName; + [LuaMethodExample("client.invisibleemulation( true );")] [LuaMethod("invisibleemulation", "Disables and enables emulator updates")] public void InvisibleEmulation(bool invisible) => APIs.EmuClient.InvisibleEmulation(invisible); diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/EmulationLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/EmulationLuaLibrary.cs index 594bc02af2..367da6fb38 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/EmulationLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/EmulationLuaLibrary.cs @@ -101,7 +101,12 @@ namespace BizHawk.Client.Common [LuaMethod("getboardname", "returns (if available) the board name of the loaded ROM")] public string GetBoardName() => APIs.Emulation.GetBoardName(); + [LuaDeprecatedMethod] [LuaMethod("getluacore", "returns the name of the Lua core currently in use")] - public string GetLuaBackend() => _luaLibsImpl.EngineName; + public string GetLuaBackend() + { + Log("Deprecated function emu.getluacore() used, replace the call with client.get_lua_engine()."); + return _luaLibsImpl.EngineName; + } } }