VOID_HUD: Some basic restructuring of the current HUD panes. Added some new values to VOID_Data that might be useful for some new HUD elements.
VOID_HUD: Some basic restructuring of the current HUD panes. Added some new values to VOID_Data that might be useful for some new HUD elements.

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -978,6 +978,33 @@
 			Active = 8
 		}
 	}
+
+	public static partial class VOID_Data
+	{
+		public static VOID_Core core
+		{
+			get
+			{
+				return VOID_Core.Instance;
+			}
+		}
+
+		public static Engineer.VesselSimulator.SimManager simManager
+		{
+			get
+			{
+				return Engineer.VesselSimulator.SimManager.Instance;
+			}
+		}
+
+		public static double KerbinGee
+		{
+			get
+			{
+				return core.Kerbin.gravParameter / Math.Pow(core.Kerbin.Radius, 2);
+			}
+		}
+	}
 }
 
 

--- a/VOID_EditorCore.cs
+++ b/VOID_EditorCore.cs
@@ -122,8 +122,7 @@
 
 			if (EditorLogic.SortedShipList.Count > 0)
 			{
-				SimManager.Instance.Gravity = this.Kerbin.gravParameter /
-					Math.Pow(this.Kerbin.Radius, 2);
+				SimManager.Instance.Gravity = VOID_Data.KerbinGee;
 				SimManager.Instance.TryStartSimulation();
 			}
 

--- a/VOID_HUD.cs
+++ b/VOID_HUD.cs
@@ -93,10 +93,7 @@
 			this.textColors.Add(Color.cyan);
 			this.textColors.Add(Color.magenta);
 
-			VOID_Core.Instance.LabelStyles["hud"] = new GUIStyle();
-			VOID_Core.Instance.LabelStyles["hud"].normal.textColor = this.textColors [this.ColorIndex];
-
-			this.leftHUDdefaultPos = new Rect(Screen.width * .2083f, 0f, 300f, 90f);
+			this.leftHUDdefaultPos = new Rect(Screen.width * .375f - 300f, 0f, 300f, 90f);
 			this.leftHUDPos = new Rect(this.leftHUDdefaultPos);
 
 			this.rightHUDdefaultPos = new Rect(Screen.width * .625f, 0f, 300f, 90f);
@@ -113,9 +110,15 @@
 
 			leftHUD = new StringBuilder();
 
+			VOID_Core.Instance.LabelStyles["hud"].alignment = TextAnchor.UpperRight;
+
 			if (VOID_Core.Instance.powerAvailable)
 			{
-				leftHUD.AppendFormat("Obt Alt: {0} Obt Vel: {1}",
+				leftHUD.AppendFormat("Primary: {0} Inc: {1}",
+					VOID_Data.primaryName.ValueUnitString(),
+					VOID_Data.orbitInclination.ValueUnitString("F3")
+				);
+				leftHUD.AppendFormat("\nObt Alt: {0} Obt Vel: {1}",
 					VOID_Data.orbitAltitude.ToSIString(),
 					VOID_Data.orbitVelocity.ToSIString()
 				);
@@ -127,20 +130,21 @@
 					VOID_Data.oribtPeriAlt.ToSIString(),
 					VOID_Data.timeToPeri.ValueUnitString()
 				);
-				leftHUD.AppendFormat("\nInc: {0}", VOID_Data.orbitInclination.ValueUnitString("F3"));
-				leftHUD.AppendFormat("\nPrimary: {0}", VOID_Data.primaryName.ValueUnitString());
-
-				GUILayout.Label(leftHUD.ToString(), VOID_Core.Instance.LabelStyles["hud"], GUILayout.ExpandWidth(true));
 			}
 			else
 			{
+				VOID_Core.Instance.LabelStyles["hud"].normal.textColor = Color.red;
 				leftHUD.Append(string.Intern("-- POWER LOST --"));
 			}
 
+			GUILayout.Label(leftHUD.ToString(), VOID_Core.Instance.LabelStyles["hud"], GUILayout.ExpandWidth(true));
+
 			if (!this.positionsLocked)
 			{
 				GUI.DragWindow();
 			}
+
+			GUI.BringWindowToBack(id);
 		}
 
 		protected void rightHUDWindow(int id)
@@ -148,6 +152,8 @@
 			StringBuilder rightHUD;
 
 			rightHUD = new StringBuilder();
