Fixed asteroids

This commit is contained in:
Nick J. Connors 2021-12-19 02:54:20 -05:00
parent 7b2dca04df
commit 8d7da14a3f
4 changed files with 8 additions and 5 deletions

View File

@ -33,7 +33,7 @@ namespace NewHorizons.Body
{"HasMapMarker", false },
{"SurfaceGravity", 1 },
{"SurfaceSize", size },
{"HideOrbitLine", true }
{"HasReferenceFrame", false }
}
},
{"Orbit", new Dictionary<string, object>()
@ -43,7 +43,8 @@ namespace NewHorizons.Body
{"LongitudeOfAscendingNode", belt.LongitudeOfAscendingNode },
{"TrueAnomaly", 360f * (i + Random.Range(-0.2f, 0.2f)) / (float)count },
{"PrimaryBody", bodyName },
{"SemiMajorAxis", maxSize * Random.Range(belt.InnerRadius, belt.OuterRadius) }
{"SemiMajorAxis", Random.Range(belt.InnerRadius, belt.OuterRadius) },
{"ShowOrbitLine", false }
}
},
{"ProcGen", new Dictionary<string, object>()

View File

@ -17,6 +17,6 @@ namespace NewHorizons.External
public float GroundSize { get; set; }
public float BlackHoleSize { get; set; }
public float LavaSize { get; set; }
public bool HideOrbitLine { get; set; }
public bool HasReferenceFrame { get; set; } = true;
}
}

View File

@ -19,5 +19,6 @@ namespace NewHorizons.External
public float AxialTilt { get; set; }
public float SiderealPeriod { get; set; }
public bool IsTidallyLocked { get; set; }
public bool ShowOrbitLine { get; set; } = true;
}
}

View File

@ -198,7 +198,8 @@ namespace NewHorizons
GravityBuilder.Make(go, ao, body.Config.Base.SurfaceGravity, sphereOfInfluence, body.Config.Base.SurfaceSize);
else Logger.Log("No gravity?");
RFVolumeBuilder.Make(go, rb, sphereOfInfluence);
if(body.Config.Base.HasReferenceFrame)
RFVolumeBuilder.Make(go, rb, sphereOfInfluence);
if (body.Config.Base.HasMapMarker)
MarkerBuilder.Make(go, body.Config.Name, body.Config.Orbit.IsMoon);
@ -221,7 +222,7 @@ namespace NewHorizons
body.Object = go;
// Some things have to be done the second tick
if(body.Config.Orbit != null && !body.Config.Base.HideOrbitLine)
if(body.Config.Orbit != null && body.Config.Orbit.ShowOrbitLine)
Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao, body.Config.Orbit.IsMoon, body.Config.Orbit));
// Now that we're done move the planet into place