Throughout: Changed explicit references to VOID_Core.Instance to per-module, editor-aware 'core' properties. dev-EditorTWR
[VOID.git] / VOID_VesselInfo.cs
blob:a/VOID_VesselInfo.cs -> blob:b/VOID_VesselInfo.cs
--- a/VOID_VesselInfo.cs
+++ b/VOID_VesselInfo.cs
@@ -66,7 +66,9 @@
 
 			VOID_Data.totalMass.DoGUIHorizontal ("F3");
 
-			VOID_Data.comboResourceMass.DoGUIHorizontal ();
+			VOID_Data.stageResourceMass.DoGUIHorizontal("F2");
+
+			VOID_Data.resourceMass.DoGUIHorizontal("F2");
 
 			VOID_Data.stageDeltaV.DoGUIHorizontal (3, false);
 
@@ -106,12 +108,12 @@
 			"Total Mass",
 			delegate()
 		{
-			if (SimManager.Stages == null || SimManager.LastStage == null)
+			if (core.Stages == null || core.LastStage == null)
 			{
 				return double.NaN;
 			}
 
-			return SimManager.LastStage.totalMass;
+			return core.LastStage.totalMass;
 		},
 			"tons"
 		);
@@ -120,26 +122,26 @@
 			"Resource Mass",
 			delegate()
 			{
-				if (SimManager.Stages == null || SimManager.LastStage == null)
+				if (core.Stages == null || core.LastStage == null)
 				{
 					return double.NaN;
 				}
 
-				return SimManager.LastStage.totalMass - SimManager.LastStage.totalBaseMass;
+				return core.LastStage.totalMass - core.LastStage.totalBaseMass;
 			},
 			"tons"
 		);
 
 		public static readonly VOID_DoubleValue stageResourceMass = new VOID_DoubleValue(
-			"Resource Mass (Current Stage)",
-			delegate()
-			{
-				if (SimManager.LastStage == null)
+			"Resource Mass (Stage)",
+			delegate()
+			{
+				if (core.LastStage == null)
 				{
 					return double.NaN;
 				}
 
-				return SimManager.LastStage.mass - SimManager.LastStage.baseMass;
+				return core.LastStage.mass - core.LastStage.baseMass;
 			},
 			"tons"
 		);
@@ -148,7 +150,10 @@
 			"Resource Mass (curr / total)",
 			delegate()
 		{
-			return string.Format("{0} / {1}", stageResourceMass.ValueUnitString(), resourceMass.ValueUnitString());
+			return string.Format("{0} / {1}",
+				stageResourceMass.ValueUnitString("F3"),
+				resourceMass.ValueUnitString("F3")
+			);
 		}
 		);
 
@@ -156,9 +161,9 @@
 			"DeltaV (Current Stage)",
 			delegate()
 			{
-				if (SimManager.Stages == null || SimManager.LastStage == null)
-					return double.NaN;
-				return SimManager.LastStage.deltaV;
+			if (core.Stages == null || core.LastStage == null)
+					return double.NaN;
+				return core.LastStage.deltaV;
 			},
 			"m/s"
 		);
@@ -167,9 +172,9 @@
 			"DeltaV (Total)",
 			delegate()
 			{
-				if (SimManager.Stages == null || SimManager.LastStage == null)
-					return double.NaN;
-				return SimManager.LastStage.totalDeltaV;
+			if (core.Stages == null || core.LastStage == null)
+					return double.NaN;
+				return core.LastStage.totalDeltaV;
 			},
 			"m/s"
 		);
@@ -184,11 +189,11 @@
 			"Thrust (curr/max)",
 			delegate()
 			{
-				if (SimManager.Stages == null || SimManager.LastStage == null)
+				if (core.Stages == null || core.LastStage == null)
 					return "N/A";
 
-				double currThrust = SimManager.LastStage.actualThrust;
-				double maxThrust = SimManager.LastStage.thrust;
+				double currThrust = core.LastStage.actualThrust;
+				double maxThrust = core.LastStage.thrust;
 
 				return string.Format(
 					"{0} / {1}",
@@ -202,12 +207,12 @@
 			"T:W Ratio",
 			delegate()
 		{
-			if (SimManager.LastStage == null)
+			if (core.LastStage == null)
 			{
 				return double.NaN;
 			}
 
-			return SimManager.LastStage.actualThrustToWeight;
+			return core.LastStage.actualThrustToWeight;
 		},
 			""
 		);
@@ -216,12 +221,12 @@
 			"T:W Ratio",
 			delegate()
 		{
-			if (SimManager.LastStage == null)
+			if (core.LastStage == null)
 			{
 				return double.NaN;
 			}
 
-			return SimManager.LastStage.thrustToWeight;
+			return core.LastStage.thrustToWeight;
 		},
 			""
 		);
@@ -230,7 +235,7 @@
 			"T:W (curr/max)",
 			delegate()
 			{
-				if (SimManager.Stages == null || SimManager.LastStage == null)
+				if (core.Stages == null || core.LastStage == null)
 					return "N/A";
 
 				return string.Format(
@@ -245,11 +250,11 @@
 			"Max T:W @ surface",
 			delegate()
 			{
-			if (SimManager.Stages == null || SimManager.LastStage == null)
-					return double.NaN;
-
-				double maxThrust = SimManager.LastStage.thrust;
-				double mass = SimManager.LastStage.totalMass;
+			if (core.Stages == null || core.LastStage == null)
+					return double.NaN;
+
+				double maxThrust = core.LastStage.thrust;
+				double mass = core.LastStage.totalMass;
 				double gravity = (VOID_Core.Constant_G * core.vessel.mainBody.Mass) /
 				(core.vessel.mainBody.Radius * core.vessel.mainBody.Radius);
 				double weight = mass * gravity;