From 29b19d6e3da53b87779debbdf49223f4d222a724 Mon Sep 17 00:00:00 2001 From: EnderdracheLP Date: Sat, 5 Oct 2024 18:17:13 +0200 Subject: [PATCH] Bump for 1.37.5 --- .../Environment/MpexAvatarPlaceLighting.cs | 14 ++++++++------ MultiplayerExtensions/MultiplayerExtensions.csproj | 6 ++++++ .../UI/MpexEnvironmentViewController.cs | 4 ++-- MultiplayerExtensions/UI/MpexGameplaySetup.cs | 2 +- .../UI/MpexSettingsViewController.cs | 4 ++-- MultiplayerExtensions/manifest.json | 8 ++++---- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/MultiplayerExtensions/Environment/MpexAvatarPlaceLighting.cs b/MultiplayerExtensions/Environment/MpexAvatarPlaceLighting.cs index c8c8560..f9fefd1 100644 --- a/MultiplayerExtensions/Environment/MpexAvatarPlaceLighting.cs +++ b/MultiplayerExtensions/Environment/MpexAvatarPlaceLighting.cs @@ -17,19 +17,16 @@ public class MpexAvatarPlaceLighting : MonoBehaviour private List _lights = new List(); private IMultiplayerSessionManager _sessionManager = null!; - private MenuLightsManager _lightsManager = null!; private MpexPlayerManager _mpexPlayerManager = null!; private Config _config = null!; [Inject] internal void Construct( IMultiplayerSessionManager sessionManager, - MenuLightsManager lightsManager, MpexPlayerManager mpexPlayerManager, Config config) { _sessionManager = sessionManager; - _lightsManager = lightsManager; _mpexPlayerManager = mpexPlayerManager; _config = config; } @@ -38,7 +35,7 @@ private void Start() { _lights = GetComponentsInChildren().ToList(); - if (_sessionManager == null || _lightsManager == null || _mpexPlayerManager == null || _sessionManager.localPlayer == null) + if (_sessionManager == null || _mpexPlayerManager == null || _sessionManager.localPlayer == null) return; if (_sessionManager.localPlayer.sortIndex == SortIndex) @@ -98,13 +95,18 @@ private void Update() Color current = GetColor(); if (current == TargetColor) return; - if (_lightsManager.IsColorVeryCloseToColor(current, TargetColor)) + if (IsColorVeryCloseToColor(current, TargetColor)) SetColor(TargetColor); else SetColor(Color.Lerp(current, TargetColor, Time.deltaTime * SmoothTime)); } - public void SetColor(Color color, bool immediate) + private bool IsColorVeryCloseToColor(Color color0, Color color1) + { + return Mathf.Abs(color0.r - color1.r) < 0.002f && Mathf.Abs(color0.g - color1.g) < 0.002f && Mathf.Abs(color0.b - color1.b) < 0.002f && Mathf.Abs(color0.a - color1.a) < 0.002f; + } + + public void SetColor(Color color, bool immediate) { TargetColor = color; if (immediate) diff --git a/MultiplayerExtensions/MultiplayerExtensions.csproj b/MultiplayerExtensions/MultiplayerExtensions.csproj index 7fd9562..04c1cf3 100644 --- a/MultiplayerExtensions/MultiplayerExtensions.csproj +++ b/MultiplayerExtensions/MultiplayerExtensions.csproj @@ -52,6 +52,9 @@ False False + + $(BeatSaberDir)\Beat Saber_Data\Managed\BeatSaber.ViewSystem.dll + $(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll False @@ -89,6 +92,9 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\HMRendering.dll False + + $(BeatSaberDir)\Beat Saber_Data\Managed\Interactable.dll + $(BeatSaberDir)\Beat Saber_Data\Managed\LiteNetLib.dll False diff --git a/MultiplayerExtensions/UI/MpexEnvironmentViewController.cs b/MultiplayerExtensions/UI/MpexEnvironmentViewController.cs index b6e0fd0..59c425b 100644 --- a/MultiplayerExtensions/UI/MpexEnvironmentViewController.cs +++ b/MultiplayerExtensions/UI/MpexEnvironmentViewController.cs @@ -33,7 +33,7 @@ private void Construct( [UIAction("#post-parse")] private void PostParse() { - _sideBySideDistanceIncrement.interactable = _sideBySide; + _sideBySideDistanceIncrement.Interactable = _sideBySide; } [UIComponent("side-by-side-distance-increment")] @@ -65,7 +65,7 @@ private bool _sideBySide { _config.SideBySide = value; if (_sideBySideDistanceIncrement != null) - _sideBySideDistanceIncrement.interactable = value; + _sideBySideDistanceIncrement.Interactable = value; NotifyPropertyChanged(); } } diff --git a/MultiplayerExtensions/UI/MpexGameplaySetup.cs b/MultiplayerExtensions/UI/MpexGameplaySetup.cs index bd778ce..85fb878 100644 --- a/MultiplayerExtensions/UI/MpexGameplaySetup.cs +++ b/MultiplayerExtensions/UI/MpexGameplaySetup.cs @@ -48,7 +48,7 @@ internal MpexGameplaySetup( public void Initialize() { - BSMLParser.instance.Parse(BeatSaberMarkupLanguage.Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), ResourcePath), _multiplayerSettingsPanel.gameObject, this); + BSMLParser.Instance.Parse(BeatSaberMarkupLanguage.Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), ResourcePath), _multiplayerSettingsPanel.gameObject, this); while (0 < _vert.transform.childCount) _vert.transform.GetChild(0).SetParent(_multiplayerSettingsPanel.transform); } diff --git a/MultiplayerExtensions/UI/MpexSettingsViewController.cs b/MultiplayerExtensions/UI/MpexSettingsViewController.cs index 0d474f0..54f74b3 100644 --- a/MultiplayerExtensions/UI/MpexSettingsViewController.cs +++ b/MultiplayerExtensions/UI/MpexSettingsViewController.cs @@ -20,7 +20,7 @@ private void Construct( [UIAction("#post-parse")] private void PostParse() { - _personalMissLightingToggle.interactable = _missLighting; + _personalMissLightingToggle.Interactable = _missLighting; } [UIComponent("personal-miss-lighting-toggle")] @@ -67,7 +67,7 @@ private bool _missLighting { _config.MissLighting = value; if (_personalMissLightingToggle != null) - _personalMissLightingToggle.interactable = value; + _personalMissLightingToggle.Interactable = value; NotifyPropertyChanged(); } } diff --git a/MultiplayerExtensions/manifest.json b/MultiplayerExtensions/manifest.json index 9de7b0d..a175d0c 100644 --- a/MultiplayerExtensions/manifest.json +++ b/MultiplayerExtensions/manifest.json @@ -5,12 +5,12 @@ "author": "Goobwabber", "version": "1.1.0", "description": "Expands the functionality of Beat Saber Multiplayer.", - "gameVersion": "1.37.3", + "gameVersion": "1.37.5", "dependsOn": { "BSIPA": "^4.3.4", - "BeatSaberMarkupLanguage": "^1.11.2", - "SiraUtil": "^3.1.10", - "MultiplayerCore": "^1.5.0" + "BeatSaberMarkupLanguage": "^1.12.0", + "SiraUtil": "^3.1.12", + "MultiplayerCore": "^1.5.2" }, "links": { "project-home": "https://github.com/Goobwabber/MultiplayerExtensions",