VOID_DataValue: Reworked the way DoGUIHorizontal works, particularly the flow around the variable precision version. Use clicks to the label now instead of GUILayout.Button()s.
VOID_DataValue: Reworked the way DoGUIHorizontal works, particularly the flow around the variable precision version. Use clicks to the label now instead of GUILayout.Button()s.

--- a/VOIDFlightMaster.cs
+++ b/VOIDFlightMaster.cs
@@ -49,6 +49,7 @@
 			Tools.PostDebugMessage ("VOIDFlightMaster: Waking up.");
 			this.Core = (VOID_Core)VOID_Core.Instance;
 			this.Core.ResetGUI ();
+			SimManager.HardReset();
 			Tools.PostDebugMessage ("VOIDFlightMaster: Awake.");
 		}
 
@@ -68,13 +69,6 @@
 			}
 
 			this.Core.Update ();
-
-			if (this.Core.vessel != null)
-			{
-				SimManager.Instance.Gravity = VOID_Core.Instance.vessel.mainBody.gravParameter /
-					Math.Pow(VOID_Core.Instance.vessel.mainBody.Radius, 2);
-				SimManager.Instance.TryStartSimulation();
-			}
 
 			if (this.Core.factoryReset)
 			{
@@ -115,6 +109,7 @@
 			Tools.PostDebugMessage ("VOIDEditorMaster: Waking up.");
 			this.Core = VOID_EditorCore.Instance;
 			this.Core.ResetGUI ();
+			SimManager.HardReset();
 			Tools.PostDebugMessage ("VOIDEditorMaster: Awake.");
 		}
 

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -21,9 +21,9 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Reflection;
 using KSP;
 using UnityEngine;
