|
@@ -8,6 +8,7 @@ using BepInEx.Configuration;
|
|
using BepInEx.Logging;
|
|
using BepInEx.Logging;
|
|
using BepInEx.Preloader.Patching;
|
|
using BepInEx.Preloader.Patching;
|
|
using BepInEx.Preloader.RuntimeFixes;
|
|
using BepInEx.Preloader.RuntimeFixes;
|
|
|
|
+using HarmonyLib;
|
|
using Mono.Cecil;
|
|
using Mono.Cecil;
|
|
using Mono.Cecil.Cil;
|
|
using Mono.Cecil.Cil;
|
|
using MonoMod.RuntimeDetour;
|
|
using MonoMod.RuntimeDetour;
|
|
@@ -198,10 +199,28 @@ namespace BepInEx.Preloader
|
|
|
|
|
|
il.InsertBefore(ins,
|
|
il.InsertBefore(ins,
|
|
il.Create(OpCodes.Ldnull)); // gameExePath (always null, we initialize the Paths class in Entrypoint
|
|
il.Create(OpCodes.Ldnull)); // gameExePath (always null, we initialize the Paths class in Entrypoint
|
|
|
|
+
|
|
il.InsertBefore(ins,
|
|
il.InsertBefore(ins,
|
|
il.Create(OpCodes.Ldc_I4_0)); //startConsole (always false, we already load the console in Preloader)
|
|
il.Create(OpCodes.Ldc_I4_0)); //startConsole (always false, we already load the console in Preloader)
|
|
|
|
+
|
|
|
|
+ il.InsertBefore(ins,
|
|
|
|
+ il.Create(OpCodes.Ldnull)); // preloaderLogEvents (load from Preloader.PreloaderLog.LogEvents)
|
|
|
|
+
|
|
|
|
+ Logger.LogDebug("1");
|
|
|
|
+
|
|
|
|
+ il.InsertBefore(ins,
|
|
|
|
+ il.Create(OpCodes.Call, assembly.MainModule.ImportReference(
|
|
|
|
+ AccessTools.PropertyGetter(typeof(Preloader), nameof(PreloaderLog)))));
|
|
|
|
+
|
|
|
|
+ Logger.LogDebug("2");
|
|
|
|
+
|
|
|
|
+ il.InsertBefore(ins,
|
|
|
|
+ il.Create(OpCodes.Call, assembly.MainModule.ImportReference(
|
|
|
|
+ AccessTools.PropertyGetter(typeof(PreloaderConsoleListener), nameof(PreloaderConsoleListener.LogEvents)))));
|
|
|
|
+
|
|
il.InsertBefore(ins,
|
|
il.InsertBefore(ins,
|
|
il.Create(OpCodes.Call, initMethod)); // Chainloader.Initialize(string gamePath, string managedPath = null, bool startConsole = true)
|
|
il.Create(OpCodes.Call, initMethod)); // Chainloader.Initialize(string gamePath, string managedPath = null, bool startConsole = true)
|
|
|
|
+
|
|
il.InsertBefore(ins,
|
|
il.InsertBefore(ins,
|
|
il.Create(OpCodes.Call, startMethod));
|
|
il.Create(OpCodes.Call, startMethod));
|
|
}
|
|
}
|