VOID_Module: Added a 'close button' window decoration that works via Mythical Hacking. Also got rid of some noisy debug cruft.
VOID_Module: Added a 'close button' window decoration that works via Mythical Hacking. Also got rid of some noisy debug cruft.

--- a/API/VOID_Module.cs
+++ b/API/VOID_Module.cs
@@ -142,15 +142,6 @@
 		{
 			get
 			{
-
-				Tools.PostDebugMessage(
-					this,
-					"Checking if scene is valid: LoadedScene={0}, ValidScenes={1}, inValidScene={2}",
-					Enum.GetName(typeof(GameScenes), HighLogic.LoadedScene),
-					string.Join(", ", this.ValidScenes.Select(s => Enum.GetName(typeof(GameScenes), s)).ToArray()),
-					this.ValidScenes.Contains(HighLogic.LoadedScene)
-				);
-
 				return this.ValidScenes.Contains(HighLogic.LoadedScene);
 			}
 		}
@@ -199,15 +190,6 @@
 		{
 			get
 			{
-
-				Tools.PostDebugMessage(
-					this,
-					"Checking if mode is valid: CurrentGame.Mode={0}, ValidModes={1}, inValidGame={2}",
-					Enum.GetName(typeof(Game.Modes), HighLogic.CurrentGame.Mode),
-					string.Join(", ", this.ValidModes.Select(m => Enum.GetName(typeof(Game.Modes), m)).ToArray()),
-					this.ValidModes.Contains(HighLogic.CurrentGame.Mode)
-				);
-
 				return this.ValidModes.Contains(HighLogic.CurrentGame.Mode);
 			}
 		}
@@ -432,6 +414,8 @@
 
 		protected string inputLockName;
 
+		private GUIContent closeButton;
+
 		public VOID_WindowModule() : base()
 		{
 			this.defWidth = 250f;
@@ -453,7 +437,7 @@
 			_Pos = GUILayout.Window(
 				this.core.windowID,
 				_Pos,
-				VOID_Tools.GetWindowHandler(this.ModuleWindow),
+				VOID_Tools.GetWindowHandler(this.DecoratedWindow),
 				this.Name,
 				GUILayout.Width(this.defWidth),
 				GUILayout.Height(this.defHeight),
@@ -520,6 +504,35 @@
 				this.core.configDirty = true;
 			}
 		}
+
+		private void DecoratedWindow(int id)
+		{
+			this.ModuleWindow(id);
+
+			if (this.closeButton == null)
+			{
+				this.closeButton = new GUIContent("X");
+			}
+
+			Rect closeRect = GUILayoutUtility.GetRect(
+				this.closeButton,
+				this.core.Skin.button,
+				GUILayout.ExpandWidth(false)
+			);
+
+			closeRect.x = this.WindowPos.width - closeRect.width - this.core.Skin.button.margin.right;
+			closeRect.y = this.core.Skin.button.margin.top;
+
+			GUI.Button(closeRect, closeButton, this.core.Skin.button);
+
+			if (Event.current.type == EventType.repaint && Input.GetMouseButtonUp(0))
+			{
+				if (closeRect.Contains(Event.current.mousePosition))
+				{
+					this.toggleActive = false;
+				}
+			}
+		}
 	}
 }
 

--- a/VOID_Data.cs
+++ b/VOID_Data.cs
@@ -1150,6 +1150,50 @@
 				"°"
 			);
 
