mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Make no map marker = no display name
This commit is contained in:
parent
bd4a118ee8
commit
5b5698c85e
@ -38,7 +38,8 @@ namespace NewHorizons.Builder.General
|
||||
owRigidBody.EnableKinematicSimulation();
|
||||
owRigidBody.MakeKinematic();
|
||||
|
||||
ParameterizedAstroObject astroObject = body.AddComponent<ParameterizedAstroObject>();
|
||||
NHAstroObject astroObject = body.AddComponent<NHAstroObject>();
|
||||
astroObject.HideDisplayName = !config.Base.HasMapMarker;
|
||||
|
||||
if (config.Orbit != null) astroObject.SetKeplerCoordinatesFromOrbitModule(config.Orbit);
|
||||
|
||||
|
||||
@ -186,8 +186,8 @@ namespace NewHorizons.Builder.General
|
||||
float r1 = r.magnitude * m2 / (m1 + m2);
|
||||
float r2 = r.magnitude * m1 / (m1 + m2);
|
||||
|
||||
ParameterizedAstroObject primaryAO = Position.AstroLookup[primaryHB].Invoke() as ParameterizedAstroObject;
|
||||
ParameterizedAstroObject secondaryAO = Position.AstroLookup[secondaryHB].Invoke() as ParameterizedAstroObject;
|
||||
NHAstroObject primaryAO = Position.AstroLookup[primaryHB].Invoke() as NHAstroObject;
|
||||
NHAstroObject secondaryAO = Position.AstroLookup[secondaryHB].Invoke() as NHAstroObject;
|
||||
|
||||
float ecc = primaryAO.Eccentricity;
|
||||
float i = primaryAO.Inclination;
|
||||
|
||||
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class ParameterizedAstroObject : AstroObject, IKeplerCoordinates
|
||||
public class NHAstroObject : AstroObject, IKeplerCoordinates
|
||||
{
|
||||
public float Inclination { get; set; }
|
||||
public int SemiMajorAxis { get; set; }
|
||||
@ -17,6 +17,7 @@ namespace NewHorizons.Components.Orbital
|
||||
public float Eccentricity { get; set; }
|
||||
public float ArgumentOfPeriapsis { get; set; }
|
||||
public float TrueAnomaly { get; set; }
|
||||
public bool HideDisplayName { get; set; }
|
||||
|
||||
public void SetKeplerCoordinatesFromOrbitModule(OrbitModule orbit)
|
||||
{
|
||||
@ -1,4 +1,5 @@
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.Handlers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -25,11 +26,16 @@ namespace NewHorizons.Tools
|
||||
public static bool GetHUDDisplayName(ReferenceFrame __instance, ref string __result)
|
||||
{
|
||||
var ao = __instance.GetAstroObject();
|
||||
if (ao != null && ao.GetAstroObjectName() == AstroObject.Name.CustomString)
|
||||
|
||||
if (ao == null) return true;
|
||||
|
||||
if(ao is NHAstroObject)
|
||||
{
|
||||
__result = TranslationHandler.GetTranslation(ao.GetCustomName(), TranslationHandler.TextType.UI);
|
||||
if((ao as NHAstroObject).HideDisplayName) __result = "";
|
||||
else __result = TranslationHandler.GetTranslation(ao.GetCustomName(), TranslationHandler.TextType.UI);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user