Skip to content

Commit

Permalink
Fix up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xen-42 committed Aug 24, 2023
1 parent 845c788 commit 3e23e43
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NewHorizons/Components/Stars/SunLightEffectsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private void ChangeActiveStar(StarController star)
transform.localPosition = Vector3.zero;

// Some effects use Locator.GetSunTransform so hopefully its fine to change it
// Use the root transform of the star because that's the default behaviour, breaks SunProxy is not (potentially others)
// Use the root transform of the star because that's the default behaviour, breaks SunProxy if not (potentially others)
Locator._sunTransform = star.transform;

// TODO?: maybe also turn off star controller stuff (mainly proxy light) since idk if that can handle more than 1 being on
Expand Down
18 changes: 15 additions & 3 deletions NewHorizons/Components/Volumes/WaterCloakFixerVolume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,31 @@

namespace NewHorizons.Components.Volumes
{
/// <summary>
/// A cloak can interfere with the rendering of water
/// Water has a lower render queue and is transparent, so you can see the background black cloak over top of the water
/// We fix this by setting the water's render queue to that of the cloak
/// However, this means that when you are inside the water you will see through the cloak since it's not rendered on top
/// To fix that, we set the render queue back to normal when the player enters the water
/// Currently this doesnt nothing to fix probe camera pictures. If you are outside of the water, the probe will see the stars and through the cloak
/// Oh well
/// </summary>
internal class WaterCloakFixerVolume : MonoBehaviour
{
public Material material;
private OWTriggerVolume _volume;

public const int WATER_RENDER_QUEUE = 2990;
public const int CLOAK_RENDER_QUEUE = 3000;

public void Start()
{
_volume = GetComponent<RadialFluidVolume>().GetOWTriggerVolume();

_volume.OnEntry += WaterCloakFixerVolume_OnEntry;
_volume.OnExit += WaterCloakFixerVolume_OnExit;

material.renderQueue = 3000;
material.renderQueue = CLOAK_RENDER_QUEUE;
}

public void OnDestroy()
Expand All @@ -27,15 +39,15 @@ private void WaterCloakFixerVolume_OnEntry(GameObject hitObj)
{
if (hitObj.CompareTag("PlayerDetector"))
{
material.renderQueue = 2990;
material.renderQueue = WATER_RENDER_QUEUE;
}
}

private void WaterCloakFixerVolume_OnExit(GameObject hitObj)
{
if (hitObj.CompareTag("PlayerDetector"))
{
material.renderQueue = 3000;
material.renderQueue = CLOAK_RENDER_QUEUE;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/Handlers/PlayerSpawnHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void OnSystemReady(bool shouldWarpInFromShip, bool shouldWarpInFro
var cloak = GetDefaultSpawn()?.GetAttachedOWRigidbody()?.GetComponentInChildren<CloakFieldController>();
if (cloak != null)
{
// Ensures it has invoked everything and actually placed the player in the cloaking field
// Ensures it has invoked everything and actually placed the player in the cloaking field #671
cloak._firstUpdate = true;
}
}
Expand Down

0 comments on commit 3e23e43

Please sign in to comment.