+using Engineer.VesselSimulator;
 
 namespace VOID
 {
@@ -333,6 +333,13 @@
 		{
 			this.Preload_BeforeUpdate ();
 
+			if (this.vessel != null)
+			{
+				SimManager.Instance.Gravity = VOID_Core.Instance.vessel.mainBody.gravParameter /
+					Math.Pow(VOID_Core.Instance.vessel.mainBody.Radius, 2);
+				SimManager.Instance.TryStartSimulation();
+			}
+
 			if (!this.guiRunning)
 			{
 				this.StartGUI ();
@@ -427,6 +434,9 @@
 
 		protected void LoadGUIStyles()
 		{
+			this.LabelStyles["link"] = new GUIStyle(GUI.skin.label);
+			this.LabelStyles["link"].fontStyle = FontStyle.Bold;
+
 			this.LabelStyles["center"] = new GUIStyle(GUI.skin.label);
 			this.LabelStyles["center"].normal.textColor = Color.white;
 			this.LabelStyles["center"].alignment = TextAnchor.UpperCenter;
@@ -439,6 +449,10 @@
 			this.LabelStyles["right"] = new GUIStyle(GUI.skin.label);
 			this.LabelStyles["right"].normal.textColor = Color.white;
 			this.LabelStyles["right"].alignment = TextAnchor.UpperRight;
+
+			this.LabelStyles ["red"] = new GUIStyle(GUI.skin.label);
+			this.LabelStyles ["red"].normal.textColor = Color.red;
+			this.LabelStyles ["red"].alignment = TextAnchor.MiddleCenter;
 
 			this.GUIStylesLoaded = true;
 		}
@@ -501,10 +515,7 @@
 			}
 			else
 			{
-			    GUIStyle label_txt_red = new GUIStyle(GUI.skin.label);
-			    label_txt_red.normal.textColor = Color.red;
-			    label_txt_red.alignment = TextAnchor.MiddleCenter;
-			    GUILayout.Label("-- POWER LOST --", label_txt_red);
+			    GUILayout.Label("-- POWER LOST --", this.LabelStyles["red"]);
 			}
 
 			this.configWindowMinimized = !GUILayout.Toggle (!this.configWindowMinimized, "Configuration");
@@ -680,7 +691,7 @@
 
 			this.VOIDIconTexture = this.VOIDIconOff;  //icon off default
 			if (this.togglePower) this.VOIDIconTexture = this.VOIDIconOn;     //or on if power_toggle==true
-			if (GUI.Button(VOIDIconPos, VOIDIconTexture, new GUIStyle()) && this.VOIDIconLocked)
+			if (GUI.Button(VOIDIconPos, VOIDIconTexture) && this.VOIDIconLocked)
 			{
 				this.mainGuiMinimized = !this.mainGuiMinimized;
 			}

--- a/VOID_DataValue.cs
+++ b/VOID_DataValue.cs
@@ -122,7 +122,15 @@
 		public abstract string ToSIString(int digits = 3, int MinMagnitude = 0, int MaxMagnitude = int.MaxValue);
 
 		public abstract string ValueUnitString(string format);
-		public abstract string ValueUnitString(ushort digits);
+		
+		public virtual string ValueUnitString(int digits) {
+			return Tools.MuMech_ToSI(this.ToDouble(), digits) + this.Units;
+		}
+
+		public virtual string ValueUnitString(int digits, int MinMagnitude, int MaxMagnitude)
+		{
+			return Tools.MuMech_ToSI(this.ToDouble(), digits, MinMagnitude, MaxMagnitude) + this.Units;
+		}
 
 		public virtual void DoGUIHorizontal(string format)
 		{
@@ -133,22 +141,58 @@
 			GUILayout.EndHorizontal ();
 		}
 
-		public virtual ushort DoGUIHorizontal(ushort digits, bool precisionButton = true)
-		{
+		public virtual int DoGUIHorizontal(int digits, bool precisionButton = true)
+		{
+			if (precisionButton)
+			{
+				return this.DoGUIHorizontalPrec(digits);
+			}
+
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
-			GUILayout.Label(this.Label + ":", GUILayout.ExpandWidth(true));
+			GUILayout.Label(this.Label + " (P" + digits + "):", GUILayout.ExpandWidth(true));
 			GUILayout.FlexibleSpace();
 			GUILayout.Label(this.ValueUnitString(digits), GUILayout.ExpandWidth(false));
-			if (precisionButton)
+			GUILayout.EndHorizontal();
+
+			return digits;
+		}
+
+		public virtual int DoGUIHorizontalPrec(int digits)
+		{
+			float magnitude;
+			float magLimit;
+
+			magnitude = (float)Math.Log10(Math.Abs(this.ToDouble()));
+
+			magLimit = Mathf.Max(magnitude, 6f);
+			magLimit = Mathf.Round((float)Math.Ceiling(magLimit / 3f) * 3f);
+
+			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));
+			GUILayout.EndHorizontal();
+
+			if (Event.current.type == EventType.mouseUp)
 			{
-				if (GUILayout.Button (digits.ToString()))
+				Rect lastRect = GUILayoutUtility.GetLastRect();
+				if (lastRect.Contains(Event.current.mousePosition))
 				{
-					float magnitude = Math.Max((float)Math.Log10(Math.Abs(this.ToDouble())), 6f);
-					magnitude = (float)Math.Ceiling (magnitude / 3f) * 3f;
-					digits = (ushort)((digits + 3) % (int)magnitude);
+					if (Event.current.button == 0)
+					{
+						digits = (digits + 3) % (int)magLimit;
+					}
+					else if (Event.current.button == 1)
+					{
+						digits = (digits - 3) % (int)magLimit;
+						if (digits < 0)
+						{
+							digits = (int)magLimit - 3;
+						}
+					}
 				}
 			}
-			GUILayout.EndHorizontal();
 
 			return digits;
 		}
@@ -177,11 +221,6 @@
 			return this.Value.ToString(format) + this.Units;
 		}
 
