VOID_HUDAdvanced: Added the ² to vesselAccel because I'm so embarassed now.
[VOID.git] / VOID_HUDAdvanced.cs
blob:a/VOID_HUDAdvanced.cs -> blob:b/VOID_HUDAdvanced.cs
--- a/VOID_HUDAdvanced.cs
+++ b/VOID_HUDAdvanced.cs
@@ -78,7 +78,7 @@
 		{
 			this._Name = "Advanced Heads-Up Display";
 
-			this._Active.value = true;
+			this.toggleActive = true;
 
 			this.leftHUDdefaultPos = new Rect(
 				Screen.width * .5f - (float)GameSettings.UI_SIZE * .25f - 300f,
@@ -433,18 +433,18 @@
 			"Nominal Stage Thrust",
 			delegate()
 		{
-			if (SimManager.LastStage == null)
+			if (core.LastStage == null)
 			{
 				return double.NaN;
 			}
 
-			if (SimManager.LastStage.actualThrust == 0d)
-			{
-				return SimManager.LastStage.thrust;
-			}
-			else
-			{
-				return SimManager.LastStage.actualThrust;
+			if (core.LastStage.actualThrust == 0d)
+			{
+				return core.LastStage.thrust;
+			}
+			else
+			{
+				return core.LastStage.actualThrust;
 			}
 		},
 			"kN"
@@ -454,12 +454,12 @@
 			"Stage Mass Flow",
 			delegate()
 			{
-				if (SimManager.LastStage == null)
+				if (core.LastStage == null)
 				{
 					return double.NaN;
 				}
 
-			double stageIsp = SimManager.LastStage.isp;
+			double stageIsp = core.LastStage.isp;
 			double stageThrust = stageNominalThrust;
 
 			Tools.PostDebugMessage(typeof(VOID_Data), "calculating stageMassFlow from:\n" +
@@ -528,7 +528,7 @@
 			"Total Burn Time",
 			delegate()
 			{
-				if (SimManager.LastStage == null || currManeuverDeltaV.Value == double.NaN)
+				if (core.LastStage == null || currManeuverDeltaV.Value == double.NaN)
 				{
 					return double.NaN;
 				}
@@ -544,7 +544,7 @@
 			"Burn Time Remaining",
 			delegate()
 			{
-				if (SimManager.LastStage == null || currManeuverDVRemaining == double.NaN)
+				if (core.LastStage == null || currManeuverDVRemaining == double.NaN)
 				{
 					return double.NaN;
 				}
@@ -560,7 +560,7 @@
 			"Half Burn Time",
 			delegate()
 		{
-			if (SimManager.LastStage == null || currManeuverDeltaV.Value == double.NaN)
+			if (core.LastStage == null || currManeuverDeltaV.Value == double.NaN)
 			{
 				return double.NaN;
 			}
@@ -576,7 +576,7 @@
 			"Full burn time to be half done at node",
 			delegate()
 		{
-			if (SimManager.LastStage == null && upcomingManeuverNodes < 1)
+			if (core.LastStage == null && upcomingManeuverNodes < 1)
 			{
 				return "N/A";
 			}
@@ -617,7 +617,7 @@
 			"Full burn time to be half done at node",
 			delegate()
 			{
-			if (SimManager.LastStage == null && upcomingManeuverNodes < 1)
+			if (core.LastStage == null && upcomingManeuverNodes < 1)
 			{
 				return "N/A";
 			}
@@ -630,6 +630,11 @@
 			}
 
 			double interval = (node.UT - currentNodeHalfBurnDuration) - Planetarium.GetUniversalTime();
+
+			if (double.IsNaN(interval))
+			{
+				return string.Intern("NaN");
+			}
 
 			int sign = Math.Sign(interval);
 			interval = Math.Abs(interval);