From 759cc562676f7cb4bb76a32d68b44bb140443ae5 Mon Sep 17 00:00:00 2001
From: Pink <62712899+ModdingPink@users.noreply.github.com>
Date: Thu, 17 Aug 2023 18:39:51 +0100
Subject: [PATCH] Bepinex Publicizer, Unbind CoreGameHUDController
---
MultiplayerExtensions/MultiplayerExtensions.csproj | 9 +++++----
MultiplayerExtensions/Patchers/EnvironmentPatcher.cs | 5 ++++-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/MultiplayerExtensions/MultiplayerExtensions.csproj b/MultiplayerExtensions/MultiplayerExtensions.csproj
index 555a049..404f22c 100644
--- a/MultiplayerExtensions/MultiplayerExtensions.csproj
+++ b/MultiplayerExtensions/MultiplayerExtensions.csproj
@@ -66,10 +66,6 @@
$(BeatSaberDir)\Beat Saber_Data\Managed\LiteNetLib.dll
False
-
- $(BeatSaberDir)\Plugins\MultiplayerCore.dll
- False
-
$(BeatSaberDir)\Beat Saber_Data\Managed\netstandard.dll
False
@@ -208,6 +204,11 @@
all
+
+
+
+
+
diff --git a/MultiplayerExtensions/Patchers/EnvironmentPatcher.cs b/MultiplayerExtensions/Patchers/EnvironmentPatcher.cs
index 19d8661..368c4ce 100644
--- a/MultiplayerExtensions/Patchers/EnvironmentPatcher.cs
+++ b/MultiplayerExtensions/Patchers/EnvironmentPatcher.cs
@@ -4,6 +4,7 @@
using SiraUtil.Logging;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -159,6 +160,7 @@ private void InstallEnvironment(Context __instance, List normalIn
}
}
+
[AffinityPrefix]
[AffinityPatch(typeof(GameObjectContext), "InstallInstallers")]
private void LoveYouCountersPlus(GameObjectContext __instance)
@@ -167,6 +169,7 @@ private void LoveYouCountersPlus(GameObjectContext __instance)
{
DiContainer container = __instance.GetProperty("Container");
var hud = (CoreGameHUDController)_behavioursToInject.Find(x => x is CoreGameHUDController);
+ container.Unbind();
container.Bind().FromInstance(hud).AsSingle();
var multihud = __instance.transform.GetComponentInChildren();
multihud.gameObject.SetActive(false);
@@ -175,7 +178,7 @@ private void LoveYouCountersPlus(GameObjectContext __instance)
}
}
- [AffinityPostfix]
+ [AffinityPostfix]
[AffinityPatch(typeof(GameObjectContext), "InstallSceneBindings")]
private void ActivateEnvironment(GameObjectContext __instance)
{