+
+			VOID_Core.Instance.LabelStyles["hud"].alignment = TextAnchor.UpperLeft;
 
 			if (VOID_Core.Instance.powerAvailable)
 			{
@@ -171,6 +177,7 @@
 			}
 			else
 			{
+				VOID_Core.Instance.LabelStyles["hud"].normal.textColor = Color.red;
 				rightHUD.Append(string.Intern("-- POWER LOST --"));
 			}
 
@@ -181,13 +188,18 @@
 			{
 				GUI.DragWindow();
 			}
+
+			GUI.BringWindowToBack(id);
 		}
 
 		public override void DrawGUI()
 		{
+			if (!VOID_Core.Instance.LabelStyles.ContainsKey("hud"))
+			{
+				VOID_Core.Instance.LabelStyles["hud"] = new GUIStyle(GUI.skin.label);
+			}
+
 			VOID_Core.Instance.LabelStyles["hud"].normal.textColor = textColors [ColorIndex];
-
-			// GUI.skin = VOID_Core.Instance.Skin;
 
 			this.leftHUDPos = GUI.Window(
 				VOID_Core.Instance.windowID,
@@ -200,7 +212,7 @@
 			this.rightHUDPos = GUI.Window(
 				VOID_Core.Instance.windowID,
 				this.rightHUDPos,
-				this.leftHUDWindow,
+				this.rightHUDWindow,
 				GUIContent.none,
 				GUIStyle.none
 			);
@@ -208,12 +220,12 @@
 
 		public override void DrawConfigurables()
 		{
-			if (GUILayout.Button ("Change HUD color", GUILayout.ExpandWidth (false)))
+			if (GUILayout.Button (string.Intern("Change HUD color"), GUILayout.ExpandWidth (false)))
 			{
 				++this.ColorIndex;
 			}
 
-			if (GUILayout.Button("Reset HUD Positions", GUILayout.ExpandWidth(false)))
+			if (GUILayout.Button(string.Intern("Reset HUD Positions"), GUILayout.ExpandWidth(false)))
 			{
 				this.leftHUDPos = new Rect(this.leftHUDdefaultPos);
 				this.rightHUDPos = new Rect(this.rightHUDdefaultPos);
@@ -231,6 +243,62 @@
 			"Situation",
 			new Func<string> (() => VOID_Core.Instance.vessel.GetExperimentSituation().HumanString())
 		);
+
+		public static VOID_DoubleValue stageMassFlow = new VOID_DoubleValue(
+			"Stage Mass Flow",
+			delegate()
+			{
+				if (simManager.LastStage == null)
+				{
+					return double.NaN;
+				}
+
+				double stageIsp = simManager.LastStage.isp;
+				double stageThrust = simManager.LastStage.actualThrust;
+
+				return stageThrust / (stageIsp * KerbinGee);
+			},
+			"Mg/s"
+		);
+
+		public static VOID_DoubleValue burnTimeCompleteAtNode = new VOID_DoubleValue(
+			"Full burn time to complete at node",
+			delegate()
+			{
+				if (simManager.LastStage == null)
+				{
+					return double.NaN;
+				}
+			    
+				double nextManeuverDV = core.vessel.patchedConicSolver.maneuverNodes[0].DeltaV.magnitude;
+				double stageThrust = simManager.LastStage.actualThrust;
+
+				return burnTime(nextManeuverDV, totalMass, stageMassFlow, stageThrust);
+			},
+			"s"
+		);
+
+		public static VOID_DoubleValue burnTimeHalfDoneAtNode = new VOID_DoubleValue(
+			"Full burn time to be half done at node",
+			delegate()
+			{
+				if (simManager.LastStage == null)
+				{
+					return double.NaN;
+				}
+			    
+				double nextManeuverDV = core.vessel.patchedConicSolver.maneuverNodes[0].DeltaV.magnitude / 2d;
+				double stageThrust = simManager.LastStage.actualThrust;
+
+				return burnTime(nextManeuverDV, totalMass, stageMassFlow, stageThrust);
+			},
+			"s"
+		);
+
+		protected static double burnTime(double deltaV, double initialMass, double massFlow, double thrust)
+		{
+			return initialMass / massFlow * (Math.Exp(deltaV * massFlow / thrust) - 1d);
+		}
 	}
 }