embed plugin loader directly into the launcher

This commit is contained in:
zznty
2022-10-29 01:50:14 +07:00
parent 7204815c0c
commit 66d3dc2ead
53 changed files with 5689 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
using System.Reflection;
using HarmonyLib;
using Sandbox.Game.World;
using VRage.Game;
using VRage.Plugins;
namespace PluginLoader.Patch;
[HarmonyPatch(typeof(MySession), "RegisterComponentsFromAssembly")]
[HarmonyPatch(new[] { typeof(Assembly), typeof(bool), typeof(MyModContext) })]
public static class Patch_ComponentRegistered
{
public static void Prefix(Assembly assembly)
{
if (assembly == MyPlugins.GameAssembly)
Main.Instance?.RegisterComponents();
}
}