Merge branch 'master' into dev-EditorTWR
Merge branch 'master' into dev-EditorTWR

--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -39,7 +39,7 @@
 // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
 // The form "{Major}.{Minor}.*" will automatically update the build and revision,
 // and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion("0.11.0.*")]
+[assembly: AssemblyVersion("0.12.0.*")]
 // The following attributes are used to specify the signing key for the assembly,
 // if desired. See the Mono documentation for more information about signing.
 //[assembly: AssemblyDelaySign(false)]

--- a/VOID.csproj
+++ b/VOID.csproj
@@ -9,6 +9,7 @@
     <RootNamespace>VOID</RootNamespace>
     <AssemblyName>VOID</AssemblyName>
     <CodePage>65001</CodePage>
+    <UseMSBuildEngine>False</UseMSBuildEngine>
     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ReleaseVersion>0.11</ReleaseVersion>

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -81,7 +81,7 @@
 		 * Fields
 		 * */
 		protected string VoidName = "VOID";
-		protected string VoidVersion = "0.11.0";
+		protected string VoidVersion;
 
 		protected bool _factoryReset = false;
 
@@ -992,6 +992,10 @@
 		{
 			this._Name = "VOID Core";
 
+			System.Version version = this.GetType().Assembly.GetName().Version;
+
+			this.VoidVersion = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.MajorRevision);
+
 			this._Active.value = true;
 
 			this._skinName = this.defaultSkin;

--- a/VOID_EditorTWR.cs
+++ b/VOID_EditorTWR.cs
@@ -24,9 +24,21 @@
 
 		public override void ModuleWindow(int _)
 		{
+			if (Event.current.type != EventType.Layout)
+			{
+				return;
+			}
+
+			Engineer.VesselSimulator.SimManager.RequestSimulation();
+
+			GUILayout.Label(
+				this._Name,
+				VOID_EditorCore.Instance.LabelStyles["center_bold"],
+				GUILayout.ExpandWidth(true));
+
 			if (bodyGeeValues == null)
 			{
-				if (FlightGlobals.ready && FlightGlobals.Bodies != null && FlightGlobals.Bodies.Count > 0)
+				if (FlightGlobals.Bodies != null && FlightGlobals.Bodies.Count > 0)
 				{
 					this.bodyGeeValues = new Dictionary<string, double>();
 
@@ -43,28 +55,36 @@
 				}
 				else
 				{
-					return;
+					GUILayout.BeginVertical();
+					GUILayout.BeginHorizontal();
+					GUILayout.Label("Unavailable.");
+					GUILayout.EndHorizontal();
+					GUILayout.EndVertical();
 				}
 			}
+			else
+			{
+				GUILayout.BeginVertical();
 
-			GUILayout.BeginVertical();
+				foreach (CelestialBody body in this.sortedBodyList)
+				{
+					Tools.PostDebugMessage(this, "Doing label for {0}", body.bodyName);
+					GUILayout.BeginHorizontal();
 
-			foreach (CelestialBody body in this.sortedBodyList)
-			{
-				Tools.PostDebugMessage(this, "Doing label for {0}", body.bodyName);
-				GUILayout.BeginHorizontal();
+					GUILayout.Label(body.bodyName);
+					GUILayout.FlexibleSpace();
+					GUILayout.Label(
+						(VOID_Data.currThrustWeight.Value / this.bodyGeeValues[body.bodyName]).ToString("0.0##"),
+						GUILayout.ExpandWidth(true)
+					);
 
-				GUILayout.Label(body.bodyName);
-				GUILayout.FlexibleSpace();
-				GUILayout.Label(
-					(VOID_Data.currThrustWeight.Value / this.bodyGeeValues[body.bodyName]).ToString("#.0##"),
-					GUILayout.ExpandWidth(true)
-				);
+					GUILayout.EndHorizontal();
+				}
 
-				GUILayout.EndHorizontal();
+				GUILayout.EndVertical();
 			}
 
-			GUILayout.EndVertical();
+			GUI.DragWindow();
 		}
 	}
 
@@ -145,6 +165,23 @@
 			return 0;
 		}
 	}
+
+	public static partial class VOID_Data
+	{
+		public static readonly VOID_DoubleValue nominalThrustWeight = new VOID_DoubleValue(
+			"Thrust-to-Weight Ratio",
+			delegate()
+		{
+			if (HighLogic.LoadedSceneIsEditor || currThrustWeight.Value == 0d)
+			{
+				return maxThrustWeight.Value;
+			}
+
+			return currThrustWeight.Value;
+		},
+			""
+		);
+	}
 }
 
 

--- a/VOID_HUDAdvanced.cs
+++ b/VOID_HUDAdvanced.cs
@@ -249,7 +249,7 @@
 					this.rightHUDPos.value = GUI.Window(
 						VOID_Core.Instance.windowID,
 						this.rightHUDPos,
-						VOID_Tools.GetWindowHandler(this.leftHUDWindow),
+						VOID_Tools.GetWindowHandler(this.rightHUDWindow),
 						GUIContent.none,
 						GUIStyle.none
 					);
@@ -589,6 +589,11 @@
 			}
 
 			double interval = (node.UT - currentNodeBurnDuration) - Planetarium.GetUniversalTime();
+
+			if (double.IsNaN(interval))
+			{
+				return string.Intern("NaN");
+			}
 
 			int sign = Math.Sign(interval);
 			interval = Math.Abs(interval);

--- a/VOID_VesselInfo.cs
+++ b/VOID_VesselInfo.cs
@@ -66,7 +66,7 @@
 
 			VOID_Data.totalMass.DoGUIHorizontal ("F3");
 
-			VOID_Data.resourceMass.DoGUIHorizontal ("F3");
+			VOID_Data.comboResourceMass.DoGUIHorizontal ();
 
 			VOID_Data.stageDeltaV.DoGUIHorizontal (3, false);
 
@@ -128,6 +128,28 @@
 				return SimManager.LastStage.totalMass - SimManager.LastStage.totalBaseMass;
 			},
 			"tons"
+		);
+
+		public static readonly VOID_DoubleValue stageResourceMass = new VOID_DoubleValue(
+			"Resource Mass (Current Stage)",
+			delegate()
+			{
+				if (SimManager.LastStage == null)
+				{
+					return double.NaN;
+				}
+
+				return SimManager.LastStage.mass - SimManager.LastStage.baseMass;
+			},
+			"tons"
+		);
+
+		public static readonly VOID_StrValue comboResourceMass = new VOID_StrValue(
+			"Resource Mass (curr / total)",
+			delegate()
+		{
+			return string.Format("{0} / {1}", stageResourceMass.ValueUnitString(), resourceMass.ValueUnitString());
+		}
 		);
 
 		public static readonly VOID_DoubleValue stageDeltaV = new VOID_DoubleValue(