Reference Frame Enabled

This commit is contained in:
Noah Pilarski 2022-06-15 10:59:01 -04:00
parent cd7086f669
commit de05bfa2e0
5 changed files with 10 additions and 3 deletions

View File

@ -43,7 +43,8 @@ namespace NewHorizons.Builder.General
owrb.SetAttachedReferenceFrameVolume(RFV);
rfGO.SetActive(!module.hideInMap);
if (!module.enabled) GameObject.Destroy(rfGO);
else rfGO.SetActive(!module.hideInMap);
}
}
}

View File

@ -59,6 +59,7 @@ namespace NewHorizons.Builder.Orbital
fakeMassConfig.name = config.name + "_FakeBarycenterMass";
fakeMassConfig.Base.soiOverride = 0;
fakeMassConfig.Base.hasMapMarker = false;
fakeMassConfig.ReferenceFrame.enabled = false;
fakeMassConfig.ReferenceFrame.hideInMap = true;
fakeMassConfig.Orbit = new OrbitModule();

View File

@ -119,7 +119,7 @@ namespace NewHorizons.Components
_cloak._cloakVisualsEnabled = false;
}
public void SetReferenceFrameVolumeActive(bool active) => _cloak._referenceFrameVolume.gameObject.SetActive(active);
public void SetReferenceFrameVolumeActive(bool active) => _cloak._referenceFrameVolume?.gameObject.SetActive(active);
public void EnableReferenceFrameVolume() => SetReferenceFrameVolumeActive(true);
public void DisableReferenceFrameVolume() => SetReferenceFrameVolumeActive(false);

View File

@ -201,7 +201,7 @@ namespace NewHorizons.External.Configs
if (Base.isSatellite) Base.showMinimap = false;
if (!Base.hasReferenceFrame) ReferenceFrame.hideInMap = true;
if (!Base.hasReferenceFrame) ReferenceFrame.enabled = false;
if (childrenToDestroy != null) removeChildren = childrenToDestroy;

View File

@ -10,6 +10,11 @@ namespace NewHorizons.External.Modules
[JsonObject]
public class ReferenceFrameModule
{
/// <summary>
/// Allows the object to be targeted.
/// </summary>
[DefaultValue(true)] public bool enabled = true;
/// <summary>
/// Stop the object from being targeted on the map.
/// </summary>