You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revert "Replace 2 `ILuaLibraries` methods with delegates on `EventsLuaLibrary`"
This reverts commit a85ef40.
reverting that one because it made it more painful to add custom hooks
privateconststringERR_MSG_UNSUPPORTED_CORE=$"`doom.*` functions can only be used with {CoreNames.DSDA}";
21
+
22
+
[RequiredService]
23
+
privateIEmulatorEmulator{get;set;}
24
+
25
+
/// <exception cref="InvalidOperationException">loaded core is not DSDA-Doom</exception>
26
+
[LuaMethodExample("local rngcall = doom.onprandom(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function after each P_Random() call by Doom\" );\r\n\tend\r\n\t, \"Frame name\" );")]
27
+
[LuaMethod("onprandom","Calls the given lua function after each P_Random() call by Doom")]
[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")]
@@ -75,20 +62,20 @@ public bool CanUseCallbackParams(string subset = null)
75
62
[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\" );")]
76
63
[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")]
[LuaMethodExample("local steveonf = event.onframestart(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function at the beginning of each frame before any emulation and drawing occurs\" );\r\n\tend\r\n\t, \"Frame name\" );")]
82
69
[LuaMethod("onframestart","Calls the given lua function at the beginning of each frame before any emulation and drawing occurs")]
[LuaMethodExample("local steveoni = event.oninputpoll(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function after each time the emulator core polls for input\" );\r\n\tend\r\n\t, \"Frame name\" );")]
88
75
[LuaMethod("oninputpoll","Calls the given lua function after each time the emulator core polls for input")]
[LuaMethodExample("local steveonl = event.onloadstate(\r\n\tfunction()\r\n\tconsole.log( \"Fires after a state is loaded. Receives a lua function name, and registers it to the event immediately following a successful savestate event\" );\r\nend\", \"Frame name\" );")]
120
107
[LuaMethod("onloadstate","Fires after a state is loaded. Your callback can have 1 parameter, which will be the name of the loaded state.")]
[LuaMethodExample("local steveons = event.onsavestate(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after a state is saved\" );\r\n\tend\r\n\t, \"Frame name\" );")]
306
293
[LuaMethod("onsavestate","Fires after a state is saved. Your callback can have 1 parameter, which will be the name of the saved state.")]
[LuaMethodExample("local steveone = event.onexit(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after the calling script has stopped\" );\r\n\tend\r\n\t, \"Frame name\" );")]
312
299
[LuaMethod("onexit","Fires after the calling script has stopped")]
[LuaMethodExample("if ( event.unregisterbyid( \"4d1810b7 - 0d28 - 4acb - 9d8b - d87721641551\" ) ) then\r\n\tconsole.log( \"Removes the registered function that matches the guid.If a function is found and remove the function will return true.If unable to find a match, the function will return false.\" );\r\nend;")]
324
311
[LuaMethod("unregisterbyid","Removes the registered function that matches the guid. If a function is found and remove the function will return true. If unable to find a match, the function will return false.")]
[LuaMethodExample("if ( event.unregisterbyname( \"Function name\" ) ) then\r\n\tconsole.log( \"Removes the first registered function that matches Name.If a function is found and remove the function will return true.If unable to find a match, the function will return false.\" );\r\nend;")]
332
319
[LuaMethod("unregisterbyname","Removes the first registered function that matches Name. If a function is found and remove the function will return true. If unable to find a match, the function will return false.")]
0 commit comments