From c93179e110454a2e55b580c24a45a2091ba215bf Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 3 Jun 2022 02:12:45 +1000 Subject: [PATCH] Indicate that only Lua mem callbacks get args, not input (yet) see #3233, fixes d829f19bc, 8385337e7 --- .../lua/LuaHelperLibs/EventsLuaLibrary.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs b/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs index c5dbdc6916..522a5f234a 100644 --- a/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs @@ -44,10 +44,10 @@ namespace BizHawk.Client.Common Log($"{scope} is not an available scope for {Emulator.Attributes().CoreName}"); } - [LuaMethod("can_use_callback_params", "Returns true. Check this function exists to decide whether to use hacks for older versions w/o parameter support.")] - [LuaMethodExample("local mem_callback = event.can_use_callback_params ~= nil and mem_callback or mem_callback_pre_28;")] - public bool CanUseCallbackParams() - => true; + [LuaMethod("can_use_callback_params", "Returns whether EmuHawk will pass arguments to callbacks. This version passes arguments to \"memory\" callbacks, so this function will return true for that input. (It returns false for any other input.) This tells you whether hacks for older versions w/o parameter support are necessary.")] + [LuaMethodExample("local mem_callback = event.can_use_callback_params(\"memory\") and mem_callback or mem_callback_pre_29;")] + public bool CanUseCallbackParams(string subset = null) + => subset is "memory"; [LuaMethodExample("local steveonf = event.onframeend(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts\" );\r\n\tend\r\n\t, \"Frame name\" );")] [LuaMethod("onframeend", "Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts")]