Преглед на файлове

Add assembly resolve event to TypeLoader for hooking up chainloading

ghorsington преди 5 години
родител
ревизия
8cf646d898
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      BepInEx/Bootstrap/TypeLoader.cs

+ 3 - 1
BepInEx/Bootstrap/TypeLoader.cs

@@ -17,6 +17,8 @@ namespace BepInEx.Bootstrap
 		private static DefaultAssemblyResolver resolver;
 		private static ReaderParameters readerParameters;
 
+		public static event AssemblyResolveEventHandler AssemblyResolve;
+
 		static TypeLoader()
 		{
 			resolver = new DefaultAssemblyResolver();
@@ -31,7 +33,7 @@ namespace BepInEx.Bootstrap
 					Utility.TryResolveDllAssembly(name, Paths.ManagedPath, readerParameters, out assembly))
 					return assembly;
 
-				return null;
+				return AssemblyResolve?.Invoke(sender, reference);
 			};
 		}