mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
further cleanup of repo
This commit is contained in:
parent
4f8dcb0cd0
commit
323eb92f2e
140 changed files with 1 additions and 2430 deletions
27
.Experimental/LuaTTS/Patches.cs
Normal file
27
.Experimental/LuaTTS/Patches.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using ABI.Scripting.CVRSTL.Client;
|
||||
using ABI.Scripting.CVRSTL.Common;
|
||||
using HarmonyLib;
|
||||
using MoonSharp.Interpreter;
|
||||
using NAK.LuaTTS.Modules;
|
||||
|
||||
namespace NAK.LuaTTS.Patches;
|
||||
|
||||
internal static class LuaScriptFactoryPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(LuaScriptFactory.CVRRequireModule), nameof(LuaScriptFactory.CVRRequireModule.Require))]
|
||||
private static void Postfix_CVRRequireModule_require(
|
||||
string moduleFriendlyName,
|
||||
ref LuaScriptFactory.CVRRequireModule __instance,
|
||||
ref object __result,
|
||||
ref Script ____script,
|
||||
ref CVRLuaContext ____context)
|
||||
{
|
||||
const string TTSModuleID = "TextToSpeech";
|
||||
if (TTSModuleID != moduleFriendlyName)
|
||||
return; // not our module
|
||||
|
||||
__result = TTSLuaModule.RegisterUserData(____script, ____context);
|
||||
__instance.RegisteredModules[TTSModuleID] = __result; // add module to cache
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue