From 5a5ea46b05755a6debc7a7386c5b6459a7d0b082 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 15 Sep 2022 00:41:05 -0400 Subject: [PATCH] Categorized some stuff in components and fixed Trifids star thing maybe --- NewHorizons/Builder/Body/RingBuilder.cs | 1 + .../Builder/Body/SingularityBuilder.cs | 2 +- NewHorizons/Builder/Body/StarBuilder.cs | 2 +- NewHorizons/Builder/Body/WaterBuilder.cs | 2 +- NewHorizons/Builder/Props/QuantumBuilder.cs | 2 +- NewHorizons/Builder/Props/RaftBuilder.cs | 2 +- NewHorizons/Builder/ShipLog/MapModeBuilder.cs | 3 +- .../Volumes/NotificationVolumeBuilder.cs | 3 +- .../Builder/Volumes/VolumesBuildManager.cs | 4 +- .../{ => Fixers}/MapSatelliteOrbitFix.cs | 2 +- .../NHMultiStateQuantumObject.cs | 168 +++++++++--------- .../Components/{ => Quantum}/QuantumPlanet.cs | 6 +- .../Components/RingOpacityController.cs | 1 + .../Components/{ => ShipLog}/ShipLogDetail.cs | 6 +- .../{ => ShipLog}/ShipLogStarChartMode.cs | 16 +- .../StarEvolutionController.cs | 9 +- .../Components/{ => Stars}/StarController.cs | 4 +- .../{ => Stars}/StarDestructionVolume.cs | 2 +- .../Components/{ => Stars}/StarFluidVolume.cs | 2 +- .../{ => Stars}/StarLightController.cs | 131 ++++++++------ .../{ => Stars}/StarSurfaceAudioController.cs | 4 +- .../{ => Stars}/StellarDeathController.cs | 4 +- .../Components/{ => Volumes}/BaseVolume.cs | 2 +- .../BlackHoleDestructionVolume.cs | 4 +- .../{ => Volumes}/ChangeStarSystemVolume.cs | 2 +- .../{ => Volumes}/InterferenceVolume.cs | 2 +- .../{ => Volumes}/MapRestrictionVolume.cs | 2 +- .../Components/{ => Volumes}/NHFluidVolume.cs | 4 +- .../{ => Volumes}/NHInnerFogWarpVolume.cs | 2 +- .../{ => Volumes}/NotificationVolume.cs | 4 +- .../{ => Volumes}/RingFluidVolume.cs | 4 +- NewHorizons/Handlers/InterferenceHandler.cs | 2 +- NewHorizons/Handlers/PlanetCreationHandler.cs | 13 +- .../Handlers/PlanetDestructionHandler.cs | 6 +- NewHorizons/Handlers/StarChartHandler.cs | 2 +- .../Handlers/VesselCoordinatePromptHandler.cs | 2 +- NewHorizons/Main.cs | 1 + .../OWRichPresence/RichPresenceHandler.cs | 2 +- .../Patches/DestructionVolumePatches.cs | 2 +- NewHorizons/Patches/RaftPatches.cs | 2 +- NewHorizons/Patches/ShipLogPatches.cs | 3 +- 41 files changed, 233 insertions(+), 204 deletions(-) rename NewHorizons/Components/{ => Fixers}/MapSatelliteOrbitFix.cs (94%) rename NewHorizons/Components/{ => Quantum}/NHMultiStateQuantumObject.cs (54%) rename NewHorizons/Components/{ => Quantum}/QuantumPlanet.cs (98%) rename NewHorizons/Components/{ => ShipLog}/ShipLogDetail.cs (92%) rename NewHorizons/Components/{ => ShipLog}/ShipLogStarChartMode.cs (95%) rename NewHorizons/Components/{ => Stars}/StarController.cs (94%) rename NewHorizons/Components/{ => Stars}/StarDestructionVolume.cs (98%) rename NewHorizons/Components/{ => Stars}/StarFluidVolume.cs (96%) rename NewHorizons/Components/{ => Stars}/StarLightController.cs (55%) rename NewHorizons/Components/{ => Stars}/StarSurfaceAudioController.cs (88%) rename NewHorizons/Components/{ => Stars}/StellarDeathController.cs (96%) rename NewHorizons/Components/{ => Volumes}/BaseVolume.cs (95%) rename NewHorizons/Components/{ => Volumes}/BlackHoleDestructionVolume.cs (84%) rename NewHorizons/Components/{ => Volumes}/ChangeStarSystemVolume.cs (94%) rename NewHorizons/Components/{ => Volumes}/InterferenceVolume.cs (97%) rename NewHorizons/Components/{ => Volumes}/MapRestrictionVolume.cs (94%) rename NewHorizons/Components/{ => Volumes}/NHFluidVolume.cs (86%) rename NewHorizons/Components/{ => Volumes}/NHInnerFogWarpVolume.cs (83%) rename NewHorizons/Components/{ => Volumes}/NotificationVolume.cs (97%) rename NewHorizons/Components/{ => Volumes}/RingFluidVolume.cs (95%) diff --git a/NewHorizons/Builder/Body/RingBuilder.cs b/NewHorizons/Builder/Body/RingBuilder.cs index a0918a56..40d5953f 100644 --- a/NewHorizons/Builder/Body/RingBuilder.cs +++ b/NewHorizons/Builder/Body/RingBuilder.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using NewHorizons.External.Modules; using UnityEngine; using Logger = NewHorizons.Utility.Logger; +using NewHorizons.Components.Volumes; namespace NewHorizons.Builder.Body { diff --git a/NewHorizons/Builder/Body/SingularityBuilder.cs b/NewHorizons/Builder/Body/SingularityBuilder.cs index 4b9d4cdf..c9cd4d4d 100644 --- a/NewHorizons/Builder/Body/SingularityBuilder.cs +++ b/NewHorizons/Builder/Body/SingularityBuilder.cs @@ -1,4 +1,3 @@ -using NewHorizons.Components; using NewHorizons.External.Configs; using NewHorizons.Utility; using System; @@ -10,6 +9,7 @@ using System.Linq; using NewHorizons.Components.SizeControllers; using System.Drawing; using Color = UnityEngine.Color; +using NewHorizons.Components.Volumes; namespace NewHorizons.Builder.Body { diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index 99a6ee9f..eb9cac25 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -1,4 +1,3 @@ -using NewHorizons.Components; using NewHorizons.Components.SizeControllers; using NewHorizons.Utility; using OWML.Utils; @@ -9,6 +8,7 @@ using OWML.ModHelper; using OWML.Common; using UnityEngine.InputSystem.XR; using System.Linq; +using NewHorizons.Components.Stars; namespace NewHorizons.Builder.Body { diff --git a/NewHorizons/Builder/Body/WaterBuilder.cs b/NewHorizons/Builder/Body/WaterBuilder.cs index 5cbc5d70..a05dd63e 100644 --- a/NewHorizons/Builder/Body/WaterBuilder.cs +++ b/NewHorizons/Builder/Body/WaterBuilder.cs @@ -1,9 +1,9 @@ -using NewHorizons.Components; using NewHorizons.Components.SizeControllers; using NewHorizons.Utility; using UnityEngine; using NewHorizons.External.Modules.VariableSize; using Tessellation; +using NewHorizons.Components.Volumes; namespace NewHorizons.Builder.Body { diff --git a/NewHorizons/Builder/Props/QuantumBuilder.cs b/NewHorizons/Builder/Props/QuantumBuilder.cs index 16484b8f..3dd81c3b 100644 --- a/NewHorizons/Builder/Props/QuantumBuilder.cs +++ b/NewHorizons/Builder/Props/QuantumBuilder.cs @@ -1,5 +1,5 @@ using HarmonyLib; -using NewHorizons.Components; +using NewHorizons.Components.Quantum; using NewHorizons.External.Configs; using NewHorizons.External.Modules; using NewHorizons.Utility; diff --git a/NewHorizons/Builder/Props/RaftBuilder.cs b/NewHorizons/Builder/Props/RaftBuilder.cs index 6ad6277f..2e8c6a15 100644 --- a/NewHorizons/Builder/Props/RaftBuilder.cs +++ b/NewHorizons/Builder/Props/RaftBuilder.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components.Volumes; using NewHorizons.External.Modules; using NewHorizons.Handlers; using NewHorizons.Utility; diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index 12e55581..0eaf91aa 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -1,4 +1,3 @@ -using NewHorizons.Components; using NewHorizons.External.Modules; using NewHorizons.Handlers; using NewHorizons.Utility; @@ -9,6 +8,8 @@ using NewHorizons.External.Modules.VariableSize; using UnityEngine; using UnityEngine.UI; using Logger = NewHorizons.Utility.Logger; +using NewHorizons.Components.ShipLog; + namespace NewHorizons.Builder.ShipLog { public static class MapModeBuilder diff --git a/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs b/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs index 13386e79..dab95143 100644 --- a/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs @@ -1,4 +1,3 @@ -using NewHorizons.Components; using NewHorizons.External.Modules; using NewHorizons.Utility; using OWML.Common; @@ -9,7 +8,7 @@ using System.Text; using System.Threading.Tasks; using UnityEngine; using Logger = NewHorizons.Utility.Logger; -using NHNotificationVolume = NewHorizons.Components.NotificationVolume; +using NHNotificationVolume = NewHorizons.Components.Volumes.NotificationVolume; namespace NewHorizons.Builder.Volumes { diff --git a/NewHorizons/Builder/Volumes/VolumesBuildManager.cs b/NewHorizons/Builder/Volumes/VolumesBuildManager.cs index 9e9a9c36..9b13db4f 100644 --- a/NewHorizons/Builder/Volumes/VolumesBuildManager.cs +++ b/NewHorizons/Builder/Volumes/VolumesBuildManager.cs @@ -1,7 +1,7 @@ using NewHorizons.Builder.Body; using NewHorizons.Builder.ShipLog; using NewHorizons.Builder.Volumes; -using NewHorizons.Components; +using NewHorizons.Components.Volumes; using NewHorizons.External.Configs; using OWML.Common; using System; @@ -61,7 +61,7 @@ namespace NewHorizons.Builder.Volumes { foreach (var interferenceVolume in config.Volumes.interferenceVolumes) { - VolumeBuilder.Make(go, sector, interferenceVolume); + VolumeBuilder.Make(go, sector, interferenceVolume); } } if (config.Volumes.reverbVolumes != null) diff --git a/NewHorizons/Components/MapSatelliteOrbitFix.cs b/NewHorizons/Components/Fixers/MapSatelliteOrbitFix.cs similarity index 94% rename from NewHorizons/Components/MapSatelliteOrbitFix.cs rename to NewHorizons/Components/Fixers/MapSatelliteOrbitFix.cs index 1e8e0778..4b1a9b30 100644 --- a/NewHorizons/Components/MapSatelliteOrbitFix.cs +++ b/NewHorizons/Components/Fixers/MapSatelliteOrbitFix.cs @@ -1,7 +1,7 @@ using NewHorizons.Builder.General; using NewHorizons.External.Configs; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Fixers { public class MapSatelliteOrbitFix : MonoBehaviour { diff --git a/NewHorizons/Components/NHMultiStateQuantumObject.cs b/NewHorizons/Components/Quantum/NHMultiStateQuantumObject.cs similarity index 54% rename from NewHorizons/Components/NHMultiStateQuantumObject.cs rename to NewHorizons/Components/Quantum/NHMultiStateQuantumObject.cs index 6c73cef5..4abd57b1 100644 --- a/NewHorizons/Components/NHMultiStateQuantumObject.cs +++ b/NewHorizons/Components/Quantum/NHMultiStateQuantumObject.cs @@ -7,60 +7,60 @@ using UnityEngine; using Logger = NewHorizons.Utility.Logger; -namespace NewHorizons.Components +namespace NewHorizons.Components.Quantum { public class NHMultiStateQuantumObject : MultiStateQuantumObject { - - public override bool ChangeQuantumState(bool skipInstantVisibilityCheck) - { - for (int i = 0; i < _prerequisiteObjects.Length; i++) - { - if (!_prerequisiteObjects[i].HasCollapsed()) - { - return false; - } - } - int stateIndex = _stateIndex; - if (_stateIndex == -1 && _initialState != -1) - { - _stateIndex = _initialState; - } - else if (_sequential) - { - _stateIndex = (_reverse ? (_stateIndex - 1) : (_stateIndex + 1)); - if (_loop) - { - if (_stateIndex < 0) - { - _stateIndex = _states.Length - 1; - } - else if (_stateIndex > _states.Length - 1) - { - _stateIndex = 0; - } - } - else - { - _stateIndex = Mathf.Clamp(_stateIndex, 0, _states.Length - 1); - } - } - else - { + + public override bool ChangeQuantumState(bool skipInstantVisibilityCheck) + { + for (int i = 0; i < _prerequisiteObjects.Length; i++) + { + if (!_prerequisiteObjects[i].HasCollapsed()) + { + return false; + } + } + int stateIndex = _stateIndex; + if (_stateIndex == -1 && _initialState != -1) + { + _stateIndex = _initialState; + } + else if (_sequential) + { + _stateIndex = _reverse ? _stateIndex - 1 : _stateIndex + 1; + if (_loop) + { + if (_stateIndex < 0) + { + _stateIndex = _states.Length - 1; + } + else if (_stateIndex > _states.Length - 1) + { + _stateIndex = 0; + } + } + else + { + _stateIndex = Mathf.Clamp(_stateIndex, 0, _states.Length - 1); + } + } + else + { // TODO: perform this roll for number of states, each time adding the selected state to the end of a list and removing it from the source list // this gets us a randomly ordered list that respects states' probability // then we can sequentially attempt collapsing to them, checking at each state whether the new state is invalid due to the player being able to see it, according to this: // // if (!((!IsPlayerEntangled()) ? (CheckIllumination() ? CheckVisibilityInstantly() : CheckPointInside(Locator.GetPlayerCamera().transform.position)) : CheckIllumination())) - // { - // return true; // this is a valid state - // } + // { + // return true; // this is a valid state + // } // List indices = new List(); for (var i = 0; i < _states.Length; i++) if (i != stateIndex) indices.Add(i); - + var previousIndex = stateIndex; do @@ -69,31 +69,31 @@ namespace NewHorizons.Components _stateIndex = RollState(stateIndex, indices); if (previousIndex >= 0 && previousIndex < _states.Length) _states[previousIndex].SetVisible(visible: false); _states[_stateIndex].SetVisible(visible: true); - + Logger.LogVerbose($"MultiStateQuantumObject - Trying to change state {_stateIndex}"); indices.Remove(_stateIndex); } while (!CurrentStateIsValid() && indices.Count > 0); - } + } var stateIndexIsValid = stateIndex >= 0 && stateIndex < _states.Length; - if (stateIndexIsValid) _states[stateIndex].SetVisible(visible: false); + if (stateIndexIsValid) _states[stateIndex].SetVisible(visible: false); - _states[_stateIndex].SetVisible(visible: true); + _states[_stateIndex].SetVisible(visible: true); if (!CurrentStateIsValid() && stateIndexIsValid) { - _states[_stateIndex].SetVisible(visible: false); - _states[stateIndex] .SetVisible(visible: true); - _stateIndex = stateIndex; + _states[_stateIndex].SetVisible(visible: false); + _states[stateIndex].SetVisible(visible: true); + _stateIndex = stateIndex; return false; } - if (_sequential && !_loop && _stateIndex == _states.Length - 1) - { - SetActivation(active: false); - } - return true; - } + if (_sequential && !_loop && _stateIndex == _states.Length - 1) + { + SetActivation(active: false); + } + return true; + } public bool CurrentStateIsValid() { @@ -102,20 +102,20 @@ namespace NewHorizons.Components var visibility = CheckVisibilityInstantly(); var playerInside = CheckPointInside(Locator.GetPlayerCamera().transform.position); - var isVisible = + var isVisible = isPlayerEntangled ? illumination - : ( - illumination + : + illumination ? visibility : playerInside - ); + ; return !isVisible; } public int RollState(int excludeIndex, List indices) - { + { var stateIndex = excludeIndex; // this function constructs a sort of segmented range: @@ -132,32 +132,32 @@ namespace NewHorizons.Components // // the second for looop uses num3 and num4 to figure out which segment num2 landed in - int num = 0; - foreach (int j in indices) - { - if (j != stateIndex) - { - _probabilities[j] = _states[j].GetProbability(); - num += _probabilities[j]; - } - } - int num2 = UnityEngine.Random.Range(0, num); - int num3 = 0; - int num4 = 0; - foreach (int k in indices) - { - if (k != stateIndex) - { - num3 = num4; - num4 += _probabilities[k]; - if (_probabilities[k] > 0 && num2 >= num3 && num2 < num4) - { - return k; - } - } - } + int num = 0; + foreach (int j in indices) + { + if (j != stateIndex) + { + _probabilities[j] = _states[j].GetProbability(); + num += _probabilities[j]; + } + } + int num2 = UnityEngine.Random.Range(0, num); + int num3 = 0; + int num4 = 0; + foreach (int k in indices) + { + if (k != stateIndex) + { + num3 = num4; + num4 += _probabilities[k]; + if (_probabilities[k] > 0 && num2 >= num3 && num2 < num4) + { + return k; + } + } + } - return indices[indices.Count-1]; + return indices[indices.Count - 1]; } } } diff --git a/NewHorizons/Components/QuantumPlanet.cs b/NewHorizons/Components/Quantum/QuantumPlanet.cs similarity index 98% rename from NewHorizons/Components/QuantumPlanet.cs rename to NewHorizons/Components/Quantum/QuantumPlanet.cs index 2b853b76..568a364b 100644 --- a/NewHorizons/Components/QuantumPlanet.cs +++ b/NewHorizons/Components/Quantum/QuantumPlanet.cs @@ -9,7 +9,7 @@ using System.Linq; using UnityEngine; using Logger = NewHorizons.Utility.Logger; using Random = UnityEngine.Random; -namespace NewHorizons.Components +namespace NewHorizons.Components.Quantum { public class QuantumPlanet : QuantumObject { @@ -162,9 +162,9 @@ namespace NewHorizons.Components private void OnPlayerBlink() { - if (base.IsVisible()) + if (IsVisible()) { - base.Collapse(true); + Collapse(true); } } diff --git a/NewHorizons/Components/RingOpacityController.cs b/NewHorizons/Components/RingOpacityController.cs index fde75452..df707a33 100644 --- a/NewHorizons/Components/RingOpacityController.cs +++ b/NewHorizons/Components/RingOpacityController.cs @@ -1,3 +1,4 @@ +using NewHorizons.Components.Volumes; using NewHorizons.External.Modules.VariableSize; using NewHorizons.Utility; using UnityEngine; diff --git a/NewHorizons/Components/ShipLogDetail.cs b/NewHorizons/Components/ShipLog/ShipLogDetail.cs similarity index 92% rename from NewHorizons/Components/ShipLogDetail.cs rename to NewHorizons/Components/ShipLog/ShipLogDetail.cs index a2ce809d..3852ff88 100644 --- a/NewHorizons/Components/ShipLogDetail.cs +++ b/NewHorizons/Components/ShipLog/ShipLogDetail.cs @@ -1,8 +1,8 @@ -using NewHorizons.External.Modules; +using NewHorizons.External.Modules; using UnityEngine; using UnityEngine.UI; using Logger = NewHorizons.Utility.Logger; -namespace NewHorizons.Components +namespace NewHorizons.Components.ShipLog { public class ShipLogDetail : MonoBehaviour { @@ -51,7 +51,7 @@ namespace NewHorizons.Components private void SetGreyScale(bool greyScale) { - _revealedImage.material = (greyScale ? _greyScaleMaterial : null); + _revealedImage.material = greyScale ? _greyScaleMaterial : null; } } } \ No newline at end of file diff --git a/NewHorizons/Components/ShipLogStarChartMode.cs b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs similarity index 95% rename from NewHorizons/Components/ShipLogStarChartMode.cs rename to NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs index a5d9dad0..a7b972ed 100644 --- a/NewHorizons/Components/ShipLogStarChartMode.cs +++ b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs @@ -6,7 +6,7 @@ using System.Linq; using UnityEngine; using UnityEngine.UI; using Logger = NewHorizons.Utility.Logger; -namespace NewHorizons.Components +namespace NewHorizons.Components.ShipLog { public class ShipLogStarChartMode : ShipLogMode { @@ -41,7 +41,7 @@ namespace NewHorizons.Components public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource) { - root = base.transform.Find("ScaleRoot/PanRoot"); + root = transform.Find("ScaleRoot/PanRoot"); _oneShotSource = oneShotSource; _centerPromptList = centerPromptList; @@ -101,11 +101,11 @@ namespace NewHorizons.Components if (_cardTemplate == null) { var panRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot"); - _cardTemplate = GameObject.Instantiate(panRoot.GetComponentInChildren().gameObject); + _cardTemplate = Instantiate(panRoot.GetComponentInChildren().gameObject); _cardTemplate.SetActive(false); } - var newCard = GameObject.Instantiate(_cardTemplate, parent); + var newCard = Instantiate(_cardTemplate, parent); var textComponent = newCard.transform.Find("EntryCardRoot/NameBackground/Name").GetComponent(); var name = UniqueIDToName(uniqueID); @@ -164,7 +164,7 @@ namespace NewHorizons.Components public override void EnterMode(string entryID = "", List revealQueue = null) { - base.gameObject.SetActive(true); + gameObject.SetActive(true); Locator.GetPromptManager().AddScreenPrompt(_detectiveModePrompt, _upperRightPromptList, TextAnchor.MiddleRight, -1, true); Locator.GetPromptManager().AddScreenPrompt(_targetSystemPrompt, _centerPromptList, TextAnchor.MiddleCenter, -1, true); @@ -172,7 +172,7 @@ namespace NewHorizons.Components public override void ExitMode() { - base.gameObject.SetActive(false); + gameObject.SetActive(false); Locator.GetPromptManager().RemoveScreenPrompt(_detectiveModePrompt); Locator.GetPromptManager().RemoveScreenPrompt(_targetSystemPrompt); @@ -223,7 +223,7 @@ namespace NewHorizons.Components if (oldIndex != _cardIndex) { - _oneShotSource.PlayOneShot(global::AudioType.ShipLogMoveBetweenPlanets, 1f); + _oneShotSource.PlayOneShot(AudioType.ShipLogMoveBetweenPlanets, 1f); _startPanTime = Time.unscaledTime; _startPanPos = _panRootPos; _panDuration = 0.25f; @@ -297,7 +297,7 @@ namespace NewHorizons.Components { if (_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData); if (_target == null) return; - if (playSound) _oneShotSource.PlayOneShot(global::AudioType.ShipLogMarkLocation, 1f); + if (playSound) _oneShotSource.PlayOneShot(AudioType.ShipLogMarkLocation, 1f); _target.SetMarkedOnHUD(false); _target = null; } diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index ced3222a..4e27972b 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -1,5 +1,6 @@ using NewHorizons.Builder.Body; using NewHorizons.Components.Orbital; +using NewHorizons.Components.Stars; using NewHorizons.External.Modules.VariableSize; using NewHorizons.Handlers; using NewHorizons.Utility; @@ -286,9 +287,9 @@ namespace NewHorizons.Components.SizeControllers { _stellarRemnant.SetActive(true); var remnantStarController = _stellarRemnant.GetComponentInChildren(); - if (remnantStarController != null) StarLightController.AddStar(remnantStarController); + if (remnantStarController != null) SunLightEffectsController.AddStar(remnantStarController); var remnantStarLight = _stellarRemnant.FindChild("SunLight"); - if (remnantStarLight != null) StarLightController.AddStarLight(remnantStarLight.GetComponent()); + if (remnantStarLight != null) SunLightEffectsController.AddStarLight(remnantStarLight.GetComponent()); } if (Time.time > _supernovaStartTime + supernovaTime) @@ -301,8 +302,8 @@ namespace NewHorizons.Components.SizeControllers private void DisableStar(bool start = false) { - if (controller != null) StarLightController.RemoveStar(controller); - if (!isProxy) StarLightController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent()); + if (controller != null) SunLightEffectsController.RemoveStar(controller); + if (!isProxy) SunLightEffectsController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent()); if (_stellarRemnant != null) { diff --git a/NewHorizons/Components/StarController.cs b/NewHorizons/Components/Stars/StarController.cs similarity index 94% rename from NewHorizons/Components/StarController.cs rename to NewHorizons/Components/Stars/StarController.cs index 8f69f085..374d4437 100644 --- a/NewHorizons/Components/StarController.cs +++ b/NewHorizons/Components/Stars/StarController.cs @@ -1,5 +1,5 @@ -using UnityEngine; -namespace NewHorizons.Components +using UnityEngine; +namespace NewHorizons.Components.Stars { public class StarController : MonoBehaviour { diff --git a/NewHorizons/Components/StarDestructionVolume.cs b/NewHorizons/Components/Stars/StarDestructionVolume.cs similarity index 98% rename from NewHorizons/Components/StarDestructionVolume.cs rename to NewHorizons/Components/Stars/StarDestructionVolume.cs index e0068d24..5354821a 100644 --- a/NewHorizons/Components/StarDestructionVolume.cs +++ b/NewHorizons/Components/Stars/StarDestructionVolume.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Stars { public class StarDestructionVolume : DestructionVolume { diff --git a/NewHorizons/Components/StarFluidVolume.cs b/NewHorizons/Components/Stars/StarFluidVolume.cs similarity index 96% rename from NewHorizons/Components/StarFluidVolume.cs rename to NewHorizons/Components/Stars/StarFluidVolume.cs index 150d39f4..bd91f025 100644 --- a/NewHorizons/Components/StarFluidVolume.cs +++ b/NewHorizons/Components/Stars/StarFluidVolume.cs @@ -1,6 +1,6 @@ using NewHorizons.Components.SizeControllers; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Stars { public class StarFluidVolume : SimpleFluidVolume { diff --git a/NewHorizons/Components/StarLightController.cs b/NewHorizons/Components/Stars/StarLightController.cs similarity index 55% rename from NewHorizons/Components/StarLightController.cs rename to NewHorizons/Components/Stars/StarLightController.cs index a9e2b000..c3c7b944 100644 --- a/NewHorizons/Components/StarLightController.cs +++ b/NewHorizons/Components/Stars/StarLightController.cs @@ -2,29 +2,31 @@ using NewHorizons.Builder.Atmosphere; using System.Collections.Generic; using UnityEngine; using Logger = NewHorizons.Utility.Logger; -namespace NewHorizons.Components +namespace NewHorizons.Components.Stars { [RequireComponent(typeof(SunLightController))] [RequireComponent(typeof(SunLightParamUpdater))] - public class StarLightController : MonoBehaviour + public class SunLightEffectsController : MonoBehaviour { private static readonly int SunIntensity = Shader.PropertyToID("_SunIntensity"); private static readonly float hearthSunDistanceSqr = 8593 * 8593; - public static StarLightController Instance { get; private set; } + public static SunLightEffectsController Instance { get; private set; } + + private readonly List _stars = new(); + private readonly List _lights = new(); - private List _stars = new List(); - private List _lights = new List(); private StarController _activeStar; - private SunLightController _sunLightController; private SunLightParamUpdater _sunLightParamUpdater; public void Awake() { Instance = this; + _sunLightController = GetComponent(); _sunLightController.enabled = true; + _sunLightParamUpdater = GetComponent(); _sunLightParamUpdater._sunLightController = _sunLightController; } @@ -70,60 +72,81 @@ namespace NewHorizons.Components public void Update() { - if (_activeStar == null || !_activeStar.gameObject.activeInHierarchy) - { - if (_stars.Contains(_activeStar)) _stars.Remove(_activeStar); - if (_stars.Count > 0) ChangeActiveStar(_stars[0]); - else gameObject.SetActive(false); - - foreach (var (_, material) in AtmosphereBuilder.Skys) - { - material.SetFloat(SunIntensity, 0); - } - - return; - } - - // Update atmo shaders - foreach (var (planet, material) in AtmosphereBuilder.Skys) - { - var sqrDist = (planet.transform.position - _activeStar.transform.position).sqrMagnitude; - var intensity = Mathf.Min(_activeStar.Intensity / (sqrDist / hearthSunDistanceSqr), 1f); - - 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) - { - if (star == null) 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) - { - ChangeActiveStar(star); - break; - } - } - if (PlayerState.InMapView()) { - foreach (var light in _lights) light.enabled = true; - return; + 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; + } + } } - foreach (var light in _lights) + if (_stars.Count > 0) { - // 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 (_activeStar == null || !_activeStar.gameObject.activeInHierarchy) + { + if (_stars.Contains(_activeStar)) + { + _stars.Remove(_activeStar); + } + + if (_stars.Count > 0) + { + ChangeActiveStar(_stars[0]); + } + else + { + foreach (var (_, material) in AtmosphereBuilder.Skys) + { + material.SetFloat(SunIntensity, 0); + } + } + } + else + { + // Update atmo shaders + foreach (var (planet, material) in AtmosphereBuilder.Skys) + { + var sqrDist = (planet.transform.position - _activeStar.transform.position).sqrMagnitude; + var intensity = Mathf.Min(_activeStar.Intensity / (sqrDist / hearthSunDistanceSqr), 1f); + + material.SetFloat(SunIntensity, intensity); + } + + foreach (var star in _stars) + { + if (star == null) continue; + if (!(star.gameObject.activeSelf && star.gameObject.activeInHierarchy)) continue; + + if (star.Intensity * (star.transform.position - origin).sqrMagnitude < _activeStar.Intensity * (_activeStar.transform.position - origin).sqrMagnitude) + { + ChangeActiveStar(star); + break; + } + } + } } } @@ -151,8 +174,8 @@ namespace NewHorizons.Components _sunLightParamUpdater._propID_OWSunColorIntensity = Shader.PropertyToID("_OWSunColorIntensity"); // For the param thing to work it wants this to be on the star idk - this.transform.parent = star.transform; - this.transform.localPosition = Vector3.zero; + transform.parent = star.transform; + transform.localPosition = Vector3.zero; } } } diff --git a/NewHorizons/Components/StarSurfaceAudioController.cs b/NewHorizons/Components/Stars/StarSurfaceAudioController.cs similarity index 88% rename from NewHorizons/Components/StarSurfaceAudioController.cs rename to NewHorizons/Components/Stars/StarSurfaceAudioController.cs index aab8d3ce..71bdf525 100644 --- a/NewHorizons/Components/StarSurfaceAudioController.cs +++ b/NewHorizons/Components/Stars/StarSurfaceAudioController.cs @@ -1,7 +1,7 @@ using UnityEngine; using NewHorizons.Components.SizeControllers; -namespace NewHorizons.Components +namespace NewHorizons.Components.Stars { [RequireComponent(typeof(OWAudioSource))] public class StarSurfaceAudioController : SectoredMonoBehaviour @@ -34,7 +34,7 @@ namespace NewHorizons.Components public void Update() { _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); _audioSource.SetLocalVolume(num * num * _fade); } diff --git a/NewHorizons/Components/StellarDeathController.cs b/NewHorizons/Components/Stars/StellarDeathController.cs similarity index 96% rename from NewHorizons/Components/StellarDeathController.cs rename to NewHorizons/Components/Stars/StellarDeathController.cs index fe5dadb3..a07fddeb 100644 --- a/NewHorizons/Components/StellarDeathController.cs +++ b/NewHorizons/Components/Stars/StellarDeathController.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Stars { public class StellarDeathController : MonoBehaviour { @@ -71,7 +71,7 @@ namespace NewHorizons.Components surface.transform.localScale = Vector3.one * _currentSupernovaScale; _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; diff --git a/NewHorizons/Components/BaseVolume.cs b/NewHorizons/Components/Volumes/BaseVolume.cs similarity index 95% rename from NewHorizons/Components/BaseVolume.cs rename to NewHorizons/Components/Volumes/BaseVolume.cs index 6ddccada..f313310c 100644 --- a/NewHorizons/Components/BaseVolume.cs +++ b/NewHorizons/Components/Volumes/BaseVolume.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { [RequireComponent(typeof(OWTriggerVolume))] public abstract class BaseVolume : MonoBehaviour diff --git a/NewHorizons/Components/BlackHoleDestructionVolume.cs b/NewHorizons/Components/Volumes/BlackHoleDestructionVolume.cs similarity index 84% rename from NewHorizons/Components/BlackHoleDestructionVolume.cs rename to NewHorizons/Components/Volumes/BlackHoleDestructionVolume.cs index 145a0c5c..e5489760 100644 --- a/NewHorizons/Components/BlackHoleDestructionVolume.cs +++ b/NewHorizons/Components/Volumes/BlackHoleDestructionVolume.cs @@ -1,6 +1,6 @@ using NewHorizons.OtherMods.AchievementsPlus.NH; -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class BlackHoleDestructionVolume : DestructionVolume { @@ -15,7 +15,7 @@ namespace NewHorizons.Components SurveyorProbe requiredComponent = probeBody.GetRequiredComponent(); if (requiredComponent.IsLaunched()) { - UnityEngine.Object.Destroy(requiredComponent.gameObject); + Destroy(requiredComponent.gameObject); ProbeLostAchievement.Earn(); } } diff --git a/NewHorizons/Components/ChangeStarSystemVolume.cs b/NewHorizons/Components/Volumes/ChangeStarSystemVolume.cs similarity index 94% rename from NewHorizons/Components/ChangeStarSystemVolume.cs rename to NewHorizons/Components/Volumes/ChangeStarSystemVolume.cs index ea57c53f..bdf43aae 100644 --- a/NewHorizons/Components/ChangeStarSystemVolume.cs +++ b/NewHorizons/Components/Volumes/ChangeStarSystemVolume.cs @@ -1,4 +1,4 @@ -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class ChangeStarSystemVolume : BlackHoleDestructionVolume { diff --git a/NewHorizons/Components/InterferenceVolume.cs b/NewHorizons/Components/Volumes/InterferenceVolume.cs similarity index 97% rename from NewHorizons/Components/InterferenceVolume.cs rename to NewHorizons/Components/Volumes/InterferenceVolume.cs index 43cf34ac..acb3582f 100644 --- a/NewHorizons/Components/InterferenceVolume.cs +++ b/NewHorizons/Components/Volumes/InterferenceVolume.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class InterferenceVolume : BaseVolume { diff --git a/NewHorizons/Components/MapRestrictionVolume.cs b/NewHorizons/Components/Volumes/MapRestrictionVolume.cs similarity index 94% rename from NewHorizons/Components/MapRestrictionVolume.cs rename to NewHorizons/Components/Volumes/MapRestrictionVolume.cs index 04442840..ee31a2a2 100644 --- a/NewHorizons/Components/MapRestrictionVolume.cs +++ b/NewHorizons/Components/Volumes/MapRestrictionVolume.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class MapRestrictionVolume : BaseVolume { diff --git a/NewHorizons/Components/NHFluidVolume.cs b/NewHorizons/Components/Volumes/NHFluidVolume.cs similarity index 86% rename from NewHorizons/Components/NHFluidVolume.cs rename to NewHorizons/Components/Volumes/NHFluidVolume.cs index 3b19f04d..3b5a4a00 100644 --- a/NewHorizons/Components/NHFluidVolume.cs +++ b/NewHorizons/Components/Volumes/NHFluidVolume.cs @@ -1,5 +1,5 @@ -using UnityEngine; -namespace NewHorizons.Components +using UnityEngine; +namespace NewHorizons.Components.Volumes { public class NHFluidVolume : RadialFluidVolume { diff --git a/NewHorizons/Components/NHInnerFogWarpVolume.cs b/NewHorizons/Components/Volumes/NHInnerFogWarpVolume.cs similarity index 83% rename from NewHorizons/Components/NHInnerFogWarpVolume.cs rename to NewHorizons/Components/Volumes/NHInnerFogWarpVolume.cs index 61c5e3ea..70d74979 100644 --- a/NewHorizons/Components/NHInnerFogWarpVolume.cs +++ b/NewHorizons/Components/Volumes/NHInnerFogWarpVolume.cs @@ -1,4 +1,4 @@ -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class NHInnerFogWarpVolume : InnerFogWarpVolume { diff --git a/NewHorizons/Components/NotificationVolume.cs b/NewHorizons/Components/Volumes/NotificationVolume.cs similarity index 97% rename from NewHorizons/Components/NotificationVolume.cs rename to NewHorizons/Components/Volumes/NotificationVolume.cs index 6fe7b746..70543449 100644 --- a/NewHorizons/Components/NotificationVolume.cs +++ b/NewHorizons/Components/Volumes/NotificationVolume.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class NotificationVolume : BaseVolume { @@ -16,7 +16,7 @@ namespace NewHorizons.Components public void SetPinned(bool pin) => _pin = pin; - public void SetTarget(External.Modules.VolumesModule.NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse(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; diff --git a/NewHorizons/Components/RingFluidVolume.cs b/NewHorizons/Components/Volumes/RingFluidVolume.cs similarity index 95% rename from NewHorizons/Components/RingFluidVolume.cs rename to NewHorizons/Components/Volumes/RingFluidVolume.cs index 83b377a7..66982bdc 100644 --- a/NewHorizons/Components/RingFluidVolume.cs +++ b/NewHorizons/Components/Volumes/RingFluidVolume.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace NewHorizons.Components +namespace NewHorizons.Components.Volumes { public class RingFluidVolume : SimpleFluidVolume { @@ -14,7 +14,7 @@ namespace NewHorizons.Components ForceDetector forceDetector = hitObj.GetComponent(); if (forceDetector != null && forceDetector._activeVolumes != null && forceDetector._activeVolumes.Count > 0 && forceDetector._activeVolumes.Where(activeVolume => activeVolume is ForceVolume).Select(activeVolume => activeVolume as ForceVolume).Any(activeVolume => activeVolume.GetAffectsAlignment(forceDetector._attachedBody))) return; - + fluidDetector.AddVolume(this); } diff --git a/NewHorizons/Handlers/InterferenceHandler.cs b/NewHorizons/Handlers/InterferenceHandler.cs index 97ff0046..73912289 100644 --- a/NewHorizons/Handlers/InterferenceHandler.cs +++ b/NewHorizons/Handlers/InterferenceHandler.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace NewHorizons.Handlers { - using InterferenceVolume = NewHorizons.Components.InterferenceVolume; + using InterferenceVolume = Components.Volumes.InterferenceVolume; public static class InterferenceHandler { diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 3c7c2d1d..ffc14739 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -4,8 +4,9 @@ using NewHorizons.Builder.General; using NewHorizons.Builder.Orbital; using NewHorizons.Builder.Props; using NewHorizons.Builder.Volumes; -using NewHorizons.Components; using NewHorizons.Components.Orbital; +using NewHorizons.Components.Quantum; +using NewHorizons.Components.Stars; using NewHorizons.OtherMods.OWRichPresence; using NewHorizons.Utility; using System; @@ -57,9 +58,9 @@ namespace NewHorizons.Handlers GameObject.Destroy(starLightGO.GetComponent()); starLightGO.name = "StarLightController"; - starLightGO.AddComponent(); - StarLightController.AddStar(starController); - StarLightController.AddStarLight(starController.Light); + starLightGO.AddComponent(); + SunLightEffectsController.AddStar(starController); + SunLightEffectsController.AddStarLight(starController.Light); 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); - if (starController != null) StarLightController.AddStar(starController); + if (starController != null) SunLightEffectsController.AddStar(starController); var starLight = star.FindChild("SunLight"); - if (starLight != null) StarLightController.AddStarLight(starLight.GetComponent()); + if (starLight != null) SunLightEffectsController.AddStarLight(starLight.GetComponent()); // 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) diff --git a/NewHorizons/Handlers/PlanetDestructionHandler.cs b/NewHorizons/Handlers/PlanetDestructionHandler.cs index 7f8fbf28..b25e6d00 100644 --- a/NewHorizons/Handlers/PlanetDestructionHandler.cs +++ b/NewHorizons/Handlers/PlanetDestructionHandler.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components.Stars; using NewHorizons.Utility; using OWML.Utils; using System; @@ -117,8 +117,8 @@ namespace NewHorizons.Handlers break; case AstroObject.Name.Sun: var starController = ao.gameObject.GetComponent(); - StarLightController.RemoveStar(starController); - StarLightController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent()); + SunLightEffectsController.RemoveStar(starController); + SunLightEffectsController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent()); GameObject.Destroy(starController); var audio = ao.GetComponentInChildren(); diff --git a/NewHorizons/Handlers/StarChartHandler.cs b/NewHorizons/Handlers/StarChartHandler.cs index 69e542c7..4ddec030 100644 --- a/NewHorizons/Handlers/StarChartHandler.cs +++ b/NewHorizons/Handlers/StarChartHandler.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components.ShipLog; using NewHorizons.Utility; using System.Collections.Generic; using UnityEngine; diff --git a/NewHorizons/Handlers/VesselCoordinatePromptHandler.cs b/NewHorizons/Handlers/VesselCoordinatePromptHandler.cs index f3578bda..f1e547c2 100644 --- a/NewHorizons/Handlers/VesselCoordinatePromptHandler.cs +++ b/NewHorizons/Handlers/VesselCoordinatePromptHandler.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components.ShipLog; using NewHorizons.Utility; using System; using System.Collections.Generic; diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 678852bb..20e4a877 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -3,6 +3,7 @@ using NewHorizons.Builder.Atmosphere; using NewHorizons.Builder.Body; using NewHorizons.Builder.Props; using NewHorizons.Components; +using NewHorizons.Components.Fixers; using NewHorizons.Components.SizeControllers; using NewHorizons.External; using NewHorizons.External.Configs; diff --git a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs index 7b94ca6c..727bc082 100644 --- a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs +++ b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components.ShipLog; using NewHorizons.Handlers; using NewHorizons.Utility; using System; diff --git a/NewHorizons/Patches/DestructionVolumePatches.cs b/NewHorizons/Patches/DestructionVolumePatches.cs index 23221daa..e29e3d02 100644 --- a/NewHorizons/Patches/DestructionVolumePatches.cs +++ b/NewHorizons/Patches/DestructionVolumePatches.cs @@ -1,5 +1,5 @@ using HarmonyLib; -using NewHorizons.Components; +using NewHorizons.Components.Quantum; using System; using System.Collections.Generic; using System.Linq; diff --git a/NewHorizons/Patches/RaftPatches.cs b/NewHorizons/Patches/RaftPatches.cs index b6f214ac..fea55497 100644 --- a/NewHorizons/Patches/RaftPatches.cs +++ b/NewHorizons/Patches/RaftPatches.cs @@ -1,5 +1,5 @@ using HarmonyLib; -using NewHorizons.Components; +using NewHorizons.Components.Volumes; using UnityEngine; namespace NewHorizons.Patches { diff --git a/NewHorizons/Patches/ShipLogPatches.cs b/NewHorizons/Patches/ShipLogPatches.cs index 96a89c01..52ce5a74 100644 --- a/NewHorizons/Patches/ShipLogPatches.cs +++ b/NewHorizons/Patches/ShipLogPatches.cs @@ -1,7 +1,6 @@ using HarmonyLib; using NewHorizons.OtherMods.AchievementsPlus; using NewHorizons.Builder.ShipLog; -using NewHorizons.Components; using NewHorizons.Handlers; using NewHorizons.Utility; using System; @@ -10,6 +9,8 @@ using System.Linq; using UnityEngine; using Logger = NewHorizons.Utility.Logger; using Object = UnityEngine.Object; +using NewHorizons.Components.ShipLog; + namespace NewHorizons.Patches { [HarmonyPatch]