mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Merge branch 'master' of https://github.com/BepInEx/BepInEx
Conflicts: BepInEx.Preloader/Preloader.cs
This commit is contained in:
commit
1644e5c5e4
1 file changed
+28
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -31,6 +32,8 @@ namespace BepInEx.Preloader
|
||||
{
|
||||
try
|
||||
{
|
||||
InitializeHarmony();
|
||||
|
||||
ConsoleManager.Initialize(false);
|
||||
AllocateConsole();
|
||||
|
||||
@@ -239,6 +242,31 @@ namespace BepInEx.Preloader
|
||||
return $"Unknown ({(IsPostUnity2017 ? "post" : "pre")}-2017)";
|
||||
}
|
||||
|
||||
private static void InitializeHarmony()
|
||||
{
|
||||
switch (HarmonyBackend.Value)
|
||||
{
|
||||
case MonoModBackend.auto:
|
||||
break;
|
||||
case MonoModBackend.dynamicmethod:
|
||||
case MonoModBackend.methodbuilder:
|
||||
case MonoModBackend.cecil:
|
||||
Environment.SetEnvironmentVariable("MONOMOD_DMD_TYPE", HarmonyBackend.Value.ToString());
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(HarmonyBackend), HarmonyBackend.Value, "Unknown backend");
|
||||
}
|
||||
}
|
||||
|
||||
private enum MonoModBackend
|
||||
{
|
||||
// Enum names are important!
|
||||
[Description("Auto")] auto = 0,
|
||||
[Description("DynamicMethod")] dynamicmethod,
|
||||
[Description("MethodBuilder")] methodbuilder,
|
||||
[Description("Cecil")] cecil
|
||||
}
|
||||
|
||||
#region Config
|
||||
|
||||
private static readonly ConfigEntry<string> ConfigEntrypointAssembly = ConfigFile.CoreConfig.Bind(
|
||||
|
||||
Reference in new issue
Block a user