Version 0.14.2 0.14.2
Version 0.14.2

--- 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.14.1.*")]
+[assembly: AssemblyVersion("0.14.2.*")]
 // 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_CBInfoBrowser.cs
+++ b/VOID_CBInfoBrowser.cs
@@ -244,14 +244,14 @@
 					public float FlyingLowDataValue = 1f;
 					*/
 
-				GUILayout.Label("Surface Science Multiplier:");
-				GUILayout.Label("Ocean Science Multiplier:");
-				GUILayout.Label("Low-Atmosphere Science Multiplier:");
-				GUILayout.Label("High-Atmosphere Science Multiplier:");
-				GUILayout.Label("Low Orbit Science Multiplier:");
-				GUILayout.Label("High Orbit Science Multiplier:");
-				GUILayout.Label("'Flying' Altitude:");
-				GUILayout.Label("'In Space' Altitude:");
+				GUILayout.Label("Surface Multiplier:");
+				GUILayout.Label("Ocean Multiplier:");
+				GUILayout.Label("Flying-Low Multiplier:");
+				GUILayout.Label("Flying-High Multiplier:");
+				GUILayout.Label("Low Orbit Multiplier:");
+				GUILayout.Label("High Orbit Multiplier:");
+				GUILayout.Label("'Flying-High' Altitude:");
+				GUILayout.Label("'High Orbit' Altitude:");
 				GUILayout.Label("Recovery Multiplier:");
 
 				//end physical info value label column
@@ -440,7 +440,7 @@
 				GUILayout.ExpandWidth(true));
 
 			GUILayout.Label(
-				body.atmosphere ? scienceValues.spaceAltitudeThreshold.ToString("N0") : "N/A",
+				scienceValues.spaceAltitudeThreshold.ToString("N0"),
 				this.core.LabelStyles["right"],
 				GUILayout.ExpandWidth(true));
 

--- a/VOID_CareerStatus.cs
+++ b/VOID_CareerStatus.cs
@@ -166,19 +166,20 @@
 			GUI.DragWindow();
 		}
 
-		private void onFundsChange(double newValue)
+		// TODO: Update event handlers to do something useful with the new "reasons" parameter.
+		private void onFundsChange(double newValue, TransactionReasons reasons)
 		{
 			this.lastFundsChange = newValue - this.currentFunds;
 			this.currentFunds = newValue;
 		}
 
-		private void onRepChange(float newValue)
+		private void onRepChange(float newValue, TransactionReasons reasons)
 		{
 			this.lastRepChange = newValue - this.currentReputation;
 			this.currentReputation = newValue;
 		}
 
-		private void onScienceChange(float newValue)
+		private void onScienceChange(float newValue, TransactionReasons reasons)
 		{
 			this.lastScienceChange = newValue - this.currentScience;
 			this.currentScience = newValue;

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -31,6 +31,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text;
 using ToadicusTools;
 using UnityEngine;
 
@@ -717,7 +718,7 @@
 				this.stringFrequency = (1f / this.updatePeriod).ToString();
 			}
 			this.stringFrequency = GUILayout.TextField(this.stringFrequency.ToString(), 5, GUILayout.ExpandWidth(true));
