|
@@ -46,19 +46,12 @@ namespace BepInEx.Preloader.Unity
|
|
if (managedDirectory != null)
|
|
if (managedDirectory != null)
|
|
ManagedPath = managedDirectory;
|
|
ManagedPath = managedDirectory;
|
|
|
|
|
|
- bool bridgeInitialized = Utility.TryDo(() =>
|
|
|
|
|
|
+
|
|
|
|
+ Utility.TryDo(() =>
|
|
{
|
|
{
|
|
- if (ConfigShimHarmony.Value)
|
|
|
|
- HarmonyDetourBridge.Init();
|
|
|
|
- }, out var harmonyBridgeException);
|
|
|
|
-
|
|
|
|
- Exception runtimePatchException = null;
|
|
|
|
- if (bridgeInitialized)
|
|
|
|
- Utility.TryDo(() =>
|
|
|
|
- {
|
|
|
|
- if (ConfigApplyRuntimePatches.Value)
|
|
|
|
- UnityPatches.Apply();
|
|
|
|
- }, out runtimePatchException);
|
|
|
|
|
|
+ if (ConfigApplyRuntimePatches.Value)
|
|
|
|
+ UnityPatches.Apply();
|
|
|
|
+ }, out var runtimePatchException);
|
|
|
|
|
|
Logger.Sources.Add(TraceLogSource.CreateSource());
|
|
Logger.Sources.Add(TraceLogSource.CreateSource());
|
|
|
|
|
|
@@ -77,9 +70,6 @@ namespace BepInEx.Preloader.Unity
|
|
Log.LogDebug($"Unity Managed directory: {ManagedPath}");
|
|
Log.LogDebug($"Unity Managed directory: {ManagedPath}");
|
|
Log.LogDebug($"BepInEx root path: {Paths.BepInExRootPath}");
|
|
Log.LogDebug($"BepInEx root path: {Paths.BepInExRootPath}");
|
|
|
|
|
|
- if (harmonyBridgeException != null)
|
|
|
|
- Log.LogWarning($"Failed to enable fix for Harmony for .NET Standard API. Error message: {harmonyBridgeException.Message}");
|
|
|
|
-
|
|
|
|
if (runtimePatchException != null)
|
|
if (runtimePatchException != null)
|
|
Log.LogWarning($"Failed to apply runtime patches for Mono. See more info in the output log. Error message: {runtimePatchException.Message}");
|
|
Log.LogWarning($"Failed to apply runtime patches for Mono. See more info in the output log. Error message: {runtimePatchException.Message}");
|
|
|
|
|
|
@@ -280,11 +270,6 @@ namespace BepInEx.Preloader.Unity
|
|
true,
|
|
true,
|
|
"Enables or disables runtime patches.\nThis should always be true, unless you cannot start the game due to a Harmony related issue (such as running .NET Standard runtime) or you know what you're doing.");
|
|
"Enables or disables runtime patches.\nThis should always be true, unless you cannot start the game due to a Harmony related issue (such as running .NET Standard runtime) or you know what you're doing.");
|
|
|
|
|
|
- private static readonly ConfigEntry<bool> ConfigShimHarmony = ConfigFile.CoreConfig.Bind(
|
|
|
|
- "Preloader", "ShimHarmonySupport",
|
|
|
|
- !Utility.CLRSupportsDynamicAssemblies,
|
|
|
|
- "If enabled, basic Harmony functionality is patched to use MonoMod's RuntimeDetour instead.\nTry using this if Harmony does not work in a game.");
|
|
|
|
-
|
|
|
|
private static readonly ConfigEntry<bool> ConfigPreloaderCOutLogging = ConfigFile.CoreConfig.Bind(
|
|
private static readonly ConfigEntry<bool> ConfigPreloaderCOutLogging = ConfigFile.CoreConfig.Bind(
|
|
"Logging", "PreloaderConsoleOutRedirection",
|
|
"Logging", "PreloaderConsoleOutRedirection",
|
|
true,
|
|
true,
|