fix imgui and plugin loading

This commit is contained in:
zznty
2024-10-11 12:11:53 +07:00
parent 0933915c64
commit 25981da0fe
10 changed files with 243 additions and 23 deletions

View File

@@ -12,17 +12,21 @@ while (!Debugger.IsAttached)
VelopackApp.Build().Run();
#if DEBUG
AssemblyLoadContext.Default.Resolving += (loadContext, name) =>
{
Debug.WriteLine($"resolving {name} in {loadContext}");
return null;
};
#endif
var dir = Path.GetDirectoryName(args[0])!;
var context = new GameDirectoryAssemblyLoadContext(dir);
// a list of assemblies which are not in the game binaries but reference them
context.AddDependencyOverride("CringeLauncher");
context.AddDependencyOverride("PluginLoader");
context.AddDependencyOverride("CringePlugins");
var launcher = context.LoadFromAssemblyName(new AssemblyName("CringeLauncher"));