Categorized some stuff in components and fixed Trifids star thing maybe

This commit is contained in:
Nick 2022-09-15 00:41:05 -04:00
parent 6d2dbf72d5
commit 5a5ea46b05
41 changed files with 233 additions and 204 deletions

View File

@ -7,6 +7,7 @@ using System.Collections.Generic;
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using UnityEngine; using UnityEngine;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
using NewHorizons.Components.Volumes;
namespace NewHorizons.Builder.Body namespace NewHorizons.Builder.Body
{ {

View File

@ -1,4 +1,3 @@
using NewHorizons.Components;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;
using NewHorizons.Utility; using NewHorizons.Utility;
using System; using System;
@ -10,6 +9,7 @@ using System.Linq;
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
using System.Drawing; using System.Drawing;
using Color = UnityEngine.Color; using Color = UnityEngine.Color;
using NewHorizons.Components.Volumes;
namespace NewHorizons.Builder.Body namespace NewHorizons.Builder.Body
{ {

View File

@ -1,4 +1,3 @@
using NewHorizons.Components;
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
using NewHorizons.Utility; using NewHorizons.Utility;
using OWML.Utils; using OWML.Utils;
@ -9,6 +8,7 @@ using OWML.ModHelper;
using OWML.Common; using OWML.Common;
using UnityEngine.InputSystem.XR; using UnityEngine.InputSystem.XR;
using System.Linq; using System.Linq;
using NewHorizons.Components.Stars;
namespace NewHorizons.Builder.Body namespace NewHorizons.Builder.Body
{ {

View File

@ -1,9 +1,9 @@
using NewHorizons.Components;
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
using NewHorizons.Utility; using NewHorizons.Utility;
using UnityEngine; using UnityEngine;
using NewHorizons.External.Modules.VariableSize; using NewHorizons.External.Modules.VariableSize;
using Tessellation; using Tessellation;
using NewHorizons.Components.Volumes;
namespace NewHorizons.Builder.Body namespace NewHorizons.Builder.Body
{ {

View File

@ -1,5 +1,5 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.Components; using NewHorizons.Components.Quantum;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using NewHorizons.Utility; using NewHorizons.Utility;

View File

@ -1,4 +1,4 @@
using NewHorizons.Components; using NewHorizons.Components.Volumes;
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility; using NewHorizons.Utility;

View File

@ -1,4 +1,3 @@
using NewHorizons.Components;
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility; using NewHorizons.Utility;
@ -9,6 +8,8 @@ using NewHorizons.External.Modules.VariableSize;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
using NewHorizons.Components.ShipLog;
namespace NewHorizons.Builder.ShipLog namespace NewHorizons.Builder.ShipLog
{ {
public static class MapModeBuilder public static class MapModeBuilder

View File

@ -1,4 +1,3 @@
using NewHorizons.Components;
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using NewHorizons.Utility; using NewHorizons.Utility;
using OWML.Common; using OWML.Common;
@ -9,7 +8,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
using NHNotificationVolume = NewHorizons.Components.NotificationVolume; using NHNotificationVolume = NewHorizons.Components.Volumes.NotificationVolume;
namespace NewHorizons.Builder.Volumes namespace NewHorizons.Builder.Volumes
{ {

View File

@ -1,7 +1,7 @@
using NewHorizons.Builder.Body; using NewHorizons.Builder.Body;
using NewHorizons.Builder.ShipLog; using NewHorizons.Builder.ShipLog;
using NewHorizons.Builder.Volumes; using NewHorizons.Builder.Volumes;
using NewHorizons.Components; using NewHorizons.Components.Volumes;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;
using OWML.Common; using OWML.Common;
using System; using System;
@ -61,7 +61,7 @@ namespace NewHorizons.Builder.Volumes
{ {
foreach (var interferenceVolume in config.Volumes.interferenceVolumes) foreach (var interferenceVolume in config.Volumes.interferenceVolumes)
{ {
VolumeBuilder.Make<Components.InterferenceVolume>(go, sector, interferenceVolume); VolumeBuilder.Make<Components.Volumes.InterferenceVolume>(go, sector, interferenceVolume);
} }
} }
if (config.Volumes.reverbVolumes != null) if (config.Volumes.reverbVolumes != null)

View File

@ -1,7 +1,7 @@
using NewHorizons.Builder.General; using NewHorizons.Builder.General;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Fixers
{ {
public class MapSatelliteOrbitFix : MonoBehaviour public class MapSatelliteOrbitFix : MonoBehaviour
{ {

View File

@ -7,7 +7,7 @@ using UnityEngine;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.Components namespace NewHorizons.Components.Quantum
{ {
public class NHMultiStateQuantumObject : MultiStateQuantumObject public class NHMultiStateQuantumObject : MultiStateQuantumObject
{ {
@ -28,7 +28,7 @@ namespace NewHorizons.Components
} }
else if (_sequential) else if (_sequential)
{ {
_stateIndex = (_reverse ? (_stateIndex - 1) : (_stateIndex + 1)); _stateIndex = _reverse ? _stateIndex - 1 : _stateIndex + 1;
if (_loop) if (_loop)
{ {
if (_stateIndex < 0) if (_stateIndex < 0)
@ -105,11 +105,11 @@ namespace NewHorizons.Components
var isVisible = var isVisible =
isPlayerEntangled isPlayerEntangled
? illumination ? illumination
: ( :
illumination illumination
? visibility ? visibility
: playerInside : playerInside
); ;
return !isVisible; return !isVisible;
} }

View File

@ -9,7 +9,7 @@ using System.Linq;
using UnityEngine; using UnityEngine;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;
namespace NewHorizons.Components namespace NewHorizons.Components.Quantum
{ {
public class QuantumPlanet : QuantumObject public class QuantumPlanet : QuantumObject
{ {
@ -162,9 +162,9 @@ namespace NewHorizons.Components
private void OnPlayerBlink() private void OnPlayerBlink()
{ {
if (base.IsVisible()) if (IsVisible())
{ {
base.Collapse(true); Collapse(true);
} }
} }

View File

@ -1,3 +1,4 @@
using NewHorizons.Components.Volumes;
using NewHorizons.External.Modules.VariableSize; using NewHorizons.External.Modules.VariableSize;
using NewHorizons.Utility; using NewHorizons.Utility;
using UnityEngine; using UnityEngine;

View File

@ -1,8 +1,8 @@
using NewHorizons.External.Modules; using NewHorizons.External.Modules;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.Components namespace NewHorizons.Components.ShipLog
{ {
public class ShipLogDetail : MonoBehaviour public class ShipLogDetail : MonoBehaviour
{ {
@ -51,7 +51,7 @@ namespace NewHorizons.Components
private void SetGreyScale(bool greyScale) private void SetGreyScale(bool greyScale)
{ {
_revealedImage.material = (greyScale ? _greyScaleMaterial : null); _revealedImage.material = greyScale ? _greyScaleMaterial : null;
} }
} }
} }

View File

@ -6,7 +6,7 @@ using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.Components namespace NewHorizons.Components.ShipLog
{ {
public class ShipLogStarChartMode : ShipLogMode public class ShipLogStarChartMode : ShipLogMode
{ {
@ -41,7 +41,7 @@ namespace NewHorizons.Components
public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource) public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource)
{ {
root = base.transform.Find("ScaleRoot/PanRoot"); root = transform.Find("ScaleRoot/PanRoot");
_oneShotSource = oneShotSource; _oneShotSource = oneShotSource;
_centerPromptList = centerPromptList; _centerPromptList = centerPromptList;
@ -101,11 +101,11 @@ namespace NewHorizons.Components
if (_cardTemplate == null) if (_cardTemplate == null)
{ {
var panRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot"); var panRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot");
_cardTemplate = GameObject.Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>().gameObject); _cardTemplate = Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>().gameObject);
_cardTemplate.SetActive(false); _cardTemplate.SetActive(false);
} }
var newCard = GameObject.Instantiate(_cardTemplate, parent); var newCard = Instantiate(_cardTemplate, parent);
var textComponent = newCard.transform.Find("EntryCardRoot/NameBackground/Name").GetComponent<Text>(); var textComponent = newCard.transform.Find("EntryCardRoot/NameBackground/Name").GetComponent<Text>();
var name = UniqueIDToName(uniqueID); var name = UniqueIDToName(uniqueID);
@ -164,7 +164,7 @@ namespace NewHorizons.Components
public override void EnterMode(string entryID = "", List<ShipLogFact> revealQueue = null) public override void EnterMode(string entryID = "", List<ShipLogFact> revealQueue = null)
{ {
base.gameObject.SetActive(true); gameObject.SetActive(true);
Locator.GetPromptManager().AddScreenPrompt(_detectiveModePrompt, _upperRightPromptList, TextAnchor.MiddleRight, -1, true); Locator.GetPromptManager().AddScreenPrompt(_detectiveModePrompt, _upperRightPromptList, TextAnchor.MiddleRight, -1, true);
Locator.GetPromptManager().AddScreenPrompt(_targetSystemPrompt, _centerPromptList, TextAnchor.MiddleCenter, -1, true); Locator.GetPromptManager().AddScreenPrompt(_targetSystemPrompt, _centerPromptList, TextAnchor.MiddleCenter, -1, true);
@ -172,7 +172,7 @@ namespace NewHorizons.Components
public override void ExitMode() public override void ExitMode()
{ {
base.gameObject.SetActive(false); gameObject.SetActive(false);
Locator.GetPromptManager().RemoveScreenPrompt(_detectiveModePrompt); Locator.GetPromptManager().RemoveScreenPrompt(_detectiveModePrompt);
Locator.GetPromptManager().RemoveScreenPrompt(_targetSystemPrompt); Locator.GetPromptManager().RemoveScreenPrompt(_targetSystemPrompt);
@ -223,7 +223,7 @@ namespace NewHorizons.Components
if (oldIndex != _cardIndex) if (oldIndex != _cardIndex)
{ {
_oneShotSource.PlayOneShot(global::AudioType.ShipLogMoveBetweenPlanets, 1f); _oneShotSource.PlayOneShot(AudioType.ShipLogMoveBetweenPlanets, 1f);
_startPanTime = Time.unscaledTime; _startPanTime = Time.unscaledTime;
_startPanPos = _panRootPos; _startPanPos = _panRootPos;
_panDuration = 0.25f; _panDuration = 0.25f;
@ -297,7 +297,7 @@ namespace NewHorizons.Components
{ {
if (_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData); if (_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData);
if (_target == null) return; if (_target == null) return;
if (playSound) _oneShotSource.PlayOneShot(global::AudioType.ShipLogMarkLocation, 1f); if (playSound) _oneShotSource.PlayOneShot(AudioType.ShipLogMarkLocation, 1f);
_target.SetMarkedOnHUD(false); _target.SetMarkedOnHUD(false);
_target = null; _target = null;
} }

View File

@ -1,5 +1,6 @@
using NewHorizons.Builder.Body; using NewHorizons.Builder.Body;
using NewHorizons.Components.Orbital; using NewHorizons.Components.Orbital;
using NewHorizons.Components.Stars;
using NewHorizons.External.Modules.VariableSize; using NewHorizons.External.Modules.VariableSize;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility; using NewHorizons.Utility;
@ -286,9 +287,9 @@ namespace NewHorizons.Components.SizeControllers
{ {
_stellarRemnant.SetActive(true); _stellarRemnant.SetActive(true);
var remnantStarController = _stellarRemnant.GetComponentInChildren<StarController>(); var remnantStarController = _stellarRemnant.GetComponentInChildren<StarController>();
if (remnantStarController != null) StarLightController.AddStar(remnantStarController); if (remnantStarController != null) SunLightEffectsController.AddStar(remnantStarController);
var remnantStarLight = _stellarRemnant.FindChild("SunLight"); var remnantStarLight = _stellarRemnant.FindChild("SunLight");
if (remnantStarLight != null) StarLightController.AddStarLight(remnantStarLight.GetComponent<Light>()); if (remnantStarLight != null) SunLightEffectsController.AddStarLight(remnantStarLight.GetComponent<Light>());
} }
if (Time.time > _supernovaStartTime + supernovaTime) if (Time.time > _supernovaStartTime + supernovaTime)
@ -301,8 +302,8 @@ namespace NewHorizons.Components.SizeControllers
private void DisableStar(bool start = false) private void DisableStar(bool start = false)
{ {
if (controller != null) StarLightController.RemoveStar(controller); if (controller != null) SunLightEffectsController.RemoveStar(controller);
if (!isProxy) StarLightController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent<Light>()); if (!isProxy) SunLightEffectsController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent<Light>());
if (_stellarRemnant != null) if (_stellarRemnant != null)
{ {

View File

@ -1,5 +1,5 @@
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Stars
{ {
public class StarController : MonoBehaviour public class StarController : MonoBehaviour
{ {

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Stars
{ {
public class StarDestructionVolume : DestructionVolume public class StarDestructionVolume : DestructionVolume
{ {

View File

@ -1,6 +1,6 @@
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Stars
{ {
public class StarFluidVolume : SimpleFluidVolume public class StarFluidVolume : SimpleFluidVolume
{ {

View File

@ -2,29 +2,31 @@ using NewHorizons.Builder.Atmosphere;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.Components namespace NewHorizons.Components.Stars
{ {
[RequireComponent(typeof(SunLightController))] [RequireComponent(typeof(SunLightController))]
[RequireComponent(typeof(SunLightParamUpdater))] [RequireComponent(typeof(SunLightParamUpdater))]
public class StarLightController : MonoBehaviour public class SunLightEffectsController : MonoBehaviour
{ {
private static readonly int SunIntensity = Shader.PropertyToID("_SunIntensity"); private static readonly int SunIntensity = Shader.PropertyToID("_SunIntensity");
private static readonly float hearthSunDistanceSqr = 8593 * 8593; private static readonly float hearthSunDistanceSqr = 8593 * 8593;
public static StarLightController Instance { get; private set; } public static SunLightEffectsController Instance { get; private set; }
private readonly List<StarController> _stars = new();
private readonly List<Light> _lights = new();
private List<StarController> _stars = new List<StarController>();
private List<Light> _lights = new List<Light>();
private StarController _activeStar; private StarController _activeStar;
private SunLightController _sunLightController; private SunLightController _sunLightController;
private SunLightParamUpdater _sunLightParamUpdater; private SunLightParamUpdater _sunLightParamUpdater;
public void Awake() public void Awake()
{ {
Instance = this; Instance = this;
_sunLightController = GetComponent<SunLightController>(); _sunLightController = GetComponent<SunLightController>();
_sunLightController.enabled = true; _sunLightController.enabled = true;
_sunLightParamUpdater = GetComponent<SunLightParamUpdater>(); _sunLightParamUpdater = GetComponent<SunLightParamUpdater>();
_sunLightParamUpdater._sunLightController = _sunLightController; _sunLightParamUpdater._sunLightController = _sunLightController;
} }
@ -69,21 +71,61 @@ namespace NewHorizons.Components
} }
public void Update() public void Update()
{
// Player is always at 0,0,0 more or less so if they arent using the map camera then wtv
var origin = Vector3.zero;
if (PlayerState.InMapView())
{
origin = Locator.GetActiveCamera().transform.position;
// Keep all star lights on in map
foreach (var light in _lights)
{
light.enabled = true;
}
}
else
{
// Outside map, only show lights within 50km range or light.range
// For some reason outside of the actual range of the lights they still show reflection effects on water and glass
foreach (var light in _lights)
{
// Minimum 50km range so it's not badly noticeable for dim stars
if ((light.transform.position - origin).sqrMagnitude <= Mathf.Max(light.range * light.range, 2500000000))
{
light.enabled = true;
}
else
{
light.enabled = false;
}
}
}
if (_stars.Count > 0)
{ {
if (_activeStar == null || !_activeStar.gameObject.activeInHierarchy) if (_activeStar == null || !_activeStar.gameObject.activeInHierarchy)
{ {
if (_stars.Contains(_activeStar)) _stars.Remove(_activeStar); if (_stars.Contains(_activeStar))
if (_stars.Count > 0) ChangeActiveStar(_stars[0]); {
else gameObject.SetActive(false); _stars.Remove(_activeStar);
}
if (_stars.Count > 0)
{
ChangeActiveStar(_stars[0]);
}
else
{
foreach (var (_, material) in AtmosphereBuilder.Skys) foreach (var (_, material) in AtmosphereBuilder.Skys)
{ {
material.SetFloat(SunIntensity, 0); material.SetFloat(SunIntensity, 0);
} }
return;
} }
}
else
{
// Update atmo shaders // Update atmo shaders
foreach (var (planet, material) in AtmosphereBuilder.Skys) foreach (var (planet, material) in AtmosphereBuilder.Skys)
{ {
@ -93,37 +135,18 @@ namespace NewHorizons.Components
material.SetFloat(SunIntensity, intensity); material.SetFloat(SunIntensity, intensity);
} }
// Player is always at 0,0,0 more or less so if they arent using the map camera then wtv
var origin = Vector3.zero;
foreach (var star in _stars) foreach (var star in _stars)
{ {
if (star == null) continue; if (star == null) continue;
if (!(star.gameObject.activeSelf && star.gameObject.activeInHierarchy)) continue; if (!(star.gameObject.activeSelf && star.gameObject.activeInHierarchy)) continue;
if (PlayerState.InMapView())
{
origin = Locator.GetActiveCamera().transform.position;
}
if (star.Intensity * (star.transform.position - origin).sqrMagnitude < _activeStar.Intensity * (_activeStar.transform.position - origin).sqrMagnitude) if (star.Intensity * (star.transform.position - origin).sqrMagnitude < _activeStar.Intensity * (_activeStar.transform.position - origin).sqrMagnitude)
{ {
ChangeActiveStar(star); ChangeActiveStar(star);
break; break;
} }
} }
if (PlayerState.InMapView())
{
foreach (var light in _lights) light.enabled = true;
return;
} }
foreach (var light in _lights)
{
// Minimum 50km range so it's not badly noticeable for dim stars
if ((light.transform.position - origin).sqrMagnitude <= Mathf.Max(light.range * light.range, 2500000000)) light.enabled = true;
else light.enabled = false;
} }
} }
@ -151,8 +174,8 @@ namespace NewHorizons.Components
_sunLightParamUpdater._propID_OWSunColorIntensity = Shader.PropertyToID("_OWSunColorIntensity"); _sunLightParamUpdater._propID_OWSunColorIntensity = Shader.PropertyToID("_OWSunColorIntensity");
// For the param thing to work it wants this to be on the star idk // For the param thing to work it wants this to be on the star idk
this.transform.parent = star.transform; transform.parent = star.transform;
this.transform.localPosition = Vector3.zero; transform.localPosition = Vector3.zero;
} }
} }
} }

View File

@ -1,7 +1,7 @@
using UnityEngine; using UnityEngine;
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
namespace NewHorizons.Components namespace NewHorizons.Components.Stars
{ {
[RequireComponent(typeof(OWAudioSource))] [RequireComponent(typeof(OWAudioSource))]
public class StarSurfaceAudioController : SectoredMonoBehaviour public class StarSurfaceAudioController : SectoredMonoBehaviour
@ -34,7 +34,7 @@ namespace NewHorizons.Components
public void Update() public void Update()
{ {
_fade = Mathf.MoveTowards(_fade, 1, Time.deltaTime * 0.2f); _fade = Mathf.MoveTowards(_fade, 1, Time.deltaTime * 0.2f);
float value = Mathf.Max(0.0f, Vector3.Distance(Locator.GetPlayerCamera().transform.position, this.transform.position) - (_starEvolutionController != null ? _starEvolutionController.CurrentScale : _size)); float value = Mathf.Max(0.0f, Vector3.Distance(Locator.GetPlayerCamera().transform.position, transform.position) - (_starEvolutionController != null ? _starEvolutionController.CurrentScale : _size));
float num = Mathf.InverseLerp(1600f, 100f, value); float num = Mathf.InverseLerp(1600f, 100f, value);
_audioSource.SetLocalVolume(num * num * _fade); _audioSource.SetLocalVolume(num * num * _fade);
} }

View File

@ -1,6 +1,6 @@
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Stars
{ {
public class StellarDeathController : MonoBehaviour public class StellarDeathController : MonoBehaviour
{ {
@ -71,7 +71,7 @@ namespace NewHorizons.Components
surface.transform.localScale = Vector3.one * _currentSupernovaScale; surface.transform.localScale = Vector3.one * _currentSupernovaScale;
_localSupernovaMat.color = Color.Lerp(Color.black, supernovaMaterial.color, supernovaAlpha.Evaluate(_time)); _localSupernovaMat.color = Color.Lerp(Color.black, supernovaMaterial.color, supernovaAlpha.Evaluate(_time));
float distanceToPlayer = PlayerState.InDreamWorld() ? 20000f : (Vector3.Distance(transform.position, Locator.GetPlayerCamera().transform.position) - GetSupernovaRadius()); float distanceToPlayer = PlayerState.InDreamWorld() ? 20000f : Vector3.Distance(transform.position, Locator.GetPlayerCamera().transform.position) - GetSupernovaRadius();
if (_isProxy) return; if (_isProxy) return;

View File

@ -1,6 +1,6 @@
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
[RequireComponent(typeof(OWTriggerVolume))] [RequireComponent(typeof(OWTriggerVolume))]
public abstract class BaseVolume : MonoBehaviour public abstract class BaseVolume : MonoBehaviour

View File

@ -1,6 +1,6 @@
using NewHorizons.OtherMods.AchievementsPlus.NH; using NewHorizons.OtherMods.AchievementsPlus.NH;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class BlackHoleDestructionVolume : DestructionVolume public class BlackHoleDestructionVolume : DestructionVolume
{ {
@ -15,7 +15,7 @@ namespace NewHorizons.Components
SurveyorProbe requiredComponent = probeBody.GetRequiredComponent<SurveyorProbe>(); SurveyorProbe requiredComponent = probeBody.GetRequiredComponent<SurveyorProbe>();
if (requiredComponent.IsLaunched()) if (requiredComponent.IsLaunched())
{ {
UnityEngine.Object.Destroy(requiredComponent.gameObject); Destroy(requiredComponent.gameObject);
ProbeLostAchievement.Earn(); ProbeLostAchievement.Earn();
} }
} }

View File

@ -1,4 +1,4 @@
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class ChangeStarSystemVolume : BlackHoleDestructionVolume public class ChangeStarSystemVolume : BlackHoleDestructionVolume
{ {

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class InterferenceVolume : BaseVolume public class InterferenceVolume : BaseVolume
{ {

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class MapRestrictionVolume : BaseVolume public class MapRestrictionVolume : BaseVolume
{ {

View File

@ -1,5 +1,5 @@
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class NHFluidVolume : RadialFluidVolume public class NHFluidVolume : RadialFluidVolume
{ {

View File

@ -1,4 +1,4 @@
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class NHInnerFogWarpVolume : InnerFogWarpVolume public class NHInnerFogWarpVolume : InnerFogWarpVolume
{ {

View File

@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class NotificationVolume : BaseVolume public class NotificationVolume : BaseVolume
{ {
@ -16,7 +16,7 @@ namespace NewHorizons.Components
public void SetPinned(bool pin) => _pin = pin; public void SetPinned(bool pin) => _pin = pin;
public void SetTarget(External.Modules.VolumesModule.NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse<NotificationTarget>(target.ToString(), NotificationTarget.All)); public void SetTarget(External.Modules.VolumesModule.NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse(target.ToString(), NotificationTarget.All));
public void SetTarget(NotificationTarget target) => _target = target; public void SetTarget(NotificationTarget target) => _target = target;

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Components namespace NewHorizons.Components.Volumes
{ {
public class RingFluidVolume : SimpleFluidVolume public class RingFluidVolume : SimpleFluidVolume
{ {

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace NewHorizons.Handlers namespace NewHorizons.Handlers
{ {
using InterferenceVolume = NewHorizons.Components.InterferenceVolume; using InterferenceVolume = Components.Volumes.InterferenceVolume;
public static class InterferenceHandler public static class InterferenceHandler
{ {

View File

@ -4,8 +4,9 @@ using NewHorizons.Builder.General;
using NewHorizons.Builder.Orbital; using NewHorizons.Builder.Orbital;
using NewHorizons.Builder.Props; using NewHorizons.Builder.Props;
using NewHorizons.Builder.Volumes; using NewHorizons.Builder.Volumes;
using NewHorizons.Components;
using NewHorizons.Components.Orbital; using NewHorizons.Components.Orbital;
using NewHorizons.Components.Quantum;
using NewHorizons.Components.Stars;
using NewHorizons.OtherMods.OWRichPresence; using NewHorizons.OtherMods.OWRichPresence;
using NewHorizons.Utility; using NewHorizons.Utility;
using System; using System;
@ -57,9 +58,9 @@ namespace NewHorizons.Handlers
GameObject.Destroy(starLightGO.GetComponent<Light>()); GameObject.Destroy(starLightGO.GetComponent<Light>());
starLightGO.name = "StarLightController"; starLightGO.name = "StarLightController";
starLightGO.AddComponent<StarLightController>(); starLightGO.AddComponent<SunLightEffectsController>();
StarLightController.AddStar(starController); SunLightEffectsController.AddStar(starController);
StarLightController.AddStarLight(starController.Light); SunLightEffectsController.AddStarLight(starController.Light);
starLightGO.SetActive(true); starLightGO.SetActive(true);
@ -499,10 +500,10 @@ namespace NewHorizons.Handlers
{ {
var (star, starController, starEvolutionController) = StarBuilder.Make(go, sector, body.Config.Star, body.Mod, body.Config.isStellarRemnant); var (star, starController, starEvolutionController) = StarBuilder.Make(go, sector, body.Config.Star, body.Mod, body.Config.isStellarRemnant);
if (starController != null) StarLightController.AddStar(starController); if (starController != null) SunLightEffectsController.AddStar(starController);
var starLight = star.FindChild("SunLight"); var starLight = star.FindChild("SunLight");
if (starLight != null) StarLightController.AddStarLight(starLight.GetComponent<Light>()); if (starLight != null) SunLightEffectsController.AddStarLight(starLight.GetComponent<Light>());
// If it has an evolution controller that means it will die -> we make a remnant (unless its a remnant) // If it has an evolution controller that means it will die -> we make a remnant (unless its a remnant)
if (starEvolutionController != null && !body.Config.isStellarRemnant) if (starEvolutionController != null && !body.Config.isStellarRemnant)

View File

@ -1,4 +1,4 @@
using NewHorizons.Components; using NewHorizons.Components.Stars;
using NewHorizons.Utility; using NewHorizons.Utility;
using OWML.Utils; using OWML.Utils;
using System; using System;
@ -117,8 +117,8 @@ namespace NewHorizons.Handlers
break; break;
case AstroObject.Name.Sun: case AstroObject.Name.Sun:
var starController = ao.gameObject.GetComponent<StarController>(); var starController = ao.gameObject.GetComponent<StarController>();
StarLightController.RemoveStar(starController); SunLightEffectsController.RemoveStar(starController);
StarLightController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>()); SunLightEffectsController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
GameObject.Destroy(starController); GameObject.Destroy(starController);
var audio = ao.GetComponentInChildren<SunSurfaceAudioController>(); var audio = ao.GetComponentInChildren<SunSurfaceAudioController>();

View File

@ -1,4 +1,4 @@
using NewHorizons.Components; using NewHorizons.Components.ShipLog;
using NewHorizons.Utility; using NewHorizons.Utility;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;

View File

@ -1,4 +1,4 @@
using NewHorizons.Components; using NewHorizons.Components.ShipLog;
using NewHorizons.Utility; using NewHorizons.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -3,6 +3,7 @@ using NewHorizons.Builder.Atmosphere;
using NewHorizons.Builder.Body; using NewHorizons.Builder.Body;
using NewHorizons.Builder.Props; using NewHorizons.Builder.Props;
using NewHorizons.Components; using NewHorizons.Components;
using NewHorizons.Components.Fixers;
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
using NewHorizons.External; using NewHorizons.External;
using NewHorizons.External.Configs; using NewHorizons.External.Configs;

View File

@ -1,4 +1,4 @@
using NewHorizons.Components; using NewHorizons.Components.ShipLog;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility; using NewHorizons.Utility;
using System; using System;

View File

@ -1,5 +1,5 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.Components; using NewHorizons.Components.Quantum;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -1,5 +1,5 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.Components; using NewHorizons.Components.Volumes;
using UnityEngine; using UnityEngine;
namespace NewHorizons.Patches namespace NewHorizons.Patches
{ {

View File

@ -1,7 +1,6 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.OtherMods.AchievementsPlus; using NewHorizons.OtherMods.AchievementsPlus;
using NewHorizons.Builder.ShipLog; using NewHorizons.Builder.ShipLog;
using NewHorizons.Components;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using NewHorizons.Utility; using NewHorizons.Utility;
using System; using System;
@ -10,6 +9,8 @@ using System.Linq;
using UnityEngine; using UnityEngine;
using Logger = NewHorizons.Utility.Logger; using Logger = NewHorizons.Utility.Logger;
using Object = UnityEngine.Object; using Object = UnityEngine.Object;
using NewHorizons.Components.ShipLog;
namespace NewHorizons.Patches namespace NewHorizons.Patches
{ {
[HarmonyPatch] [HarmonyPatch]