-			// GUILayout.FlexibleSpace();
+
 			if (GUILayout.Button("Apply"))
 			{
 				double updateFreq = 1f / this.updatePeriod;
@@ -771,43 +772,52 @@
 
 		protected void LoadModulesOfType<T>()
 		{
-			var types = AssemblyLoader.loadedAssemblies
-				.Select(a => a.assembly.GetExportedTypes())
-				.SelectMany(t => t)
-				.Where(v => typeof(T).IsAssignableFrom(v)
-					&& !(v.IsInterface || v.IsAbstract) &&
-					!typeof(VOID_Core).IsAssignableFrom(v)
-				);
-
-			Tools.PostDebugMessage(string.Format(
-				"{0}: Found {1} modules to check.",
-				this.GetType().Name,
-				types.Count()
-			));
-			foreach (var voidType in types)
-			{
-				if (!HighLogic.LoadedSceneIsEditor &&
-					typeof(IVOID_EditorModule).IsAssignableFrom(voidType))
-				{
-					continue;
-				}
-
-				Tools.PostDebugMessage(string.Format(
-					"{0}: found Type {1}",
-					this.GetType().Name,
-					voidType.Name
-				));
-
-				this.LoadModule(voidType);
+			StringBuilder sb = new StringBuilder("Loading modules...");
+			sb.AppendLine();
+
+			foreach (AssemblyLoader.LoadedAssembly assy in AssemblyLoader.loadedAssemblies)
+			{
+				foreach (Type loadedType in assy.assembly.GetExportedTypes())
+				{
+					if (
+						loadedType.IsInterface ||
+						loadedType.IsAbstract ||
+						!typeof(T).IsAssignableFrom(loadedType) ||
+						this.GetType().IsAssignableFrom(loadedType)
+					)
+					{
+						continue;
+					}
+
+					// HACK: This stops editor modules from loading in flight.  It is a dirty hack and should be fixed.
+					if (!HighLogic.LoadedSceneIsEditor && typeof(IVOID_EditorModule).IsAssignableFrom(loadedType))
+					{
+						continue;
+					}
+
+					sb.AppendFormat("Loading IVOID_Module type {0}...", loadedType.Name);
+
+					try
+					{
+						this.LoadModule(loadedType);
+						sb.AppendLine("Success.");
+					}
+					catch (Exception ex)
+					{
+						sb.AppendFormat("Failed, caught {0}", ex.GetType().Name);
+						sb.AppendLine();
+
+						#if DEBUG
+						Debug.LogException(ex);
+						#endif
+					}
+				}
 			}
 
 			this._modulesLoaded = true;
 
-			Tools.PostDebugMessage(string.Format(
-				"{0}: Loaded {1} modules.",
-				this.GetType().Name,
-				this.Modules.Count
-			));
+			sb.AppendFormat("Loaded {0} modules.", this.Modules.Count);
+			sb.AppendLine();
 		}
 
 		protected void LoadModule(Type T)
@@ -915,10 +925,7 @@
 
 			this.iconStyle = new GUIStyle(GUI.skin.button);
 			this.iconStyle.padding = new RectOffset(0, 0, 0, 0);
-			// this.iconStyle.margin = new RectOffset(0, 0, 0, 0);
-			// this.iconStyle.contentOffset = new Vector2(0, 0);
 			this.iconStyle.overflow = new RectOffset(0, 0, 0, 0);
-			// this.iconStyle.border = new RectOffset(0, 0, 0, 0);
 
 			this.GUIStylesLoaded = true;
 		}

--- a/VOID_DataLogger.cs
+++ b/VOID_DataLogger.cs
@@ -29,6 +29,7 @@
 using KSP;
 using System;
 using System.Collections.Generic;
+using System.Text;
 using ToadicusTools;
 using UnityEngine;
 
@@ -139,7 +140,10 @@
 			GUILayout.EndHorizontal();
 
 			float new_log_interval;
-			if (Single.TryParse(csv_log_interval_str, out new_log_interval)) csv_log_interval = new_log_interval;
+			if (float.TryParse(csv_log_interval_str, out new_log_interval))
+			{
+				csv_log_interval = new_log_interval;
+			}
 
 			GUILayout.EndVertical();
 			GUI.DragWindow();
@@ -206,41 +210,92 @@
 			//called if logging is on and interval has passed
 			//writes one line to the csvList
 
-			string line = "";
+			StringBuilder line = new StringBuilder();
+
 			if (first_write && !KSP.IO.File.Exists<VOID_Core>(vessel.vesselName + "_data.csv", null))
 			{
 				first_write = false;
-				line += "Mission Elapsed Time (s);Altitude ASL (m);Altitude above terrain (m);Orbital Velocity (m/s);Surface Velocity (m/s);Vertical Speed (m/s);Horizontal Speed (m/s);Gee Force (gees);Temperature (°C);Gravity (m/s²);Atmosphere Density (g/m³);\n";
-			}
+				line.Append(
+					"Mission Elapsed Time (s);" +
+					"Altitude ASL (m);" +
+					"Altitude above terrain (m);" +
+					"Surface Latitude (°);" +
+					"Surface Longitude (°);" +
+					"Orbital Velocity (m/s);" +
+					"Surface Velocity (m/s);" +
+					"Vertical Speed (m/s);" +
+					"Horizontal Speed (m/s);" +
+					"Gee Force (gees);" +
+					"Temperature (°C);" +
+					"Gravity (m/s²);" +
+					"Atmosphere Density (g/m³);" +
+					"\n"
+				);
+			}
+
 			//Mission time
