mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Allow tracking orbit lines on anything
This commit is contained in:
parent
2f36082ba5
commit
7f1e52af55
@ -27,13 +27,24 @@ namespace NewHorizons.Builder.Orbital
|
||||
var parentGravity = astroobject.GetPrimaryBody()?.GetGravityVolume();
|
||||
|
||||
OrbitLine orbitLine;
|
||||
if (ecc == 0)
|
||||
orbitLine = orbitGO.AddComponent<OrbitLine>();
|
||||
// Doesn't work for linear eccentric falloff
|
||||
else if (ecc > 0 && ecc < 1 && (parentGravity != null && parentGravity._falloffType == GravityVolume.FalloffType.inverseSquared))
|
||||
orbitLine = orbitGO.AddComponent<EllipticOrbitLine>();
|
||||
else
|
||||
|
||||
if(config.Orbit.TrackingOrbitLine)
|
||||
{
|
||||
orbitLine = orbitGO.AddComponent<TrackingOrbitLine>();
|
||||
}
|
||||
else if (ecc == 0)
|
||||
{
|
||||
orbitLine = orbitGO.AddComponent<OrbitLine>();
|
||||
}
|
||||
else if (ecc > 0 && ecc < 1 && (parentGravity != null && parentGravity._falloffType == GravityVolume.FalloffType.inverseSquared))
|
||||
{
|
||||
// Doesn't work for linear eccentric falloff
|
||||
orbitLine = orbitGO.AddComponent<EllipticOrbitLine>();
|
||||
}
|
||||
else
|
||||
{
|
||||
orbitLine = orbitGO.AddComponent<TrackingOrbitLine>();
|
||||
}
|
||||
|
||||
var color = Color.white;
|
||||
if (config.Orbit.Tint != null) color = config.Orbit.Tint.ToColor32();
|
||||
|
||||
1
NewHorizons/External/OrbitModule.cs
vendored
1
NewHorizons/External/OrbitModule.cs
vendored
@ -23,5 +23,6 @@ namespace NewHorizons.External
|
||||
public bool ShowOrbitLine { get; set; } = true;
|
||||
public bool IsStatic { get; set; }
|
||||
public MColor Tint { get; set; }
|
||||
public bool TrackingOrbitLine { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,6 +317,11 @@
|
||||
"tint": {
|
||||
"$ref": "#/$defs/color",
|
||||
"description": "Colour of the orbit-line in the map view."
|
||||
},
|
||||
"trackingOrbitLine": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Should we just draw a line behind its orbit."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user