diff --git a/NewHorizons/Builder/Body/WaterBuilder.cs b/NewHorizons/Builder/Body/WaterBuilder.cs index 3039d6dd..c525099e 100644 --- a/NewHorizons/Builder/Body/WaterBuilder.cs +++ b/NewHorizons/Builder/Body/WaterBuilder.cs @@ -5,6 +5,9 @@ using NewHorizons.External.Modules.VariableSize; using Tessellation; using NewHorizons.Utility.OWML; using NewHorizons.Utility.OuterWilds; +using NewHorizons.External.Configs; +using NewHorizons.Components.Volumes; +using System.Linq; namespace NewHorizons.Builder.Body { @@ -41,10 +44,12 @@ namespace NewHorizons.Builder.Body if (_oceanAmbientLight == null) _oceanAmbientLight = SearchUtilities.Find("Ocean_GD").GetComponent()._ambientLight.gameObject.InstantiateInactive().Rename("OceanAmbientLight").DontDestroyOnLoad(); } - public static RadialFluidVolume Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module) + public static RadialFluidVolume Make(GameObject planetGO, Sector sector, OWRigidbody rb, PlanetConfig config) { InitPrefabs(); + var module = config.Water; + var waterSize = module.size; GameObject waterGO = new GameObject("Water"); @@ -154,6 +159,11 @@ namespace NewHorizons.Builder.Body fogGO.GetComponent().material.SetFloat("_Radius2", 0); } + if (config.Cloak != null) + { + fluidVolume.gameObject.AddComponent().material = TSR.sharedMaterials.First(x => x.name == "Ocean_GD_Surface_mat"); + } + // TODO: fix ruleset making the sand bubble pop up waterGO.transform.position = planetGO.transform.position; diff --git a/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs b/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs index a2ffbab0..ae3aff08 100644 --- a/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs +++ b/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs @@ -61,15 +61,17 @@ namespace NewHorizons.Builder.Orbital var fade = isMoon; - /* - if (config.Base.IsSatellite) + if (config.Orbit.orbitLineFadeStartDistance >= 0) { - if (config.Orbit.Tint != null) color = new Color(0.4082f, 0.516f, 0.4469f, 1f); fade = true; - orbitLine._fadeEndDist = 5000; - orbitLine._fadeStartDist = 3000; + orbitLine._fadeStartDist = config.Orbit.orbitLineFadeStartDistance; + } + + if (config.Orbit.orbitLineFadeEndDistance >= 0) + { + fade = true; + orbitLine._fadeEndDist = config.Orbit.orbitLineFadeEndDistance; } - */ orbitLine._color = color; lineRenderer.endColor = new Color(color.r, color.g, color.b, 0f); diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index bbad4250..990b7c18 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -257,7 +257,9 @@ namespace NewHorizons.Builder.Props // Seed fog works differently, so it doesn't need to be fixed // (it's also located on a different child path, so the below FindChild calls wouldn't work) + // Default size is 70 var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere"); + fog.transform.localScale = Vector3.one * config.scale * 70f; var fogMaterial = fog.GetComponent().material; fogMaterial.SetFloat("_Radius", fogMaterial.GetFloat("_Radius") * config.scale); fogMaterial.SetFloat("_Density", fogMaterial.GetFloat("_Density") / config.scale); diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index eeef8d1b..5e9c80d9 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -116,25 +116,33 @@ namespace NewHorizons.Builder.Props foreach (var component in prop.GetComponentsInChildren(true)) { - // Components can come through as null here (yes, really), - // Usually if a script was added to a prefab in an asset bundle but isn't present in the loaded mod DLLs - if (component == null) + // Rather than having the entire prop not exist when a detail fails let's just try-catch and log an error + try { - invalidComponentFound = true; - continue; - } - if (component.gameObject == prop && component is OWItem) isItem = true; + // Components can come through as null here (yes, really), + // Usually if a script was added to a prefab in an asset bundle but isn't present in the loaded mod DLLs + if (component == null) + { + invalidComponentFound = true; + continue; + } + if (component.gameObject == prop && component is OWItem) isItem = true; - if (sector == null) - { - if (FixUnsectoredComponent(component)) continue; - } - else - { - FixSectoredComponent(component, sector, existingSectors, detail.keepLoaded); - } + if (sector == null) + { + if (FixUnsectoredComponent(component)) continue; + } + else + { + FixSectoredComponent(component, sector, existingSectors, detail.keepLoaded); + } - FixComponent(component, go, detail.ignoreSun); + FixComponent(component, go, detail.ignoreSun); + } + catch(Exception e) + { + NHLogger.LogError($"Failed to correct component {component?.GetType()?.Name} on {go?.name} - {e}"); + } } if (detail.path != null) @@ -155,7 +163,7 @@ namespace NewHorizons.Builder.Props } } - // Items shouldn't use these else they get weird + // Items should always be kept loaded else they will vanish in your hand as you leave the sector if (isItem) detail.keepLoaded = true; prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale); @@ -374,7 +382,7 @@ namespace NewHorizons.Builder.Props else if (component is NomaiInterfaceOrb orb) { // detect planet gravity - var gravityVolume = planetGO.GetAttachedOWRigidbody().GetAttachedGravityVolume(); + var gravityVolume = planetGO.GetAttachedOWRigidbody()?.GetAttachedGravityVolume(); orb.GetComponent()._detectableFields = gravityVolume ? new ForceVolume[] { gravityVolume } : new ForceVolume[] { }; } diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index f67bc42f..ecb273b1 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -454,6 +454,8 @@ namespace NewHorizons.Components.SizeControllers public float GetSupernovaRadius() => supernova.GetSupernovaRadius(); + public float GetSurfaceRadius() => transform.localScale.x; + public float GetMaxSupernovaRadius() => supernovaSize; protected new void FixedUpdate() diff --git a/NewHorizons/Components/Stars/SunLightEffectsController.cs b/NewHorizons/Components/Stars/SunLightEffectsController.cs index 6d26808e..b4c42d03 100644 --- a/NewHorizons/Components/Stars/SunLightEffectsController.cs +++ b/NewHorizons/Components/Stars/SunLightEffectsController.cs @@ -1,4 +1,5 @@ using NewHorizons.Builder.Atmosphere; +using NewHorizons.Components.SizeControllers; using NewHorizons.Utility.OWML; using System.Collections.Generic; using UnityEngine; @@ -17,7 +18,11 @@ namespace NewHorizons.Components.Stars private readonly List _stars = new(); private readonly List _lights = new(); - private StarController _activeStar; + // SunController or StarEvolutionController + public StarEvolutionController ActiveStarEvolutionController { get; private set; } + public SunController ActiveSunController { get; private set; } + + private StarController _activeStarController; private SunLightController _sunLightController; private SunLightParamUpdater _sunLightParamUpdater; @@ -54,7 +59,7 @@ namespace NewHorizons.Components.Stars NHLogger.LogVerbose($"Removing star from list: {star?.gameObject?.name}"); if (Instance._stars.Contains(star)) { - if (Instance._activeStar != null && Instance._activeStar.Equals(star)) + if (Instance._activeStarController != null && Instance._activeStarController.Equals(star)) { Instance._stars.Remove(star); if (Instance._stars.Count > 0) Instance.ChangeActiveStar(Instance._stars[0]); @@ -121,11 +126,11 @@ namespace NewHorizons.Components.Stars if (_stars.Count > 0) { - if (_activeStar == null || !_activeStar.gameObject.activeInHierarchy) + if (_activeStarController == null || !_activeStarController.gameObject.activeInHierarchy) { - if (_stars.Contains(_activeStar)) + if (_stars.Contains(_activeStarController)) { - _stars.Remove(_activeStar); + _stars.Remove(_activeStarController); } if (_stars.Count > 0) @@ -145,8 +150,8 @@ namespace NewHorizons.Components.Stars // 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); + var sqrDist = (planet.transform.position - _activeStarController.transform.position).sqrMagnitude; + var intensity = Mathf.Min(_activeStarController.Intensity / (sqrDist / hearthSunDistanceSqr), 1f); material.SetFloat(SunIntensity, intensity); } @@ -156,7 +161,7 @@ namespace NewHorizons.Components.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) + if (star.Intensity * (star.transform.position - origin).sqrMagnitude < _activeStarController.Intensity * (_activeStarController.transform.position - origin).sqrMagnitude) { ChangeActiveStar(star); break; @@ -170,11 +175,13 @@ namespace NewHorizons.Components.Stars { if (_sunLightController == null || _sunLightParamUpdater == null) return; - if (_activeStar != null) _activeStar.Disable(); + _activeStarController?.Disable(); NHLogger.LogVerbose($"Switching active star: {star.gameObject.name}"); - _activeStar = star; + _activeStarController = star; + ActiveStarEvolutionController = star.GetComponentInChildren(); + ActiveSunController = star.GetComponent(); star.Enable(); @@ -194,7 +201,8 @@ namespace NewHorizons.Components.Stars transform.localPosition = Vector3.zero; // Some effects use Locator.GetSunTransform so hopefully its fine to change it - Locator._sunTransform = transform; + // 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 } diff --git a/NewHorizons/Components/Volumes/WaterCloakFixerVolume.cs b/NewHorizons/Components/Volumes/WaterCloakFixerVolume.cs new file mode 100644 index 00000000..d74aaa89 --- /dev/null +++ b/NewHorizons/Components/Volumes/WaterCloakFixerVolume.cs @@ -0,0 +1,54 @@ +using UnityEngine; + +namespace NewHorizons.Components.Volumes +{ + /// + /// 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 + /// + 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().GetOWTriggerVolume(); + + _volume.OnEntry += WaterCloakFixerVolume_OnEntry; + _volume.OnExit += WaterCloakFixerVolume_OnExit; + + material.renderQueue = CLOAK_RENDER_QUEUE; + } + + public void OnDestroy() + { + _volume.OnEntry -= WaterCloakFixerVolume_OnEntry; + _volume.OnExit -= WaterCloakFixerVolume_OnExit; + } + + private void WaterCloakFixerVolume_OnEntry(GameObject hitObj) + { + if (hitObj.CompareTag("PlayerDetector")) + { + material.renderQueue = WATER_RENDER_QUEUE; + } + } + + private void WaterCloakFixerVolume_OnExit(GameObject hitObj) + { + if (hitObj.CompareTag("PlayerDetector")) + { + material.renderQueue = CLOAK_RENDER_QUEUE; + } + } + } +} diff --git a/NewHorizons/External/Modules/OrbitModule.cs b/NewHorizons/External/Modules/OrbitModule.cs index e3a6a566..bb1325e4 100644 --- a/NewHorizons/External/Modules/OrbitModule.cs +++ b/NewHorizons/External/Modules/OrbitModule.cs @@ -45,6 +45,12 @@ namespace NewHorizons.External.Modules /// public bool isTidallyLocked; + /// + /// Is the body meant to stay in one place without moving? If staticPosition is not set, the initial position + /// will be determined using its orbital parameters. + /// + public bool isStatic; + /// /// If it is tidally locked, this direction will face towards the primary. Ex: Interloper uses `0, -1, 0`. Most planets /// will want something like `-1, 0, 0`. @@ -62,12 +68,6 @@ namespace NewHorizons.External.Modules /// public bool dottedOrbitLine; - /// - /// Is the body meant to stay in one place without moving? If staticPosition is not set, the initial position - /// will be determined using its orbital parameters. - /// - public bool isStatic; - /// /// Colour of the orbit-line in the map view. /// @@ -78,6 +78,16 @@ namespace NewHorizons.External.Modules /// public bool trackingOrbitLine; + /// + /// If the camera is farther than this distance the orbit line will fade out. Leave empty to not have it fade out. + /// + public float orbitLineFadeEndDistance = -1f; + + /// + /// If the camera is closer than this distance the orbit line will fade out. Leave empty to not have it fade out. + /// + public float orbitLineFadeStartDistance = -1f; + /// /// The semi-major axis of the ellipse that is the body's orbit. For a circular orbit this is the radius. /// diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index d15c97a9..85e8dd3c 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -627,7 +627,7 @@ namespace NewHorizons.Handlers if (body.Config.Water != null) { - WaterBuilder.Make(go, sector, rb, body.Config.Water); + WaterBuilder.Make(go, sector, rb, body.Config); } if (body.Config.Sand != null) diff --git a/NewHorizons/Handlers/PlanetDestructionHandler.cs b/NewHorizons/Handlers/PlanetDestructionHandler.cs index e8377893..272dc68e 100644 --- a/NewHorizons/Handlers/PlanetDestructionHandler.cs +++ b/NewHorizons/Handlers/PlanetDestructionHandler.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using UnityEngine; +using NewHorizons.Components; namespace NewHorizons.Handlers { @@ -66,17 +67,20 @@ namespace NewHorizons.Handlers } } - foreach (var proxyBody in GameObject.FindObjectsOfType()) - { - toDisable.Add(proxyBody.gameObject); - } - Delay.FireInNUpdates(() => { foreach (var gameObject in toDisable) { gameObject.SetActive(false); } + // Kill all non nh proxies + foreach (var proxy in GameObject.FindObjectsOfType()) + { + if (proxy is not NHProxy) + { + proxy.gameObject.SetActive(false); + } + } GameObject.FindObjectOfType().gameObject.SetActive(false); // force call update here to make it switch to an active star. idk why we didnt have to do this before diff --git a/NewHorizons/Handlers/PlayerSpawnHandler.cs b/NewHorizons/Handlers/PlayerSpawnHandler.cs index 8a9eb6f8..083eff3b 100644 --- a/NewHorizons/Handlers/PlayerSpawnHandler.cs +++ b/NewHorizons/Handlers/PlayerSpawnHandler.cs @@ -10,11 +10,11 @@ namespace NewHorizons.Handlers { public static void SetUpPlayerSpawn() { - var spawnPoint = Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint; - if (spawnPoint != null) + if (UsingCustomSpawn()) { - SearchUtilities.Find("Player_Body").GetComponent().SetBodyToMatch(spawnPoint.GetAttachedOWRigidbody()); - GetPlayerSpawner().SetInitialSpawnPoint(spawnPoint); + var spawn = GetDefaultSpawn(); + SearchUtilities.Find("Player_Body").GetComponent().SetBodyToMatch(spawn.GetAttachedOWRigidbody()); + GetPlayerSpawner().SetInitialSpawnPoint(spawn); } else { @@ -44,6 +44,13 @@ namespace NewHorizons.Handlers // Arbitrary number, depending on the machine some people die, some people fall through the floor, its very inconsistent Delay.StartCoroutine(SpawnCoroutine(30)); } + + var cloak = GetDefaultSpawn()?.GetAttachedOWRigidbody()?.GetComponentInChildren(); + if (cloak != null) + { + // Ensures it has invoked everything and actually placed the player in the cloaking field #671 + cloak._firstUpdate = true; + } } public static void SpawnShip() diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index d839410a..e056b4c3 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -907,7 +907,8 @@ namespace NewHorizons } else { - if (!string.IsNullOrEmpty(_defaultSystemOverride)) + // Ignore first load because it doesn't even know what systems we have + if (!_firstLoad && !string.IsNullOrEmpty(_defaultSystemOverride)) { NHLogger.LogError($"The given default system override {_defaultSystemOverride} is invalid - no system exists with that name"); } diff --git a/NewHorizons/Patches/ProxyPatches/SunProxyPatches.cs b/NewHorizons/Patches/ProxyPatches/SunProxyPatches.cs new file mode 100644 index 00000000..48590d22 --- /dev/null +++ b/NewHorizons/Patches/ProxyPatches/SunProxyPatches.cs @@ -0,0 +1,19 @@ +using HarmonyLib; +using NewHorizons.Utility; + +namespace NewHorizons.Patches.ProxyPatches +{ + [HarmonyPatch(typeof(SunProxy))] + public static class SunProxyPatches + { + [HarmonyPostfix] + [HarmonyPatch(nameof(SunProxy.Start))] + public static void SunProxy_Start(SunProxy __instance) + { + // We mess with the Locator.GetSunTransform() value to switch it to other relevant stars since it's used for some other effects + // However if it's set to a different star when the SunProxy starts it breaks, so we double check it here + __instance._sunTransform = SearchUtilities.Find("Sun_Body").transform; + __instance._realSunController = __instance._sunTransform.GetComponent(); + } + } +} diff --git a/NewHorizons/Patches/ShipLogPatches/ShipLogEntryLocationPatches.cs b/NewHorizons/Patches/ShipLogPatches/ShipLogEntryLocationPatches.cs new file mode 100644 index 00000000..956f22c5 --- /dev/null +++ b/NewHorizons/Patches/ShipLogPatches/ShipLogEntryLocationPatches.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using NewHorizons.Handlers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.Patches.ShipLogPatches +{ + [HarmonyPatch(typeof(ShipLogEntryLocation))] + public static class ShipLogEntryLocationPatches + { + [HarmonyPrefix] + [HarmonyPatch(nameof(ShipLogEntryLocation.OnValidate))] + public static bool ShipLogEntryLocation_OnValidate(ShipLogEntryLocation __instance) + { + // This part is unchanged + if (!__instance._entryID.Equals(string.Empty) && !__instance.gameObject.name.Equals(__instance._entryID)) + { + __instance.gameObject.name = __instance._entryID; + } + + // Base method checks if its on the Ringworld to see if it can be cloaked, we wanna check for a cloak field controller instead + var cloak = __instance.GetComponentInChildren(); + __instance._isWithinCloakField = cloak != null; + return false; + } + } +} diff --git a/NewHorizons/Patches/SunPatches/SunLightParamUpdaterPatches.cs b/NewHorizons/Patches/SunPatches/SunLightParamUpdaterPatches.cs index 45d68e3e..8062a9c2 100644 --- a/NewHorizons/Patches/SunPatches/SunLightParamUpdaterPatches.cs +++ b/NewHorizons/Patches/SunPatches/SunLightParamUpdaterPatches.cs @@ -1,4 +1,5 @@ using HarmonyLib; +using NewHorizons.Components.Stars; using UnityEngine; namespace NewHorizons.Patches.SunPatches { @@ -13,10 +14,20 @@ namespace NewHorizons.Patches.SunPatches { Vector3 position = __instance.transform.position; float w = 2000f; - if (__instance._sunController != null) + + var sunController = SunLightEffectsController.Instance.ActiveSunController; + var starEvolutionController = SunLightEffectsController.Instance.ActiveStarEvolutionController; + + if (sunController != null) { - w = __instance._sunController.HasSupernovaStarted() ? __instance._sunController.GetSupernovaRadius() : __instance._sunController.GetSurfaceRadius(); + w = sunController.HasSupernovaStarted() ? sunController.GetSupernovaRadius() : sunController.GetSurfaceRadius(); } + // This is an addition in this patch, to work with our stars + else if (starEvolutionController != null) + { + w = starEvolutionController.HasSupernovaStarted() ? starEvolutionController.GetSupernovaRadius() : starEvolutionController.GetSurfaceRadius(); + } + float range = __instance.sunLight.range; Color color = __instance._sunLightController != null ? __instance._sunLightController.sunColor : __instance.sunLight.color; float w2 = __instance._sunLightController != null ? __instance._sunLightController.sunIntensity : __instance.sunLight.intensity; diff --git a/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs b/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs index 4676edd4..8089ac89 100644 --- a/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs +++ b/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs @@ -29,12 +29,22 @@ namespace NewHorizons.Patches.WarpPatches [HarmonyPatch(nameof(VesselWarpController.CheckSystemActivation))] public static void VesselWarpController_CheckSystemActivation(VesselWarpController __instance) { - if (Locator.GetEyeStateManager() == null && Main.Instance.CurrentStarSystem != "EyeOfTheUniverse") + // Base method only manages the state of the source warp platform blackhole if the EyeStateManager isn't null + // However we place the vessel into other systems, so we want to handle the state in those locations as well + // For some reason the blackhole can also just be null in which case we ignore all this. Happens in Intervention 1.0.3 + if (Locator.GetEyeStateManager() == null && Main.Instance.CurrentStarSystem != "EyeOfTheUniverse" && __instance._sourceWarpPlatform._blackHole != null) { - if (!__instance._sourceWarpPlatform.IsBlackHoleOpen() && __instance._hasPower && __instance._warpPlatformPowerSlot.IsActivated() && __instance._targetWarpPlatform != null) - __instance._sourceWarpPlatform.OpenBlackHole(__instance._targetWarpPlatform, true); - else if (__instance._sourceWarpPlatform.IsBlackHoleOpen() && (!__instance._hasPower || !__instance._warpPlatformPowerSlot.IsActivated())) + var isBlackHoleOpen = __instance._sourceWarpPlatform.IsBlackHoleOpen(); + var shouldBlackHoleBeOpen = __instance._hasPower && __instance._warpPlatformPowerSlot.IsActivated() && __instance._targetWarpPlatform != null; + + if (isBlackHoleOpen && !shouldBlackHoleBeOpen) + { __instance._sourceWarpPlatform.CloseBlackHole(); + } + else if (!isBlackHoleOpen && shouldBlackHoleBeOpen) + { + __instance._sourceWarpPlatform.OpenBlackHole(__instance._targetWarpPlatform, true); + } } } diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index ddab910d..c34f9431 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1056,6 +1056,10 @@ "type": "boolean", "description": "Should the body always have one side facing its primary?" }, + "isStatic": { + "type": "boolean", + "description": "Is the body meant to stay in one place without moving? If staticPosition is not set, the initial position\nwill be determined using its orbital parameters." + }, "alignmentAxis": { "description": "If it is tidally locked, this direction will face towards the primary. Ex: Interloper uses `0, -1, 0`. Most planets\nwill want something like `-1, 0, 0`.", "$ref": "#/definitions/MVector3" @@ -1069,10 +1073,6 @@ "type": "boolean", "description": "Should the orbit line be dotted?" }, - "isStatic": { - "type": "boolean", - "description": "Is the body meant to stay in one place without moving? If staticPosition is not set, the initial position\nwill be determined using its orbital parameters." - }, "tint": { "description": "Colour of the orbit-line in the map view.", "$ref": "#/definitions/MColor" @@ -1081,6 +1081,16 @@ "type": "boolean", "description": "Should we just draw a line behind its orbit instead of the entire circle/ellipse?" }, + "orbitLineFadeEndDistance": { + "type": "number", + "description": "If the camera is farther than this distance the orbit line will fade out. Leave empty to not have it fade out.", + "format": "float" + }, + "orbitLineFadeStartDistance": { + "type": "number", + "description": "If the camera is closer than this distance the orbit line will fade out. Leave empty to not have it fade out.", + "format": "float" + }, "semiMajorAxis": { "type": "number", "description": "The semi-major axis of the ellipse that is the body's orbit. For a circular orbit this is the radius.", diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 762b1c52..38deebd8 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.14.6", + "version": "1.14.7", "owmlVersion": "2.9.3", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],