diff --git a/Counters+/Installers/MultiplayerCountersInstaller.cs b/Counters+/Installers/MultiplayerCountersInstaller.cs index 151d1b0..d6407a5 100644 --- a/Counters+/Installers/MultiplayerCountersInstaller.cs +++ b/Counters+/Installers/MultiplayerCountersInstaller.cs @@ -10,10 +10,30 @@ internal class MultiplayerCountersInstaller : CountersInstaller { public override void InstallBindings() { - var coreGameHUD = GetComponentInChildren(); + // haha i made goobie beg me for this one line of code + if (!Plugin.MainConfig.Enabled) return; - // We need a separate installer to bind the HUD Controller so counters can use it - Container.Bind().FromInstance(coreGameHUD).AsSingle(); + // If CoreGameHUD isn't bound already (by MultEx or others), we need to bind it ourselves + var coreGameHUD = Container.TryResolve(); + if (coreGameHUD == null) + { + // Thankfully the CoreGameHUD is just a child of the installer GameObject + coreGameHUD = GetComponentInChildren(); + Container.Bind().FromInstance(coreGameHUD).AsSingle(); + + // Change base game HUD elements to standard position + var energyUIPanel = coreGameHUD.GetComponentInChildren(); + energyUIPanel.transform.position = new Vector3(0, -0.64f, 7.75f); + energyUIPanel.transform.rotation = Quaternion.Euler(0, 0, 0); + + var comboUI = coreGameHUD.GetComponentInChildren(); + comboUI.transform.position = new Vector3(-3.2f, 1.83f, 7f); + comboUI.transform.rotation = Quaternion.Euler(0, 0, 0); + + var multiplierUI = coreGameHUD.GetComponentInChildren(); + multiplierUI.transform.position = new Vector3(3.2f, 1.7f, 7f); + multiplierUI.transform.rotation = Quaternion.Euler(0, 0, 0); + } // For the multiplayer rank counter, we also need to bind the Multiplayer Position Container.Bind() @@ -22,19 +42,6 @@ public override void InstallBindings() Container.BindInterfacesAndSelfTo().AsSingle(); - // Change base game HUD elements to standard position - var energyUIPanel = coreGameHUD.GetComponentInChildren(); - energyUIPanel.transform.position = new Vector3(0, -0.64f, 7.75f); - energyUIPanel.transform.rotation = Quaternion.Euler(0, 0, 0); - - var comboUI = coreGameHUD.GetComponentInChildren(); - comboUI.transform.position = new Vector3(-3.2f, 1.83f, 7f); - comboUI.transform.rotation = Quaternion.Euler(0, 0, 0); - - var multiplierUI = coreGameHUD.GetComponentInChildren(); - multiplierUI.transform.position = new Vector3(3.2f, 1.7f, 7f); - multiplierUI.transform.rotation = Quaternion.Euler(0, 0, 0); - // Install counters like normal base.InstallBindings(); diff --git a/Counters+/Properties/AssemblyInfo.cs b/Counters+/Properties/AssemblyInfo.cs index a60e655..6c7f277 100644 --- a/Counters+/Properties/AssemblyInfo.cs +++ b/Counters+/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.3.0")] -[assembly: AssemblyFileVersion("2.3.0")] +[assembly: AssemblyVersion("2.3.1")] +[assembly: AssemblyFileVersion("2.3.1")] diff --git a/Counters+/manifest.json b/Counters+/manifest.json index 48f3e14..ff61ec0 100644 --- a/Counters+/manifest.json +++ b/Counters+/manifest.json @@ -3,10 +3,10 @@ "id": "Counters+", "name": "Counters+", "author": "Caeden117", - "version": "2.3.0", + "version": "2.3.1", "description": "A suite of enhancements for Beat Saber's UI.", "icon": "CountersPlus.UI.Images.Logo.png", - "gameVersion": "1.21.0", + "gameVersion": "1.23.0", "dependsOn": { "BSIPA": "^4.2.1", "BeatSaberMarkupLanguage": "^1.6.0",