Skip to content

Commit

Permalink
Bump for 1.37.5
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-r-elp committed Oct 5, 2024
1 parent 1497fa7 commit 29b19d6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
14 changes: 8 additions & 6 deletions MultiplayerExtensions/Environment/MpexAvatarPlaceLighting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ public class MpexAvatarPlaceLighting : MonoBehaviour
private List<TubeBloomPrePassLight> _lights = new List<TubeBloomPrePassLight>();

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;
}
Expand All @@ -38,7 +35,7 @@ private void Start()
{
_lights = GetComponentsInChildren<TubeBloomPrePassLight>().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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions MultiplayerExtensions/MultiplayerExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BeatSaber.ViewSystem">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BeatSaber.ViewSystem.dll</HintPath>
</Reference>
<Reference Include="BGLib.AppFlow" Publicize="true">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -89,6 +92,9 @@
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMRendering.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Interactable">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Interactable.dll</HintPath>
</Reference>
<Reference Include="LiteNetLib">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\LiteNetLib.dll</HintPath>
<Private>False</Private>
Expand Down
4 changes: 2 additions & 2 deletions MultiplayerExtensions/UI/MpexEnvironmentViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -65,7 +65,7 @@ private bool _sideBySide
{
_config.SideBySide = value;
if (_sideBySideDistanceIncrement != null)
_sideBySideDistanceIncrement.interactable = value;
_sideBySideDistanceIncrement.Interactable = value;
NotifyPropertyChanged();
}
}
Expand Down
2 changes: 1 addition & 1 deletion MultiplayerExtensions/UI/MpexGameplaySetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions MultiplayerExtensions/UI/MpexSettingsViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private void Construct(
[UIAction("#post-parse")]
private void PostParse()
{
_personalMissLightingToggle.interactable = _missLighting;
_personalMissLightingToggle.Interactable = _missLighting;
}

[UIComponent("personal-miss-lighting-toggle")]
Expand Down Expand Up @@ -67,7 +67,7 @@ private bool _missLighting
{
_config.MissLighting = value;
if (_personalMissLightingToggle != null)
_personalMissLightingToggle.interactable = value;
_personalMissLightingToggle.Interactable = value;
NotifyPropertyChanged();
}
}
Expand Down
8 changes: 4 additions & 4 deletions MultiplayerExtensions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 29b19d6

Please sign in to comment.