VOID_DataLogger: Added 'wait for launch' option.
VOID_DataLogger: Added 'wait for launch' option.

--- a/API/VOID_HUDModule.cs
+++ b/API/VOID_HUDModule.cs
@@ -133,9 +133,7 @@
 				}
 			}
 
-			this.positionsLocked = GUILayout.Toggle(this.positionsLocked,
-				string.Intern("Lock HUD Positions"),
-				GUILayout.ExpandWidth(false));
+			this.positionsLocked = GUITools.Toggle(this.positionsLocked, "Lock HUD Positions");
 		}
 
 		public override void LoadConfig()

--- a/Tools/VOID_Tools.cs
+++ b/Tools/VOID_Tools.cs
@@ -518,7 +518,7 @@
 			{
 				string format = "Y{0:#0}, D{1:#0} {2:00}:{3:00}:{4:00.0}s";
 
-				return string.Format(format, years + 1, days, hours, minutes, seconds);
+				return string.Format(format, years + 1, days + 1, hours, minutes, seconds);
 			}
 
 			public UnpackedTime(int years, int days, int hours, int minutes, double seconds)

--- a/VOIDCore_Flight.cs
+++ b/VOIDCore_Flight.cs
@@ -29,6 +29,7 @@
 using KSP;
 using System;
 using UnityEngine;
