Skip to content

Commit

Permalink
Fixed a situation where enabling TransportWall when Bloom is off woul…
Browse files Browse the repository at this point in the history
…d only result in translucency. thanks kinsi55
  • Loading branch information
Snow committed Feb 19, 2021
1 parent 88ca88e commit 769482c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CameraPlus/CameraPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HMRendering">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMRendering.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BGNet">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGNet.dll</HintPath>
<Private>False</Private>
Expand Down
4 changes: 2 additions & 2 deletions CameraPlus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,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("4.7.5")]
[assembly: AssemblyFileVersion("4.7.5")]
[assembly: AssemblyVersion("4.7.6")]
[assembly: AssemblyFileVersion("4.7.6")]
21 changes: 21 additions & 0 deletions CameraPlus/TransparentWallsPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace CameraPlus
{
/*
[HarmonyPatch(typeof(ObstacleController))]
[HarmonyPatch("Init", MethodType.Normal)]
public class TransparentWallsPatch
Expand All @@ -18,4 +19,24 @@ private static void Postfix(ref ObstacleController __instance)
}
}
}
*/
[HarmonyPatch(typeof(StretchableObstacle), nameof(StretchableObstacle.SetSizeAndColor))]
class TransparentWallsPatch
{
public static int WallLayerMask = 25;
static void Postfix(Transform ____obstacleCore, ref ParametricBoxFakeGlowController ____obstacleFakeGlow)
{
Camera.main.cullingMask |= (1 << TransparentWallsPatch.WallLayerMask);//Enables HMD bits because layer 25 is masked by default
if (____obstacleCore != null)
{
____obstacleCore.gameObject.layer = WallLayerMask;

// No-Bloom inner wall texture thingy
if (____obstacleFakeGlow.enabled)
____obstacleCore.GetChild(0).gameObject.layer = WallLayerMask;
}

//____obstacleFakeGlow.enabled = false;
}
}
}
2 changes: 1 addition & 1 deletion CameraPlus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"gameVersion": "1.13.2",
"id": "CameraPlus",
"name": "CameraPlus",
"version": "4.7.5",
"version": "4.7.6",
"features": [],
"dependsOn": {
"BSIPA": "^4.1.4"
Expand Down

0 comments on commit 769482c

Please sign in to comment.