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/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. ///