-		public override string ValueUnitString(ushort digits) {
-			int magnitude = (int)Math.Log10(Math.Abs(this.Value));
-			return Tools.MuMech_ToSI(this.Value, 2, int.MinValue, magnitude - digits) + this.Units;
-		}
-
 		public override string ToSIString(int digits = 3, int MinMagnitude = 0, int MaxMagnitude = int.MaxValue)
 		{
 			return string.Format (
@@ -202,11 +241,6 @@
 
 		public override string ValueUnitString(string format) {
 			return this.Value.ToString(format) + this.Units;
-		}
-
-		public override string ValueUnitString(ushort digits) {
-			int magnitude = Math.Max((int)Math.Log10(Math.Abs(this.Value)), 0);
-			return Tools.MuMech_ToSI(this.Value, 2, int.MinValue, magnitude - digits) + this.Units;
 		}
 
 		public override string ToString(string format)
@@ -241,11 +275,6 @@
 			return this.Value.ToString(format) + this.Units;
 		}
 
-		public override string ValueUnitString(ushort digits) {
-			int magnitude = (int)Math.Log10(Math.Abs(this.Value));
-			return Tools.MuMech_ToSI(this.Value, 2, int.MinValue, magnitude - digits) + this.Units;
-		}
-
 		public override string ToString(string format)
 		{
 			return string.Format (

--- a/VOID_VesselInfo.cs
+++ b/VOID_VesselInfo.cs
@@ -22,6 +22,7 @@
 using System;
 using System.Collections.Generic;
 using UnityEngine;
+using Engineer.VesselSimulator;
 
 namespace VOID
 {
@@ -66,9 +67,11 @@
 			"DeltaV (Current Stage)",
 			delegate()
 			{
-				if (Engineer.VesselSimulator.SimManager.Instance.Stages == null)
+				if (SimManager.Instance.Stages == null ||
+			    	SimManager.Instance.Stages.Length <= Staging.lastStage
+			    )
 					return double.NaN;
-				return Engineer.VesselSimulator.SimManager.Instance.Stages[Staging.lastStage].deltaV;
+				return SimManager.Instance.Stages[Staging.lastStage].deltaV;
 			},
 			"m/s"
 		);
@@ -77,9 +80,9 @@
 			"DeltaV (Total)",
 			delegate()
 			{
-				if (Engineer.VesselSimulator.SimManager.Instance.Stages == null)
+				if (SimManager.Instance.Stages == null)
 					return double.NaN;
-				return Engineer.VesselSimulator.SimManager.Instance.LastStage.totalDeltaV;
+				return SimManager.Instance.LastStage.totalDeltaV;
 			},
 			"m/s"
 		);
@@ -94,11 +97,11 @@
 			"Thrust (curr/max)",
 			delegate()
 			{
-				if (Engineer.VesselSimulator.SimManager.Instance.Stages == null)
+				if (SimManager.Instance.Stages == null)
 					return "N/A";
 
-				double currThrust = Engineer.VesselSimulator.SimManager.Instance.LastStage.actualThrust;
-				double maxThrust = Engineer.VesselSimulator.SimManager.Instance.LastStage.thrust;
+				double currThrust = SimManager.Instance.LastStage.actualThrust;
+				double maxThrust = SimManager.Instance.LastStage.thrust;
 
 				return string.Format(
 					"{0} / {1}",
@@ -112,11 +115,11 @@
 			"T:W (curr/max)",
 			delegate()
 			{
-				if (Engineer.VesselSimulator.SimManager.Instance.Stages == null)
+				if (SimManager.Instance.Stages == null)
 					return "N/A";
 
-				double currThrust = Engineer.VesselSimulator.SimManager.Instance.LastStage.actualThrust;
-				double maxThrust = Engineer.VesselSimulator.SimManager.Instance.LastStage.thrust;
+				double currThrust = SimManager.Instance.LastStage.actualThrust;
+				double maxThrust = SimManager.Instance.LastStage.thrust;
 				double mass = VOID_Core.Instance.vessel.GetTotalMass();
 				double gravity = VOID_Core.Instance.vessel.mainBody.gravParameter /
 				                 Math.Pow(
@@ -137,10 +140,10 @@
 			"Max T:W @ surface",
 			delegate()
 			{
-				if (Engineer.VesselSimulator.SimManager.Instance.Stages == null)
+				if (SimManager.Instance.Stages == null)
 					return double.NaN;
 
-				double maxThrust = Engineer.VesselSimulator.SimManager.Instance.LastStage.thrust;
+				double maxThrust = SimManager.Instance.LastStage.thrust;
 				double mass = VOID_Core.Instance.vessel.GetTotalMass();
 				double gravity = (VOID_Core.Constant_G * VOID_Core.Instance.vessel.mainBody.Mass) /
 				                 Math.Pow(VOID_Core.Instance.vessel.mainBody.Radius, 2);
@@ -165,10 +168,10 @@
 
 			if ((TimeWarp.WarpMode == TimeWarp.Modes.LOW) || (TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate))
 			{
-				Engineer.VesselSimulator.SimManager.Instance.RequestSimulation();
+				SimManager.Instance.RequestSimulation();
 			}
 
-			Engineer.VesselSimulator.Stage[] stages = Engineer.VesselSimulator.SimManager.Instance.Stages;
+			Stage[] stages = SimManager.Instance.Stages;
 
 			GUILayout.BeginVertical();