+using ToadicusTools;
 
 namespace VOID
 {
@@ -44,7 +45,7 @@
 		{
 			if (HighLogic.LoadedSceneIsFlight)
 			{
-				this.consumeResource.value = GUILayout.Toggle(this.consumeResource, "Consume Resources");
+				this.consumeResource.value = GUITools.Toggle(this.consumeResource, "Consume Resources");
 			}
 
 			base.DrawConfigurables();

--- a/VOIDCore_Generic.cs
+++ b/VOIDCore_Generic.cs
@@ -118,6 +118,7 @@
 				"SSUITextAreaDefault",
 				"ExperimentsDialogSkin",
 				"ExpRecoveryDialogSkin",
+				"KSP window 1",
 				"KSP window 5",
 				"KSP window 6",
 				"PartTooltipSkin",
@@ -393,8 +394,10 @@
 					_mainWindowPos,
 					VOID_Tools.GetWindowHandler(this.VOIDMainWindow),
 					string.Join(" ", new string[] { this.VoidName, this.VoidVersion }),
-					GUILayout.Width(250),
-					GUILayout.Height(50)
+					GUILayout.Width(250f),
+					GUILayout.Height(50f),
+					GUILayout.ExpandWidth(true),
+					GUILayout.ExpandHeight(true)
 				);
 
 				if (HighLogic.LoadedSceneIsEditor)
@@ -468,27 +471,6 @@
 
 			foreach (IVOID_Module module in this.Modules)
 			{
-				Tools.PostDebugMessage(
-					this,
-					"\n\tmodule.Name={0}" +
-					"\n\tmodule.guiRunning={1}" +
-					"\n\tmodule.toggleActive={2}" +
-					"\n\tmodule.inValidScene={3}" +
-					"\n\tthis.togglePower={4}" +
-					"\n\tthis.factoryReset={5}" +
-					"\n\tHighLogic.LoadedSceneIsEditor={6}" +
-					"\n\t(EditorLogic.RootPart != null && EditorLogic.SortedShipList.Count > 0)={7}" +
-					"\n\t(EditorLogic.RootPart == null || EditorLogic.SortedShipList.Count == 0)={8}",
-					module.Name,
-					module.guiRunning,
-					module.toggleActive,
-					module.inValidScene,
-					this.togglePower,
-					this.factoryReset,
-					HighLogic.LoadedSceneIsEditor,
-					(EditorLogic.RootPart != null && EditorLogic.SortedShipList.Count > 0),
-					(EditorLogic.RootPart == null || EditorLogic.SortedShipList.Count == 0)
-				);
 				if (
 					!module.guiRunning &&
 					module.toggleActive &&
@@ -624,7 +606,7 @@
 				{
 					foreach (IVOID_Module module in this.Modules)
 					{
-						module.toggleActive = GUILayout.Toggle(module.toggleActive, module.Name);
+						module.toggleActive = GUITools.Toggle(module.toggleActive, module.Name);
 					}
 				}
 			}
@@ -633,7 +615,7 @@
 				GUILayout.Label("-- POWER LOST --", VOID_Styles.labelRed);
 			}
 
-			this.configWindowMinimized.value = !GUILayout.Toggle(!this.configWindowMinimized, "Configuration");
+			this.configWindowMinimized.value = !GUITools.Toggle(!this.configWindowMinimized, "Configuration");
 
 			GUILayout.EndVertical();
 			GUI.DragWindow();
@@ -653,9 +635,9 @@
 		{
 			GUIContent _content;
 
-			this.UseToolbarManager = GUILayout.Toggle(this.UseToolbarManager, "Use Blizzy's Toolbar If Available");
-
-			this.vesselSimActive.value = GUILayout.Toggle(this.vesselSimActive.value,
+			this.UseToolbarManager = GUITools.Toggle(this.UseToolbarManager, "Use Blizzy's Toolbar If Available");
+
+			this.vesselSimActive.value = GUITools.Toggle(this.vesselSimActive.value,
 				"Enable Engineering Calculations");
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
@@ -729,7 +711,7 @@
 				mod.DrawConfigurables();
 			}
 
-			this.factoryReset = GUILayout.Toggle(this.factoryReset, "Factory Reset");
+			this.factoryReset = GUITools.Toggle(this.factoryReset, "Factory Reset");
 		}
 
 		protected void UpdateSimManager()

--- a/VOID_DataLogger.cs
+++ b/VOID_DataLogger.cs
@@ -45,6 +45,9 @@
 
 		protected bool _loggingActive;
 		protected bool firstWrite;
+
+		[AVOID_SaveValue("waitForLaunch")]
+		protected VOID_SaveValue<bool> waitForLaunch;
 
 		[AVOID_SaveValue("logInterval")]
 		protected VOID_SaveValue<float> logInterval;
@@ -194,7 +197,7 @@
 
 			// CSV Logging
 			// from ISA MapSat
-			if (loggingActive)
+			if (loggingActive && (!waitForLaunch || this.vessel.situation != Vessel.Situations.PRELAUNCH))
 			{
 				//data logging is on
 				//increment timers
@@ -255,12 +258,17 @@
 				activeLabelStyle = VOID_Styles.labelGreen;
 			}
 
-			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
-
-			this.loggingActive = GUILayout.Toggle(loggingActive, "Data logging: ", GUILayout.ExpandWidth(false));
-			GUILayout.Label(activeLabelText, activeLabelStyle, GUILayout.ExpandWidth(true));
-
-			GUILayout.EndHorizontal();
+			this.loggingActive = GUITools.Toggle(
+				loggingActive,
+				string.Format("Data logging: {0}", activeLabelText),
+				null,
+				activeLabelStyle
+			);
+
+			this.waitForLaunch.value = GUITools.Toggle(
+				this.waitForLaunch,
+				"Wait for launch"
+			);
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 
@@ -459,6 +467,8 @@
 			this.loggingActive = false;
 			this.firstWrite = true;
 
+			this.waitForLaunch = true;
+
 			this.logInterval = 0.5f;
 			this.csvCollectTimer = 0f;
 

--- a/VOID_HUDAdvanced.cs
+++ b/VOID_HUDAdvanced.cs
@@ -265,9 +265,7 @@
 				}
 			}
 
-			this.positionsLocked = GUILayout.Toggle(this.positionsLocked,
-				string.Intern("Lock Advanced HUD Positions"),
-				GUILayout.ExpandWidth(false));
+			this.positionsLocked = GUITools.Toggle(this.positionsLocked, string.Intern("Lock Advanced HUD Positions"));
 		}
 	}
 }

--- a/VOID_Orbital.cs
+++ b/VOID_Orbital.cs
@@ -79,7 +79,7 @@
 			this.precisionValues [idx]= (ushort)VOID_Data.gravityAccel.DoGUIHorizontal (this.precisionValues [idx]);
 			idx++;
 
-			this.toggleExtended.value = GUILayout.Toggle(this.toggleExtended, "Extended info");
+			this.toggleExtended.value = GUITools.Toggle(this.toggleExtended, "Extended info");
 
 			if (this.toggleExtended)
             {

--- a/VOID_Rendezvous.cs
+++ b/VOID_Rendezvous.cs
@@ -126,7 +126,7 @@
 				}
 			}
 
