Fixed map marker types + comet tail size

This commit is contained in:
Nick J. Connors 2021-12-27 00:43:54 -05:00
parent bb15642fde
commit 4f5159828b
5 changed files with 17 additions and 12 deletions

View File

@ -12,7 +12,7 @@ namespace NewHorizons.Atmosphere
atmoGO.SetActive(false); atmoGO.SetActive(false);
atmoGO.transform.parent = body.transform; atmoGO.transform.parent = body.transform;
if (atmosphereModule.hasAtmosphere) if (atmosphereModule.HasAtmosphere)
{ {
var mat = GameObject.Find("TimberHearth_Body/Atmosphere_TH/AtmoSphere/Atmosphere_LOD0").GetComponent<MeshRenderer>().material; var mat = GameObject.Find("TimberHearth_Body/Atmosphere_TH/AtmoSphere/Atmosphere_LOD0").GetComponent<MeshRenderer>().material;

View File

@ -16,7 +16,7 @@ namespace NewHorizons.Builder.Body
var cometTail = GameObject.Instantiate(GameObject.Find("Comet_Body/Sector_CO/Effects_CO/Effects_CO_TailMeshes"), go.transform); var cometTail = GameObject.Instantiate(GameObject.Find("Comet_Body/Sector_CO/Effects_CO/Effects_CO_TailMeshes"), go.transform);
cometTail.transform.localPosition = Vector3.zero; cometTail.transform.localPosition = Vector3.zero;
cometTail.name = "CometTail"; cometTail.name = "CometTail";
cometTail.transform.localScale = Vector3.one * 110 / module.SurfaceSize; cometTail.transform.localScale = Vector3.one * module.SurfaceSize / 110;
cometTail.transform.localRotation = Quaternion.Euler(0, 180, 90); cometTail.transform.localRotation = Quaternion.Euler(0, 180, 90);
/* /*
var alignment = cometTail.AddComponent<AlignWithTargetBody>(); var alignment = cometTail.AddComponent<AlignWithTargetBody>();

View File

@ -8,22 +8,27 @@ namespace NewHorizons.Builder.General
{ {
static class MarkerBuilder static class MarkerBuilder
{ {
public static void Make(GameObject body, string name, bool isMoon, bool isStar) public static void Make(GameObject body, string name, IPlanetConfig config)
{ {
MapMarker MM = body.AddComponent<MapMarker>(); MapMarker mapMarker = body.AddComponent<MapMarker>();
MM.SetValue("_labelID", (UITextType)Utility.AddToUITable.Add(name.ToUpper())); mapMarker.SetValue("_labelID", (UITextType)Utility.AddToUITable.Add(name.ToUpper()));
if (isMoon) var markerType = "Planet";
if (config.Orbit.IsMoon)
{ {
MM.SetValue("_markerType", MM.GetType().GetNestedType("MarkerType", BindingFlags.NonPublic).GetField("Moon").GetValue(MM)); markerType = "Moon";
} }
else if(isStar) else if (config.Star != null)
{ {
MM.SetValue("_markerType", MM.GetType().GetNestedType("MarkerType", BindingFlags.NonPublic).GetField("Sun").GetValue(MM)); markerType = "Sun";
} }
else if (config.FocalPoint != null)
{ {
MM.SetValue("_markerType", MM.GetType().GetNestedType("MarkerType", BindingFlags.NonPublic).GetField("Planet").GetValue(MM)); markerType = "HourglassTwins";
} }
mapMarker.SetValue("_markerType", mapMarker.GetType().GetNestedType("MarkerType", BindingFlags.NonPublic).GetField(markerType).GetValue(mapMarker));
} }
} }
} }

View File

@ -20,6 +20,6 @@ namespace NewHorizons.External
public bool HasRain { get; set; } public bool HasRain { get; set; }
public bool HasSnow { get; set; } public bool HasSnow { get; set; }
public bool HasOxygen { get; set; } public bool HasOxygen { get; set; }
public bool hasAtmosphere { get; set; } public bool HasAtmosphere { get; set; }
} }
} }

View File

@ -240,7 +240,7 @@ namespace NewHorizons
RFVolumeBuilder.Make(go, owRigidBody, sphereOfInfluence); RFVolumeBuilder.Make(go, owRigidBody, sphereOfInfluence);
if (body.Config.Base.HasMapMarker) if (body.Config.Base.HasMapMarker)
MarkerBuilder.Make(go, body.Config.Name, body.Config.Orbit.IsMoon, body.Config.Star != null); MarkerBuilder.Make(go, body.Config.Name, body.Config);
if (body.Config.Base.HasAmbientLight) if (body.Config.Base.HasAmbientLight)
AmbientLightBuilder.Make(go, sphereOfInfluence); AmbientLightBuilder.Make(go, sphereOfInfluence);