-			line += vessel.missionTime.ToString("F3") + ";";
+			line.Append(vessel.missionTime.ToString("F3"));
+			line.Append(';');
+
 			//Altitude ASL
-			line += vessel.orbit.altitude.ToString("F3") + ";";
+			line.Append(vessel.orbit.altitude.ToString("F3"));
+			line.Append(';');
+
 			//Altitude (true)
 			double alt_true = vessel.orbit.altitude - vessel.terrainAltitude;
 			if (vessel.terrainAltitude < 0) alt_true = vessel.orbit.altitude;
-			line += alt_true.ToString("F3") + ";";
+			line.Append(alt_true.ToString("F3"));
+			line.Append(';');
+
+			// Surface Latitude
+			line.Append(VOID_Data.surfLatitude.Value);
+			line.Append(';');
+
+			// Surface Longitude
+			line.Append(VOID_Data.surfLongitude.Value);
+			line.Append(';');
+
 			//Orbital velocity
-			line += vessel.orbit.vel.magnitude.ToString("F3") + ";";
+			line.Append(vessel.orbit.vel.magnitude.ToString("F3"));
+			line.Append(';');
+
 			//surface velocity
-			line += vessel.srf_velocity.magnitude.ToString("F3") + ";";
+			line.Append(vessel.srf_velocity.magnitude.ToString("F3"));
+			line.Append(';');
+
 			//vertical speed
-			line += vessel.verticalSpeed.ToString("F3") + ";";
+			line.Append(vessel.verticalSpeed.ToString("F3"));
+			line.Append(';');
+
 			//horizontal speed
-			line += vessel.horizontalSrfSpeed.ToString("F3") + ";";
+			line.Append(vessel.horizontalSrfSpeed.ToString("F3"));
+			line.Append(';');
+
 			//gee force
-			line += vessel.geeForce.ToString("F3") + ";";
+			line.Append(vessel.geeForce.ToString("F3"));
+			line.Append(';');
+
 			//temperature
-			line += vessel.flightIntegrator.getExternalTemperature().ToString("F2") + ";";
+			line.Append(vessel.flightIntegrator.getExternalTemperature().ToString("F2"));
+			line.Append(';');
+
 			//gravity
 			double r_vessel = vessel.mainBody.Radius + vessel.mainBody.GetAltitude(vessel.findWorldCenterOfMass());
 			double g_vessel = (VOID_Core.Constant_G * vessel.mainBody.Mass) / (r_vessel * r_vessel);
-			line += g_vessel.ToString("F3") + ";";
+			line.Append(g_vessel.ToString("F3"));
+			line.Append(';');
+
 			//atm density
-			line += (vessel.atmDensity * 1000).ToString("F3") + ";";
-			line += "\n";
-			if (csvList.Contains(line) == false) csvList.Add(line);
+			line.Append((vessel.atmDensity * 1000).ToString("F3"));
+			line.Append(';');
+
+			line.Append('\n');
+
+			csvList.Add(line.ToString());
+
 			csvCollectTimer = 0f;
 		}
 	}
 }
+
+

--- a/VOID_EditorCore.cs
+++ b/VOID_EditorCore.cs
@@ -69,6 +69,7 @@
 			if (_initialized)
 			{
 				_instance.StopGUI();
+				_instance.Dispose();
 				_instance = null;
 				_initialized = false;
 			}