Skip to content

Commit 759cc56

Browse files
committed
Bepinex Publicizer, Unbind CoreGameHUDController
1 parent ff60230 commit 759cc56

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

MultiplayerExtensions/MultiplayerExtensions.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@
6666
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\LiteNetLib.dll</HintPath>
6767
<Private>False</Private>
6868
</Reference>
69-
<Reference Include="MultiplayerCore">
70-
<HintPath>$(BeatSaberDir)\Plugins\MultiplayerCore.dll</HintPath>
71-
<Private>False</Private>
72-
</Reference>
7369
<Reference Include="netstandard">
7470
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\netstandard.dll</HintPath>
7571
<Private>False</Private>
@@ -208,6 +204,11 @@
208204
<PrivateAssets>all</PrivateAssets>
209205
</PackageReference>
210206
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
207+
</ItemGroup>
208+
<ItemGroup>
209+
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all" />
210+
<!-- Publicize directly when referencing -->
211+
<Reference Include="$(BeatSaberDir)\Plugins\MultiplayerCore.dll" Publicize="true" />
211212
</ItemGroup>
212213
<ItemGroup>
213214
<Folder Include="Assets" />

MultiplayerExtensions/Patchers/EnvironmentPatcher.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using SiraUtil.Logging;
55
using System;
66
using System.Collections.Generic;
7+
using System.ComponentModel;
78
using System.Linq;
89
using UnityEngine;
910
using UnityEngine.SceneManagement;
@@ -159,6 +160,7 @@ private void InstallEnvironment(Context __instance, List<InstallerBase> normalIn
159160
}
160161
}
161162

163+
162164
[AffinityPrefix]
163165
[AffinityPatch(typeof(GameObjectContext), "InstallInstallers")]
164166
private void LoveYouCountersPlus(GameObjectContext __instance)
@@ -167,6 +169,7 @@ private void LoveYouCountersPlus(GameObjectContext __instance)
167169
{
168170
DiContainer container = __instance.GetProperty<DiContainer, GameObjectContext>("Container");
169171
var hud = (CoreGameHUDController)_behavioursToInject.Find(x => x is CoreGameHUDController);
172+
container.Unbind<CoreGameHUDController>();
170173
container.Bind<CoreGameHUDController>().FromInstance(hud).AsSingle();
171174
var multihud = __instance.transform.GetComponentInChildren<CoreGameHUDController>();
172175
multihud.gameObject.SetActive(false);
@@ -175,7 +178,7 @@ private void LoveYouCountersPlus(GameObjectContext __instance)
175178
}
176179
}
177180

178-
[AffinityPostfix]
181+
[AffinityPostfix]
179182
[AffinityPatch(typeof(GameObjectContext), "InstallSceneBindings")]
180183
private void ActivateEnvironment(GameObjectContext __instance)
181184
{

0 commit comments

Comments
 (0)