VOID_DataValue: Improvements to DoHorizontalPrec for negative magnitudes.
VOID_DataValue: Improvements to DoHorizontalPrec for negative magnitudes.

file:a/Tools.cs -> file:b/Tools.cs
--- a/Tools.cs
+++ b/Tools.cs
@@ -986,16 +986,6 @@
 			return radius;
 		}
 
-		public static double TryGetLastMass(this Engineer.VesselSimulator.SimManager simManager)
-		{
-			if (simManager.Stages == null || simManager.Stages.Length <= Staging.lastStage)
-			{
-				return double.NaN;
-			}
-
-			return simManager.Stages[Staging.lastStage].totalMass;
-		}
-
 		public static string HumanString(this ExperimentSituations situation)
 		{
 			switch (situation)

--- a/VOIDEditorMaster.cs
+++ b/VOIDEditorMaster.cs
@@ -47,7 +47,6 @@
 			Tools.PostDebugMessage ("VOIDEditorMaster: Waking up.");
 			this.Core = VOID_EditorCore.Instance;
 			this.Core.ResetGUI ();
-			SimManager.HardReset();
 			Tools.PostDebugMessage ("VOIDEditorMaster: Awake.");
 		}
 

--- a/VOIDFlightMaster.cs
+++ b/VOIDFlightMaster.cs
@@ -47,7 +47,6 @@
 			Tools.PostDebugMessage ("VOIDFlightMaster: Waking up.");
 			this.Core = (VOID_Core)VOID_Core.Instance;
 			this.Core.ResetGUI ();
-			SimManager.HardReset();
 			Tools.PostDebugMessage ("VOIDFlightMaster: Awake.");
 		}
 

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -69,7 +69,7 @@
 		 * Fields
 		 * */
 		protected string VoidName = "VOID";
-		protected string VoidVersion = "0.9.21";
+		protected string VoidVersion = "0.9.22";
 
 		protected bool _factoryReset = false;
 
@@ -465,9 +465,9 @@
 
 			if (this.vessel != null)
 			{
-				SimManager.Instance.Gravity = VOID_Core.Instance.vessel.mainBody.gravParameter /
+				SimManager.Gravity = VOID_Core.Instance.vessel.mainBody.gravParameter /
 					Math.Pow(VOID_Core.Instance.vessel.Radius(), 2);
-				SimManager.Instance.TryStartSimulation();
+				SimManager.TryStartSimulation();
 			}
 
 			if (!this.guiRunning)
@@ -999,14 +999,6 @@
 			}
 		}
 