+		public static readonly VOID_StrValue timeToAscendingNode =
+			new VOID_StrValue(
+				"Time to Ascending Node",
+				delegate()
+				{
+					double trueAnomalyAscNode = 360d - argumentPeriapsis;
+					double dTAscNode = Core.vessel.orbit.GetDTforTrueAnomaly(
+						trueAnomalyAscNode * Mathf.Deg2Rad,
+						Core.vessel.orbit.period
+					);
+
+					dTAscNode %= Core.vessel.orbit.period;
+
+					if (dTAscNode < 0d)
+					{
+						dTAscNode += Core.vessel.orbit.period;
+					}
+
+					return VOID_Tools.FormatInterval(dTAscNode);
+				}
+			);
+
+		public static readonly VOID_StrValue timeToDescendingNode =
+			new VOID_StrValue(
+				"Time to Descending Node",
+				delegate()
+				{
+					double trueAnomalyAscNode = 180d - argumentPeriapsis;
+					double dTDescNode = Core.vessel.orbit.GetDTforTrueAnomaly(
+						trueAnomalyAscNode * Mathf.Deg2Rad,
+						Core.vessel.orbit.period
+					);
+
+					dTDescNode %= Core.vessel.orbit.period;
+
+					if (dTDescNode < 0d)
+					{
+						dTDescNode += Core.vessel.orbit.period;
+					}
+
+					return VOID_Tools.FormatInterval(dTDescNode);
+				}
+			);
+
 		public static readonly VOID_DoubleValue localSiderealLongitude =
 			new VOID_DoubleValue(
 				"Local Sidereal Longitude",
@@ -1171,7 +1215,17 @@
 		public static readonly VOID_StrValue currBiome =
 			new VOID_StrValue(
 				"Biome",
-				new Func<string>(() => VOID_Tools.GetBiome(Core.vessel).name)
+				delegate()
+				{
+					if (Core.vessel.landedAt == string.Empty)
+					{
+						return VOID_Tools.GetBiome(Core.vessel).name;
+					}
+					else
+					{
+						return Core.vessel.landedAt;
+					}
+				}
 			);
 
 		#endregion

--- a/VOID_Orbital.cs
+++ b/VOID_Orbital.cs
@@ -98,6 +98,10 @@
 
 				VOID_Data.longitudeAscNode.DoGUIHorizontal("F3");
 
+				VOID_Data.timeToAscendingNode.DoGUIHorizontal();
+
+				VOID_Data.timeToDescendingNode.DoGUIHorizontal();
+
 				VOID_Data.argumentPeriapsis.DoGUIHorizontal("F3");
 
 				VOID_Data.localSiderealLongitude.DoGUIHorizontal("F3");

--- a/VOID_StageInfo.cs
+++ b/VOID_StageInfo.cs
@@ -26,11 +26,14 @@
 		private Table.Column<double> stageTotalMassCol;
 		private Table.Column<double> stageThrustCol;
 		private Table.Column<double> stageTWRCol;
+		private Table.Column<string> stageTimeCol;
 
 		private bool stylesApplied;
+
 		private bool showBodyList;
-
 		private Rect bodyListPos;
+
+		private bool showColumnSelection;
 
 		private CelestialBody selectedBody;
 		[AVOID_SaveValue("bodyIdx")]
@@ -45,6 +48,7 @@
 
 			this.stylesApplied = false;
 			this.showBodyList = false;
+			this.showColumnSelection = false;
 
 			this.bodyListPos = new Rect();
 
@@ -80,6 +84,9 @@
 			this.stageTWRCol = new Table.Column<double>("T/W Ratio", 20f);
 			this.stageTWRCol.Format = "#.#";
 			this.stageTable.Add(this.stageTWRCol);
+
+			this.stageTimeCol = new Table.Column<string>("Burn Time", 20f);
+			this.stageTable.Add(this.stageTimeCol);
 		}
 
 		public override void DrawGUI()
@@ -140,6 +147,8 @@
 
 				this.stageThrustCol.Add(stage.thrust * 1000f);
 				this.stageTWRCol.Add(stage.thrustToWeight / (this.selectedBody ?? core.HomeBody).GeeASL);
+
+				this.stageTimeCol.Add(VOID_Tools.FormatInterval(stage.time));
 			}
 
 			this.stageTable.Render();
@@ -204,6 +213,15 @@
 			GUI.DragWindow();
 		}
 
+		public override void DrawConfigurables()
+		{
+			this.showColumnSelection = GUILayout.Toggle(
+				this.showColumnSelection,
+				"Select StageInfo Columns",
+				GUI.skin.button
+			);
+		}
+
 		private void BodyPickerWindow(int _)
 		{
 			foreach (CelestialBody body in core.sortedBodyList)