-			untoggleRegisterInfo.value = GUILayout.Toggle(untoggleRegisterInfo, "Hide Vessel Register Info");
+			untoggleRegisterInfo.value = GUITools.Toggle(untoggleRegisterInfo, "Hide Vessel Register Info");
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 			GUILayout.Label(" ", GUILayout.ExpandWidth(true));
@@ -199,7 +199,7 @@
 					GUILayout.Label(LSL.ToString("F3") + "°", VOID_Styles.labelRight);
 					GUILayout.EndHorizontal();
 
-					toggleExtendedOrbital.value = GUILayout.Toggle(toggleExtendedOrbital, "Extended info");
+					toggleExtendedOrbital.value = GUITools.Toggle(toggleExtendedOrbital, "Extended info");
 
 					if (toggleExtendedOrbital)
 					{

--- a/VOID_StageInfo.cs
+++ b/VOID_StageInfo.cs
@@ -40,7 +40,7 @@
 		public VOID_StageInfo() : base()
 		{
 			this.Name = "Stage Information";
-			this.defWidth = 200f;
+			this.defWidth = 20f;
 			this.bodyIdx = 4;
 
 			this.stylesApplied = false;
@@ -50,34 +50,34 @@
 
 			this.stageTable = new Table();
 
-			this.stageNumberCol = new Table.Column<int>("Stage", 40f);
+			this.stageNumberCol = new Table.Column<int>("Stage", 20f);
 			this.stageTable.Add(this.stageNumberCol);
 
-			this.stageDeltaVCol = new Table.Column<double>("DeltaV [m/s]", 60f);
+			this.stageDeltaVCol = new Table.Column<double>("DeltaV [m/s]", 20f);
 			this.stageDeltaVCol.Format = "S2";
 			this.stageTable.Add(this.stageDeltaVCol);
 
-			this.stageTotalDVCol = new Table.Column<double>("Total ΔV [m/s]", 60f);
+			this.stageTotalDVCol = new Table.Column<double>("Total ΔV [m/s]", 20f);
 			this.stageTotalDVCol.Format = "S2";
 			this.stageTable.Add(this.stageTotalDVCol);
 
-			this.stageInvertDVCol = new Table.Column<double>("Invert ΔV [m/s]", 60f);
+			this.stageInvertDVCol = new Table.Column<double>("Invert ΔV [m/s]", 20f);
 			this.stageInvertDVCol.Format = "S2";
 			this.stageTable.Add(this.stageInvertDVCol);
 
-			this.stageMassCol = new Table.Column<double>("Mass [Mg]", 60f);
+			this.stageMassCol = new Table.Column<double>("Mass [Mg]", 20f);
 			this.stageMassCol.Format = "#.#";
 			this.stageTable.Add(this.stageMassCol);
 
-			this.stageTotalMassCol = new Table.Column<double>("Total [Mg]", 60f);
+			this.stageTotalMassCol = new Table.Column<double>("Total [Mg]", 20f);
 			this.stageTotalMassCol.Format = "#.#";
 			this.stageTable.Add(this.stageTotalMassCol);
 
-			this.stageThrustCol = new Table.Column<double>("Thrust [N]", 60f);
+			this.stageThrustCol = new Table.Column<double>("Thrust [N]", 20f);
 			this.stageThrustCol.Format = "S2";
 			this.stageTable.Add(this.stageThrustCol);
 
-			this.stageTWRCol = new Table.Column<double>("T/W Ratio", 60f);
+			this.stageTWRCol = new Table.Column<double>("T/W Ratio", 20f);
 			this.stageTWRCol.Format = "#.#";
 			this.stageTable.Add(this.stageTWRCol);
 		}
@@ -153,7 +153,12 @@
 					this.bodyIdx--;
 				}
 
-				this.showBodyList = GUILayout.Toggle(this.showBodyList, (this.selectedBody ?? core.HomeBody).bodyName, GUI.skin.button);
+				this.showBodyList = GUILayout.Toggle(
+					this.showBodyList,
+					(this.selectedBody ?? core.HomeBody).bodyName,
+					GUI.skin.button
+				);
+
 				Rect bodyButtonPos = GUILayoutUtility.GetLastRect();
 
 				if (Event.current.type == EventType.Repaint)