1
0
Fork 0

Save Harmony own instance in private static

That's how other mods do it. Might be useful to reload patches.
This commit is contained in:
ivan tkachenko 2025-12-19 23:40:46 +02:00
parent 38c9472cb1
commit a4ca1c86ec
1 changed files with 12 additions and 11 deletions

View File

@ -27,6 +27,7 @@ namespace MuzikaGromche
[BepInDependency("BMX.LobbyCompatibility", BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency("BMX.LobbyCompatibility", BepInDependency.DependencyFlags.SoftDependency)]
public class Plugin : BaseUnityPlugin public class Plugin : BaseUnityPlugin
{ {
private static Harmony Harmony = null!;
internal static ManualLogSource Log = null!; internal static ManualLogSource Log = null!;
internal new static Config Config { get; private set; } = null!; internal new static Config Config { get; private set; } = null!;
@ -945,17 +946,17 @@ namespace MuzikaGromche
Config = new Config(base.Config); Config = new Config(base.Config);
DiscoBallManager.Load(); DiscoBallManager.Load();
PoweredLightsAnimators.Load(); PoweredLightsAnimators.Load();
var harmony = new Harmony(PluginInfo.PLUGIN_NAME); Harmony = new Harmony(PluginInfo.PLUGIN_NAME);
harmony.PatchAll(typeof(GameNetworkManagerPatch)); Harmony.PatchAll(typeof(GameNetworkManagerPatch));
harmony.PatchAll(typeof(JesterPatch)); Harmony.PatchAll(typeof(JesterPatch));
harmony.PatchAll(typeof(EnemyAIPatch)); Harmony.PatchAll(typeof(EnemyAIPatch));
harmony.PatchAll(typeof(PoweredLightsAnimatorsPatch)); Harmony.PatchAll(typeof(PoweredLightsAnimatorsPatch));
harmony.PatchAll(typeof(AllPoweredLightsPatch)); Harmony.PatchAll(typeof(AllPoweredLightsPatch));
harmony.PatchAll(typeof(DiscoBallTilePatch)); Harmony.PatchAll(typeof(DiscoBallTilePatch));
harmony.PatchAll(typeof(DiscoBallDespawnPatch)); Harmony.PatchAll(typeof(DiscoBallDespawnPatch));
harmony.PatchAll(typeof(SpawnRatePatch)); Harmony.PatchAll(typeof(SpawnRatePatch));
harmony.PatchAll(typeof(DeathScreenGameOverTextResetPatch)); Harmony.PatchAll(typeof(DeathScreenGameOverTextResetPatch));
harmony.PatchAll(typeof(ScreenFiltersManager.HUDManagerScreenFiltersPatch)); Harmony.PatchAll(typeof(ScreenFiltersManager.HUDManagerScreenFiltersPatch));
NetcodePatcher(); NetcodePatcher();
Compatibility.Register(this); Compatibility.Register(this);
} }