-		public static Engineer.VesselSimulator.SimManager simManager
-		{
-			get
-			{
-				return Engineer.VesselSimulator.SimManager.Instance;
-			}
-		}
-
 		public static double KerbinGee
 		{
 			get

--- a/VOID_DataValue.cs
+++ b/VOID_DataValue.cs
@@ -235,19 +235,26 @@
 
 		public virtual int DoGUIHorizontalPrec(int digits)
 		{
-			float magnitude;
-			float magLimit;
-
-			magnitude = (float)Math.Log10(Math.Abs(this));
-
-			magLimit = Mathf.Max(magnitude, 6f);
-			magLimit = Mathf.Round((float)Math.Ceiling(magLimit / 3f) * 3f);
+			double magnitude;
+			double magLimit;
+
+			magnitude = Math.Log10(Math.Abs((double)this));
+
+			magLimit = Math.Max(Math.Abs(magnitude), 3d) + 3d;
+			magLimit = Math.Round(Math.Ceiling(magLimit / 3f)) * 3d;
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 			GUILayout.Label(this.Label + "ⁱ:", GUILayout.ExpandWidth(true));
 			GUILayout.FlexibleSpace();
 
-			GUILayout.Label(this.ValueUnitString(3, int.MinValue, (int)magnitude - digits), GUILayout.ExpandWidth(false));
+			if (magnitude >= 0)
+			{
+				GUILayout.Label(this.ValueUnitString(3, int.MinValue, (int)magnitude - digits), GUILayout.ExpandWidth(false));
+			}
+			else
+			{
+				GUILayout.Label(this.ValueUnitString(3, (int)magnitude + digits, int.MaxValue), GUILayout.ExpandWidth(false));
+			}
 			GUILayout.EndHorizontal();
 
 			if (Event.current.type == EventType.mouseUp)
@@ -255,6 +262,11 @@
 				Rect lastRect = GUILayoutUtility.GetLastRect();
 				if (lastRect.Contains(Event.current.mousePosition))
 				{
+					Tools.PostDebugMessage(string.Format("{0}: Changing digits from {1} within magLimit {2}.",
+						this.GetType().Name,
+						digits,
+						magLimit));
+
 					if (Event.current.button == 0)
 					{
 						digits = (digits + 3) % (int)magLimit;
@@ -262,11 +274,22 @@
 					else if (Event.current.button == 1)
 					{
 						digits = (digits - 3) % (int)magLimit;
-						if (digits < 0)
-						{
-							digits = (int)magLimit - 3;
-						}
 					}
+
+					if (digits < 0)
+					{
+						digits += (int)magLimit;
+					}
+
+					Tools.PostDebugMessage(string.Format("{0}: Changed digits to {1}." +
+						"\n\tNew minMagnitude: {2}, maxMagnitude: {3}" +
+						"\n\tMagnitude: {4}",
+						this.GetType().Name,
+						digits,
+						magnitude >= 0 ? int.MinValue : (int)magnitude - 4 + digits,
+						magnitude >= 0 ? (int)magnitude - digits : int.MaxValue,
+						magnitude
+					));
 				}
 			}
 

--- a/VOID_EditorCore.cs
+++ b/VOID_EditorCore.cs
@@ -122,8 +122,8 @@
 
 			if (EditorLogic.SortedShipList.Count > 0)
 			{
-				SimManager.Instance.Gravity = VOID_Data.KerbinGee;
-				SimManager.Instance.TryStartSimulation();
+				SimManager.Gravity = VOID_Data.KerbinGee;
+				SimManager.TryStartSimulation();
 			}
 
 			this.CheckAndSave ();

--- a/VOID_EditorHUD.cs
+++ b/VOID_EditorHUD.cs
@@ -134,9 +134,9 @@
 
 		public override void DrawGUI()
 		{
-			SimManager.Instance.RequestSimulation();
-
-			if (SimManager.Instance.LastStage == null)
+			SimManager.RequestSimulation();
+
+			if (SimManager.LastStage == null)
 			{
 				return;
 			}
@@ -166,7 +166,7 @@
 			labelStyle.normal.textColor = textColors [ColorIndex];
 
 			hudString.Append("Total Mass: ");
-			hudString.Append(SimManager.Instance.LastStage.totalMass.ToString("F3"));
+			hudString.Append(SimManager.LastStage.totalMass.ToString("F3"));
 			hudString.Append('t');
 
 			hudString.Append(' ');
@@ -177,19 +177,19 @@
 			hudString.Append('\n');
 
 			hudString.Append("Total Delta-V: ");
-			hudString.Append(Tools.MuMech_ToSI(SimManager.Instance.LastStage.totalDeltaV));
+			hudString.Append(Tools.MuMech_ToSI(SimManager.LastStage.totalDeltaV));
 			hudString.Append("m/s");
 
 			hudString.Append('\n');
 
 			hudString.Append("Bottom Stage Delta-V");
-			hudString.Append(Tools.MuMech_ToSI(SimManager.Instance.LastStage.deltaV));
+			hudString.Append(Tools.MuMech_ToSI(SimManager.LastStage.deltaV));
 			hudString.Append("m/s");
 
 			hudString.Append('\n');
 
 			hudString.Append("Bottom Stage T/W Ratio: ");
-			hudString.Append(SimManager.Instance.LastStage.thrustToWeight.ToString("F3"));
+			hudString.Append(SimManager.LastStage.thrustToWeight.ToString("F3"));
 
 			if (this.CoMmarker.gameObject.activeInHierarchy && this.CoTmarker.gameObject.activeInHierarchy)
 			{

--- a/VOID_HUD.cs
+++ b/VOID_HUD.cs
@@ -20,6 +20,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
+using Engineer.VesselSimulator;
 using KSP;
 using UnityEngine;
 using System;
@@ -208,6 +209,11 @@
 
 			VOID_Core.Instance.LabelStyles["hud"].normal.textColor = textColors [ColorIndex];
 
+			if ((TimeWarp.WarpMode == TimeWarp.Modes.LOW) || (TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate))
+			{
+				SimManager.RequestSimulation();
+			}
+
 			this.leftHUDPos.value = GUI.Window(
 				VOID_Core.Instance.windowID,
 				this.leftHUDPos,
@@ -261,13 +267,13 @@
 			"Stage Mass Flow",
 			delegate()
 			{
-				if (simManager.LastStage == null)
+			if (SimManager.LastStage == null)
 				{
 					return double.NaN;
 				}
 
-				double stageIsp = simManager.LastStage.isp;
-				double stageThrust = simManager.LastStage.actualThrust;
+				double stageIsp = SimManager.LastStage.isp;
+				double stageThrust = SimManager.LastStage.actualThrust;
 
 				return stageThrust / (stageIsp * KerbinGee);
 			},
@@ -278,13 +284,13 @@
 			"Full burn time to complete at node",
 			delegate()
 			{
-				if (simManager.LastStage == null)
+			if (SimManager.LastStage == null)
 				{
 					return double.NaN;
 				}
 			    
 				double nextManeuverDV = core.vessel.patchedConicSolver.maneuverNodes[0].DeltaV.magnitude;
-				double stageThrust = simManager.LastStage.actualThrust;
+				double stageThrust = SimManager.LastStage.actualThrust;
 
 				return burnTime(nextManeuverDV, totalMass, stageMassFlow, stageThrust);
 			},
@@ -295,13 +301,13 @@
 			"Full burn time to be half done at node",
 			delegate()
 			{
-				if (simManager.LastStage == null)
+				if (SimManager.LastStage == null)
 				{
 					return double.NaN;
 				}
 			    
 				double nextManeuverDV = core.vessel.patchedConicSolver.maneuverNodes[0].DeltaV.magnitude / 2d;
-				double stageThrust = simManager.LastStage.actualThrust;
+				double stageThrust = SimManager.LastStage.actualThrust;
 
 				return burnTime(nextManeuverDV, totalMass, stageMassFlow, stageThrust);
 			},

--- a/VOID_Rendezvous.cs
+++ b/VOID_Rendezvous.cs
@@ -59,13 +59,13 @@
 			if (FlightGlobals.fetch.VesselTarget != null)
 			{
 				//a KSP Target (body or vessel) is selected
-				if (FlightGlobals.fetch.vesselTargetMode == FlightGlobals.VesselTargetModes.Direction)
+				if (FlightGlobals.fetch.vesselTargetMode == VesselTargetModes.Direction)
 				{
 					//a Body is selected
 					rendezbody = vessel.patchedConicSolver.targetBody;
 					display_rendezvous_info(null, rendezbody);
 				}
-				else if (FlightGlobals.fetch.vesselTargetMode == FlightGlobals.VesselTargetModes.DirectionAndVelocity)
+				else if (FlightGlobals.fetch.vesselTargetMode == VesselTargetModes.DirectionAndVelocity)
 				{
 					//a Vessel is selected
 					rendezvessel = FlightGlobals.fetch.VesselTarget.GetVessel();

--- a/VOID_VesselInfo.cs
+++ b/VOID_VesselInfo.cs
@@ -43,7 +43,7 @@
 
 			if ((TimeWarp.WarpMode == TimeWarp.Modes.LOW) || (TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate))
 			{
-				SimManager.Instance.RequestSimulation();
+				SimManager.RequestSimulation();
 			}
 
 			GUILayout.BeginVertical();
@@ -53,55 +53,29 @@
 				VOID_Core.Instance.LabelStyles["center_bold"],
 				GUILayout.ExpandWidth(true));
 
-			Tools.PostDebugMessage("Starting VesselInfo window.");
-
 			VOID_Data.geeForce.DoGUIHorizontal ("F2");
 
-			Tools.PostDebugMessage("GeeForce done.");
-
 			VOID_Data.partCount.DoGUIHorizontal ();
 
-			Tools.PostDebugMessage("PartCount done.");
-
 			VOID_Data.totalMass.DoGUIHorizontal ("F1");
 
-			Tools.PostDebugMessage("TotalMass done.");
-
 			VOID_Data.resourceMass.DoGUIHorizontal ("F1");
 
-			Tools.PostDebugMessage("ResourceMass done.");
-
 			VOID_Data.stageDeltaV.DoGUIHorizontal (3, false);
 
-			Tools.PostDebugMessage("Stage deltaV done.");
-
 			VOID_Data.totalDeltaV.DoGUIHorizontal (3, false);
 
-			Tools.PostDebugMessage("Total deltaV done.");
-
 			VOID_Data.mainThrottle.DoGUIHorizontal ("F0");
 
-			Tools.PostDebugMessage("MainThrottle done.");
-
 			VOID_Data.currmaxThrust.DoGUIHorizontal ();
 
-			Tools.PostDebugMessage("CurrMaxThrust done.");
-
 			VOID_Data.currmaxThrustWeight.DoGUIHorizontal ();
 
-			Tools.PostDebugMessage("CurrMaxTWR done.");
-
 			VOID_Data.surfaceThrustWeight.DoGUIHorizontal ("F2");
 
-			Tools.PostDebugMessage("surfaceTWR done.");
-
 			VOID_Data.intakeAirStatus.DoGUIHorizontal();
 
-			Tools.PostDebugMessage("intakeAirStatus done.");
-
 			GUILayout.EndVertical();
-
-			Tools.PostDebugMessage("VesselInfo window done.");
 
 			GUI.DragWindow();
 		}
@@ -123,7 +97,15 @@
 
 		public static readonly VOID_DoubleValue totalMass = new VOID_DoubleValue(
 			"Total Mass",
-			new Func<double> (() => SimManager.Instance.TryGetLastMass()),
+			delegate()
+		{
+			if (SimManager.LastStage == null)
+			{
+				return double.NaN;
+			}
+
+			return SimManager.LastStage.totalMass;
+		},
 			"tons"
 		);
 
@@ -145,11 +127,11 @@
 			"DeltaV (Current Stage)",
 			delegate()
 			{
-				if (SimManager.Instance.Stages == null ||
-					SimManager.Instance.Stages.Length <= Staging.lastStage
+				if (SimManager.Stages == null ||
+					SimManager.Stages.Length <= Staging.lastStage
 				)
 					return double.NaN;
-				return SimManager.Instance.Stages[Staging.lastStage].deltaV;
+				return SimManager.Stages[Staging.lastStage].deltaV;
 			},
 			"m/s"
 		);
@@ -158,9 +140,9 @@
 			"DeltaV (Total)",
 			delegate()
 			{
-				if (SimManager.Instance.Stages == null)
+				if (SimManager.Stages == null)
 					return double.NaN;
-				return SimManager.Instance.LastStage.totalDeltaV;
+				return SimManager.LastStage.totalDeltaV;
 			},
 			"m/s"
 		);
@@ -175,11 +157,11 @@
 			"Thrust (curr/max)",
 			delegate()
 			{
-				if (SimManager.Instance.Stages == null)
+				if (SimManager.Stages == null)
 					return "N/A";
 
-				double currThrust = SimManager.Instance.LastStage.actualThrust;
-				double maxThrust = SimManager.Instance.LastStage.thrust;
+				double currThrust = SimManager.LastStage.actualThrust;
+				double maxThrust = SimManager.LastStage.thrust;
 
 				return string.Format(
 					"{0} / {1}",
@@ -193,12 +175,12 @@
 			"T:W (curr/max)",
 			delegate()
 			{
-				if (SimManager.Instance.Stages == null)
+				if (SimManager.Stages == null || SimManager.LastStage == null)
 					return "N/A";
 
-				double currThrust = SimManager.Instance.LastStage.actualThrust;
-				double maxThrust = SimManager.Instance.LastStage.thrust;
-				double mass = SimManager.Instance.TryGetLastMass();
+				double currThrust = SimManager.LastStage.actualThrust;
+				double maxThrust = SimManager.LastStage.thrust;
+				double mass = SimManager.LastStage.totalMass;
 				double gravity = VOID_Core.Instance.vessel.mainBody.gravParameter /
 					Math.Pow(
 						VOID_Core.Instance.vessel.mainBody.Radius + VOID_Core.Instance.vessel.altitude,
@@ -218,11 +200,11 @@
 			"Max T:W @ surface",
 			delegate()
 			{
-				if (SimManager.Instance.Stages == null)
+			if (SimManager.Stages == null || SimManager.LastStage == null)
 					return double.NaN;
 
-				double maxThrust = SimManager.Instance.LastStage.thrust;
-				double mass = SimManager.Instance.TryGetLastMass();
+				double maxThrust = SimManager.LastStage.thrust;
+				double mass = SimManager.LastStage.totalMass;
 				double gravity = (VOID_Core.Constant_G * VOID_Core.Instance.vessel.mainBody.Mass) /
 					Math.Pow(VOID_Core.Instance.vessel.mainBody.Radius, 2);
 				double weight = mass * gravity;