Use ToadicusTools again now that the compat features are gone.
Use ToadicusTools again now that the compat features are gone.

--- a/API/IVOID_Module.cs
+++ b/API/IVOID_Module.cs
@@ -44,7 +44,8 @@
 
 		void DrawConfigurables();
 
-		void LoadConfig();
+		// void LoadConfig();
+		void LoadConfig(KSP.IO.PluginConfiguration config);
 
 		void Save(KSP.IO.PluginConfiguration config, string sceneKey);
 	}

--- a/API/VOIDCore.cs
+++ b/API/VOIDCore.cs
@@ -42,6 +42,9 @@
 		public abstract int ConfigVersion { get; }
 		public virtual bool configNeedsUpdate { get; set; }
 
+		public virtual string SaveGamePath { get; protected set; }
+		public virtual string VOIDSettingsPath { get; protected set; }
+
 		public abstract string SceneKey { get; }
 
 		public abstract int WindowID { get; }
@@ -58,7 +61,6 @@
 		public abstract GUISkin Skin { get; }
 
 		public abstract CelestialBody HomeBody { get; }
-		public abstract IList<CelestialBody> AllBodies { get; }
 		public abstract List<CelestialBody> SortedBodyList { get; protected set; }
 
 		public abstract VesselType[] AllVesselTypes { get; protected set; }
@@ -73,11 +75,6 @@
 
 		public virtual void OnGUI() {}
 
-		public override void LoadConfig()
-		{
-			base.LoadConfig();
-		}
-
 		public abstract void SaveConfig();
 
 		public override void Save(KSP.IO.PluginConfiguration config, string sceneKey)

--- a/API/VOIDMaster.cs
+++ b/API/VOIDMaster.cs
@@ -80,6 +80,8 @@
 				this.LogDebug("Factory reset is true; deleting config and disposing!");
 
 				KSP.IO.File.Delete<T>("config.xml");
+				System.IO.File.Delete(this.Core.VOIDSettingsPath);
+
 				this.Core.Dispose();
 				this.Core = null;
 			}

--- a/API/VOID_HUDModule.cs
+++ b/API/VOID_HUDModule.cs
@@ -142,11 +142,10 @@
 			this.positionsLocked.value = Layout.Toggle(this.positionsLocked, "Lock HUD Positions");
 		}
 
-		public override void LoadConfig()
-		{
-			base.LoadConfig();
-
-			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_HUDModule>();
+		public override void LoadConfig(KSP.IO.PluginConfiguration config)
+		{
+			base.LoadConfig(config);
+
 			config.load();
 
 			HUDWindow window;

--- a/API/VOID_Module.cs
+++ b/API/VOID_Module.cs
@@ -249,9 +249,8 @@
 
 		public virtual void DrawConfigurables() {}
 
-		public virtual void LoadConfig()
-		{
-			var config = KSP.IO.PluginConfiguration.CreateForType<VOID_Module> ();
+		public virtual void LoadConfig(KSP.IO.PluginConfiguration config)
+		{
 			config.load ();
 
 			if (this is VOIDCore)
@@ -374,6 +373,22 @@
 
 		public virtual void Save(KSP.IO.PluginConfiguration config, string sceneKey)
 		{
+			if (config == null)
+			{
+				ToadicusTools.Logging.PostErrorMessage(
+					"{0}: config argument was null, bailing out.",
+					this.GetType().Name
+				);
+			}
+
+			if (sceneKey == null)
+			{
+				ToadicusTools.Logging.PostErrorMessage(
+					"{0}: sceneKey argument was null, bailing out.",
+					this.GetType().Name
+				);
+			}
+
 			MemberInfo[] members = this.GetType().GetMembers(
 				BindingFlags.NonPublic |
 				BindingFlags.Public |

--- 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.18.3.*")]
+[assembly: AssemblyVersion("0.18.4.*")]
 // 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/Tools/VOID_Tools.cs
+++ b/Tools/VOID_Tools.cs
@@ -335,21 +335,16 @@
 					{
 						func(id);
 					}
-					#if DEBUG
+					#if !DEBUG
 					catch (ArgumentException)
-					#else
-					catch (ArgumentException)
-					#endif
 					{
 						Debug.LogWarning(
-							string.Format("[{0}]: ArgumentException caught during window call.  This is not a bug.",
+							string.Format("[{0}]: ArgumentException caught during window call." +
+								"  This may not be a bug when occuring during scene changes.",
 								func.Target.GetType().Name
 							));
-
-						/*#if DEBUG
-						Debug.LogException(ex);
-						#endif*/
 					}
+					#endif
 					catch (Exception ex)
 					{
 						Debug.LogError(

--- a/VOIDCore_Generic.cs
+++ b/VOIDCore_Generic.cs
@@ -26,8 +26,6 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KerbalEngineer.Editor;
 using KerbalEngineer.Helpers;
 using KerbalEngineer.VesselSimulator;
@@ -35,6 +33,7 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
+using ToadicusTools;
 using ToadicusTools.DebugTools;
 using ToadicusTools.Extensions;
 using ToadicusTools.GUIUtils;
@@ -153,13 +152,6 @@
 				base.Active = value;
 			}
 		}
-		public override IList<CelestialBody> AllBodies
-		{
-			get
-			{
-				return FlightGlobals.Bodies.AsReadOnly();
-			}
-		}
 
 		public override VesselType[] AllVesselTypes
 		{
@@ -351,7 +343,7 @@
 			{
 				this.LoadGUIStyles();
 
-				ToadicusTools.Logging.PostDebugMessage(
+				Logging.PostDebugMessage(
 					this,
 					"ToolbarAvailable: {0}, UseToobarManager: {1}",
 					ToolbarManager.ToolbarAvailable,
@@ -390,7 +382,7 @@
 				)
 			)
 			{
-				ToadicusTools.Logging.PostDebugMessage(this, "Updating SimManager.");
+				Logging.PostDebugMessage(this, "Updating SimManager.");
 				this.UpdateSimManager();
 			}
 
@@ -469,12 +461,12 @@
 
 			this.saveTimer += Time.deltaTime;
 
-			if (this.saveTimer > 2f)
+			if (this.modulesLoaded && this.saveTimer > 2f)
 			{
 				if (this.configDirty)
 				{
 
-					ToadicusTools.Logging.PostDebugMessage(string.Format(
+					Logging.PostDebugMessage(string.Format(
 							"{0}: Time to save, checking if configDirty: {1}",
 							this.GetType().Name,
 							this.configDirty
@@ -702,7 +694,7 @@
 			if (GUILayout.Button(_content, GUILayout.ExpandWidth(true)))
 			{
 				this.skinIdx--;
-				ToadicusTools.Logging.PostDebugMessage(string.Format(
+				Logging.PostDebugMessage(string.Format(
 					"{0}: new this.skinIdx = {1} :: skin_list.Count = {2}",
 					this.GetType().Name,
 					this.skinName,
@@ -719,7 +711,7 @@
 			if (GUILayout.Button(_content, GUILayout.ExpandWidth(true)))
 			{
 				this.skinIdx++;
-				ToadicusTools.Logging.PostDebugMessage(string.Format(
+				Logging.PostDebugMessage(string.Format(
 					"{0}: new this.skinIdx = {1} :: skin_list.Count = {2}",
 					this.GetType().Name,
 					this.skinName,
@@ -786,7 +778,7 @@
 
 			SimManager.TryStartSimulation();
 
-			ToadicusTools.Logging.PostDebugMessage(this, "Started Engineer simulation with Atmosphere={0} atm and Gravity={1} m/s²",
+			Logging.PostDebugMessage(this, "Started Engineer simulation with Atmosphere={0} atm and Gravity={1} m/s²",
 				SimManager.Atmosphere,
 				SimManager.Gravity
 			);
@@ -794,7 +786,7 @@
 
 		protected void GetSimManagerResults()
 		{
-			ToadicusTools.Logging.PostDebugMessage(this, "VesselSimulator results ready, setting Stages.");
+			Logging.PostDebugMessage(this, "VesselSimulator results ready, setting Stages.");
 
 			this.Stages = SimManager.Stages;
 
@@ -848,6 +840,8 @@
 					}
 				}
 
+				this.LoadConfig();
+
 				this.modulesLoaded = true;
 
 				sb.AppendFormat("Loaded {0} modules.\n", this.Modules.Count);
@@ -864,7 +858,7 @@
 			{
 				if (this.modules[mIdx].Name == T.Name)
 				{
-					ToadicusTools.Logging.PostErrorMessage("{0}: refusing to load {1}: already loaded", this.GetType().Name, T.Name);
+					Logging.PostErrorMessage("{0}: refusing to load {1}: already loaded", this.GetType().Name, T.Name);
 					return;
 				}
 			}
@@ -895,10 +889,9 @@
 
 			if (module.InValidGame && module.InValidScene)
 			{
-				module.LoadConfig();
 				this.modules.Add(module);
 
-				ToadicusTools.Logging.PostDebugMessage(string.Format(
+				Logging.PostDebugMessage(string.Format(
 						"{0}: loaded module {1}.",
 						this.GetType().Name,
 						T.Name
@@ -931,7 +924,7 @@
 				}
 			}
 
-			ToadicusTools.Logging.PostDebugMessage(string.Format(
+			Logging.PostDebugMessage(string.Format(
 				"{0}: loaded {1} GUISkins.",
 				this.GetType().Name,
 				this.validSkins.Count
@@ -962,7 +955,7 @@
 				this.skinIdx = defaultIdx;
 			}
 
-			ToadicusTools.Logging.PostDebugMessage(string.Format(
+			Logging.PostDebugMessage(string.Format(
 				"{0}: _skinIdx = {1}.",
 				this.GetType().Name,
 				this.skinName.ToString()
@@ -1024,7 +1017,7 @@
 			// Do nothing if (the Toolbar is not available.
 			if (!ToolbarManager.ToolbarAvailable)
 			{
-				ToadicusTools.Logging.PostDebugMessage(this, "Refusing to make a ToolbarButton: ToolbarAvailable = false");
+				Logging.PostDebugMessage(this, "Refusing to make a ToolbarButton: ToolbarAvailable = false");
 				return;
 			}
 
@@ -1040,7 +1033,7 @@
 				this.ToggleMainWindow();
 			};
 
-			ToadicusTools.Logging.PostDebugMessage(string.Format("{0}: Toolbar Button initialized.", this.GetType().Name));
+			Logging.PostDebugMessage(string.Format("{0}: Toolbar Button initialized.", this.GetType().Name));
 		}
 
 		protected void InitializeAppLauncherButton()
@@ -1053,7 +1046,7 @@
 					this.VOIDIconTexture
 				);
 
-				ToadicusTools.Logging.PostDebugMessage(
+				Logging.PostDebugMessage(
 					this,
 					"AppLauncherButton initialized in {0}",
 					Enum.GetName(
@@ -1110,16 +1103,34 @@
 			}
 		}
 
-		public override void LoadConfig()
-		{
-			base.LoadConfig();
+		public void LoadConfig()
+		{
+
+			if (!System.IO.File.Exists(this.VOIDSettingsPath) && KSP.IO.File.Exists<VOID_Module>("config.xml"))
+			{
+				Logging.PostLogMessage(
+					"VOID: No per-save config file but old file detected; copying from old file."
+				);
+
+				System.IO.File.Copy(
+					KSP.IO.IOUtils.GetFilePathFor(typeof(VOID_Module), "config.xml"),
+					this.VOIDSettingsPath
+				);
+			}
+
+			this.LoadConfig(new PluginConfiguration(this.VOIDSettingsPath));
+		}
+
+		public override void LoadConfig(KSP.IO.PluginConfiguration config)
+		{
+			base.LoadConfig(config);
 
 			IVOID_Module module;
 			for (int idx = 0; idx < this.modules.Count; idx++)
 			{
 				module = this.modules[idx];
 
-				module.LoadConfig();
+				module.LoadConfig(config);
 			}
 
 			this.TimeScale |= GameSettings.KERBIN_TIME ? VOID_TimeScale.KERBIN_TIME : 0u;
@@ -1130,9 +1141,10 @@
 			if (this.configNeedsUpdate && this is VOIDCore_Flight)
 			{
 				KSP.IO.File.Delete<T>("config.xml");
-			}
-
-			var config = KSP.IO.PluginConfiguration.CreateForType<T>();
+				System.IO.File.Delete(this.VOIDSettingsPath);
+			}
+
+			KSP.IO.PluginConfiguration config = new PluginConfiguration(this.VOIDSettingsPath);
 
 			config.load();
 
@@ -1178,9 +1190,8 @@
 
 			this.useToolbarManager = (VOID_SaveValue<bool>)ToolbarManager.ToolbarAvailable;
 
-			this.LoadConfig();
-
-			this.configVersion = (VOID_SaveValue<int>)VOIDCore.CONFIG_VERSION;
+			this.SaveGamePath = string.Format("{0}saves/{1}", IOTools.KSPRootPath, HighLogic.SaveFolder);
+			this.VOIDSettingsPath = string.Format("{0}/VOIDConfig.xml", this.SaveGamePath);
 
 			this.FactoryReset = false;
 		}

--- a/VOID_CBInfoBrowser.cs
+++ b/VOID_CBInfoBrowser.cs
@@ -73,6 +73,12 @@
 		{
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 
+			if (this.core.SortedBodyList.Count < 1)
+			{
+				GUILayout.Label("Non-positive number of CelestialBodies here, bailing out.");
+				GUILayout.EndHorizontal();
+			}
+
 			GUILayout.BeginVertical(GUILayout.Width(150));
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 			GUILayout.Label("", GUILayout.ExpandWidth(true));
@@ -82,8 +88,28 @@
 
 			GUILayout.BeginVertical(GUILayout.Width(150));
 
-			selectedBody1 = this.core.AllBodies[selectedBodyIdx1];
-			selectedBody2 = this.core.AllBodies[selectedBodyIdx2];
+			if (selectedBodyIdx1 >= this.core.SortedBodyList.Count)
+			{
+				selectedBodyIdx1.value %= this.core.SortedBodyList.Count;
+			}
+
+			if (selectedBodyIdx1 < 0)
+			{
+				selectedBodyIdx1.value += this.core.SortedBodyList.Count;
+			}
+
+			if (selectedBodyIdx2 >= this.core.SortedBodyList.Count)
+			{
+				selectedBodyIdx2.value %= this.core.SortedBodyList.Count;
+			}
+
+			if (selectedBodyIdx2 < 0)
+			{
+				selectedBodyIdx2.value += this.core.SortedBodyList.Count;
+			}
+
+			selectedBody1 = this.core.SortedBodyList[selectedBodyIdx1];
+			selectedBody2 = this.core.SortedBodyList[selectedBodyIdx2];
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 			if (GUILayout.Button("<", GUILayout.ExpandWidth(false)))
@@ -91,14 +117,14 @@
 				selectedBodyIdx1.value--;
 				if (selectedBodyIdx1 < 0)
 				{
-					selectedBodyIdx1.value = this.core.AllBodies.Count - 1;
+					selectedBodyIdx1.value = this.core.SortedBodyList.Count - 1;
 				}
 			}
-			GUILayout.Label(this.core.AllBodies[selectedBodyIdx1].bodyName, VOID_Styles.labelCenterBold, GUILayout.ExpandWidth(true));
+			GUILayout.Label(this.core.SortedBodyList[selectedBodyIdx1].bodyName, VOID_Styles.labelCenterBold, GUILayout.ExpandWidth(true));
 			if (GUILayout.Button(">", GUILayout.ExpandWidth(false)))
 			{
 				selectedBodyIdx1.value++;
-				if (selectedBodyIdx1 > this.core.AllBodies.Count - 1)
+				if (selectedBodyIdx1 > this.core.SortedBodyList.Count - 1)
 				{
 					selectedBodyIdx1.value = 0;
 				}
@@ -113,14 +139,14 @@
 				selectedBodyIdx2.value--;
 				if (selectedBodyIdx2 < 0)
 				{
-					selectedBodyIdx2.value = this.core.AllBodies.Count - 1;
+					selectedBodyIdx2.value = this.core.SortedBodyList.Count - 1;
 				}
 			}
-			GUILayout.Label(this.core.AllBodies[selectedBodyIdx2].bodyName, VOID_Styles.labelCenterBold, GUILayout.ExpandWidth(true));
+			GUILayout.Label(this.core.SortedBodyList[selectedBodyIdx2].bodyName, VOID_Styles.labelCenterBold, GUILayout.ExpandWidth(true));
 			if (GUILayout.Button(">", GUILayout.ExpandWidth(false)))
 			{
 				selectedBodyIdx2.value++;
-				if (selectedBodyIdx2 > this.core.AllBodies.Count - 1)
+				if (selectedBodyIdx2 > this.core.SortedBodyList.Count - 1)
 				{
 					selectedBodyIdx2.value = 0;
 				}

--- a/VOID_CareerStatus.cs
+++ b/VOID_CareerStatus.cs
@@ -26,12 +26,10 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KSP;
 using System;
 using System.Text;
-
+using ToadicusTools;
 using ToadicusTools.Text;
 using UnityEngine;
 
@@ -119,7 +117,7 @@
 		{
 			get
 			{
-				ToadicusTools.Logging.PostDebugMessage(
+				Logging.PostDebugMessage(
 					this,
 					"Checking init state:" +
 					"\n\tcurrentFunds={0}" +
@@ -204,7 +202,7 @@
 
 		private void initCurrencies()
 		{
-			ToadicusTools.Logging.PostDebugMessage(
+			Logging.PostDebugMessage(
 				this,
 				"Initializing currencies." +
 				"\n\tFunding.Instance={0}" +
@@ -239,11 +237,11 @@
 
 			bool texturesLoaded;
 
-			texturesLoaded = ToadicusTools.IOTools.LoadTexture(out this.fundsIconGreen, "VOID/Textures/fundsgreen.png", 10, 18);
-			texturesLoaded &= ToadicusTools.IOTools.LoadTexture(out this.fundsIconRed, "VOID/Textures/fundsred.png", 10, 18);
-			texturesLoaded &= ToadicusTools.IOTools.LoadTexture(out this.reputationIconGreen, "VOID/Textures/repgreen.png", 16, 18);
-			texturesLoaded &= ToadicusTools.IOTools.LoadTexture(out this.reputationIconRed, "VOID/Textures/repred.png", 16, 18);
-			texturesLoaded &= ToadicusTools.IOTools.LoadTexture(out this.scienceIcon, "VOID/Textures/science.png", 16, 18);
+			texturesLoaded = IOTools.LoadTexture(out this.fundsIconGreen, "VOID/Textures/fundsgreen.png", 10, 18);
+			texturesLoaded &= IOTools.LoadTexture(out this.fundsIconRed, "VOID/Textures/fundsred.png", 10, 18);
+			texturesLoaded &= IOTools.LoadTexture(out this.reputationIconGreen, "VOID/Textures/repgreen.png", 16, 18);
+			texturesLoaded &= IOTools.LoadTexture(out this.reputationIconRed, "VOID/Textures/repred.png", 16, 18);
+			texturesLoaded &= IOTools.LoadTexture(out this.scienceIcon, "VOID/Textures/science.png", 16, 18);
 
 			this.fundsContent = new GUIContent();
 			this.repContent = new GUIContent();

--- a/VOID_Data.cs
+++ b/VOID_Data.cs
@@ -26,12 +26,11 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KerbalEngineer.VesselSimulator;
 using KSP;
 using System;
 using System.Collections.Generic;
+using ToadicusTools;
 using ToadicusTools.Extensions;
 using ToadicusTools.MuMechTools;
 using UnityEngine;
@@ -233,8 +232,8 @@
 		public static readonly VOID_FloatValue mainThrottle =
 			new VOID_FloatValue(
 				"Throttle",
-				new Func<float>(() => Core.Vessel.ctrlState.mainThrottle * 100f),
-				"%"
+				new Func<float>(() => Core.Vessel.ctrlState.mainThrottle),
+				""
 			);
 
 		#endregion
@@ -353,6 +352,19 @@
 						(VOID_Data.maxThrustWeight.Value).ToString("F2")
 					);
 				}
+			);
+
+		public static readonly VOID_DoubleValue currThrust =
+			new VOID_DoubleValue(
+				"Current Thrust",
+				delegate()
+				{
+					if (Core.Stages == null || Core.LastStage == null)
+						return double.NaN;
+
+					return Core.LastStage.actualThrust;
+				},
+				"kN"
 			);
 
 		public static readonly VOID_StrValue currmaxThrust =
@@ -550,10 +562,10 @@
 					thrustPos = vesselTransform.InverseTransformPoint(thrustPos);
 					thrustDir = vesselTransform.InverseTransformDirection(thrustDir);
 
-					Vector3d thrustOffset = ToadicusTools.VectorTools.PointDistanceToLine(
+					Vector3d thrustOffset = VectorTools.PointDistanceToLine(
 						                        thrustPos, thrustDir.normalized, Core.Vessel.findLocalCenterOfMass());
 
-					ToadicusTools.Logging.PostDebugMessage(typeof(VOID_Data), "vesselThrustOffset:\n" +
+					Logging.PostDebugMessage(typeof(VOID_Data), "vesselThrustOffset:\n" +
 					"\tthrustPos: {0}\n" +
 					"\tthrustDir: {1}\n" +
 					"\tthrustOffset: {2}\n" +
@@ -810,13 +822,7 @@
 				"Horizontal speed",
 				delegate
 				{
-					double srfSpeedSqr = Core.Vessel.srfSpeed;
-					srfSpeedSqr *= srfSpeedSqr;
-
-					double vrtSpeedSqr = Core.Vessel.verticalSpeed;
-					vrtSpeedSqr *= vrtSpeedSqr;
-
-					return Math.Sqrt(srfSpeedSqr - vrtSpeedSqr);
+					return Core.Vessel.horizontalSrfSpeed;
 				},
 				"m/s"
 			);
@@ -1283,7 +1289,7 @@
 
 		private static double burnTime(double deltaV, double initialMass, double massFlow, double thrust)
 		{
-			ToadicusTools.Logging.PostDebugMessage(typeof(VOID_Data), "calculating burnTime from:\n" +
+			Logging.PostDebugMessage(typeof(VOID_Data), "calculating burnTime from:\n" +
 			"\tdeltaV: {0}\n" +
 			"\tinitialMass: {1}\n" +
 			"\tmassFlow: {2}\n" +

--- a/VOID_DataLogger.cs
+++ b/VOID_DataLogger.cs
@@ -26,13 +26,12 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KSP;
 using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Text;
+using ToadicusTools;
 using ToadicusTools.DebugTools;
 using ToadicusTools.GUIUtils;
 using ToadicusTools.Text;
@@ -107,14 +106,11 @@
 			{
 				if (this._fileName == null || this._fileName == string.Empty)
 				{
-					this._fileName = KSP.IO.IOUtils.GetFilePathFor(
-						typeof(VOIDCore),
-						string.Format(
-							"{0}_{1}",
-							this.Vessel.vesselName,
-							"data.csv"
-						),
-						null
+					this._fileName = string.Format(
+						"{0}/{1}_{2}",
+						this.core.SaveGamePath,
+						this.Vessel.vesselName,
+						"data.csv"
 					);
 				}
 
@@ -237,9 +233,9 @@
 
 		#region VOID_Module Overrides
 
-		public override void LoadConfig()
-		{
-			base.LoadConfig();
+		public override void LoadConfig(KSP.IO.PluginConfiguration config)
+		{
+			base.LoadConfig(config);
 
 			this.logIntervalStr = this.logInterval.value.ToString("#.0##");
 		}
@@ -326,15 +322,18 @@
 						"\"Surface Longitude (°)\"," +
 						"\"Apoapsis Altitude (m)\"," +
 						"\"Periapsis Altitude (m)\"," +
+						"\"Orbital Inclination (°)\"," +
 						"\"Orbital Velocity (m/s)\"," +
 						"\"Surface Velocity (m/s)\"," +
 						"\"Vertical Speed (m/s)\"," +
 						"\"Horizontal Speed (m/s)\"," +
+						"\"Current Thrust (kN)\"," +
 						"\"Gee Force (gees)\"," +
 						"\"Temperature (°C)\"," +
 						"\"Gravity (m/s²)\"," +
 						"\"Atmosphere Density (g/m³)\"," +
 						"\"Downrange Distance  (m)\"," +
+						"\"Main Throttle\"," +
 						"\n"
 					);
 				}
@@ -348,67 +347,79 @@
 				line.Append(',');
 
 				//Altitude ASL
-				line.Append(VOID_Data.orbitAltitude.Value.ToString("F3"));
+				line.Append(VOID_Data.orbitAltitude.Value.ToString("G9"));
 				line.Append(',');
 
 				//Altitude (true)
-				line.Append(VOID_Data.trueAltitude.Value.ToString("F3"));
+				line.Append(VOID_Data.trueAltitude.Value.ToString("G9"));
 				line.Append(',');
 
 				// Surface Latitude
 				line.Append('"');
-				line.Append(VOID_Data.surfLatitude.Value);
+				line.Append(VOID_Data.surfLatitude.Value.ToString("F3"));
 				line.Append('"');
 				line.Append(',');
 
 				// Surface Longitude
 				line.Append('"');
-				line.Append(VOID_Data.surfLongitude.Value);
+				line.Append(VOID_Data.surfLongitude.Value.ToString("F3"));
 				line.Append('"');
 				line.Append(',');
 
 				// Apoapsis Altitude
-				line.Append(VOID_Data.orbitApoAlt.Value.ToString("G3"));
+				line.Append(VOID_Data.orbitApoAlt.Value.ToString("G9"));
 				line.Append(',');
 
 				// Periapsis Altitude
-				line.Append(VOID_Data.oribtPeriAlt.Value.ToString("G3"));
+				line.Append(VOID_Data.oribtPeriAlt.Value.ToString("G9"));
+				line.Append(',');
+
+				// Orbital Inclination
+				line.Append(VOID_Data.orbitInclination.Value.ToString("F2"));
 				line.Append(',');
 
 				//Orbital velocity
-				line.Append(VOID_Data.orbitVelocity.Value.ToString("F3"));
+				line.Append(VOID_Data.orbitVelocity.Value.ToString("G9"));
 				line.Append(',');
 
 				//surface velocity
-				line.Append(VOID_Data.surfVelocity.Value.ToString("F3"));
+				line.Append(VOID_Data.surfVelocity.Value.ToString("G9"));
 				line.Append(',');
 
 				//vertical speed
-				line.Append(VOID_Data.vertVelocity.Value.ToString("F3"));
+				line.Append(VOID_Data.vertVelocity.Value.ToString("G9"));
 				line.Append(',');
 
 				//horizontal speed
-				line.Append(VOID_Data.horzVelocity.Value.ToString("F3"));
+				line.Append(VOID_Data.horzVelocity.Value.ToString("G9"));
+				line.Append(',');
+
+				// Current Thrust
+				line.Append(VOID_Data.currThrust.Value.ToString("G9"));
 				line.Append(',');
 
 				//gee force
-				line.Append(VOID_Data.geeForce.Value.ToString("F3"));
+				line.Append(VOID_Data.geeForce.Value.ToString("G9"));
 				line.Append(',');
 
 				//temperature
-				line.Append(VOID_Data.temperature.Value.ToString("F2"));
+				line.Append(VOID_Data.temperature.Value.ToString("F3"));
 				line.Append(',');
 
 				//gravity
-				line.Append(VOID_Data.gravityAccel.Value.ToString("F3"));
+				line.Append(VOID_Data.gravityAccel.Value.ToString("G9"));
 				line.Append(',');
 
 				//atm density
-				line.Append(VOID_Data.atmDensity.Value.ToString("G3"));
+				line.Append(VOID_Data.atmDensity.Value.ToString("G9"));
 				line.Append(',');
 
 				// Downrange Distance
-				line.Append((VOID_Data.downrangeDistance.Value.ToString("G3")));
+				line.Append((VOID_Data.downrangeDistance.Value.ToString("G9")));
+				line.Append(',');
+
+				// Main Throttle
+				line.Append(VOID_Data.mainThrottle.Value.ToString("P2"));
 
 				line.Append('\n');
 
@@ -424,7 +435,7 @@
 
 		protected void AsyncWriteCallback(IAsyncResult result)
 		{
-			ToadicusTools.Logging.PostDebugMessage(this, "Got async callback, IsCompleted = {0}", result.IsCompleted);
+			Logging.PostDebugMessage(this, "Got async callback, IsCompleted = {0}", result.IsCompleted);
 
 			this.outputFile.EndWrite(result);
 			this.outstandingWrites--;

--- a/VOID_EditorHUD.cs
+++ b/VOID_EditorHUD.cs
@@ -26,13 +26,12 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KerbalEngineer.VesselSimulator;
 using KSP;
 using System;
 using System.Collections.Generic;
 using System.Text;
+using ToadicusTools;
 using ToadicusTools.Text;
 using UnityEngine;
 
@@ -115,7 +114,7 @@
 			);
 			this.Windows.Add(this.ehudWindow);
 
-			ToadicusTools.Logging.PostDebugMessage (this.GetType().Name + ": Constructed.");
+			Logging.PostDebugMessage (this.GetType().Name + ": Constructed.");
 		}
 
 		public void ehudWindowFunc(int id)
@@ -155,7 +154,7 @@
 				hudString.Append("Bottom Stage T/W Ratio: ");
 				hudString.Append(this.core.LastStage.thrustToWeight.ToString("F3"));
 
-				ToadicusTools.Logging.PostDebugMessage(this,
+				Logging.PostDebugMessage(this,
 					"CoMmarker.gameObject.activeInHierarchy: {0};" +
 					"CoTmarker.gameObject.activeInHierarchy: {1}",
 					this.CoMmarker.gameObject.activeInHierarchy,
@@ -164,7 +163,7 @@
 
 				if (this.CoMmarker.gameObject.activeInHierarchy && this.CoTmarker.gameObject.activeInHierarchy)
 				{
-					ToadicusTools.Logging.PostDebugMessage(this, "CoM and CoT markers are active, doing thrust offset.");
+					Logging.PostDebugMessage(this, "CoM and CoT markers are active, doing thrust offset.");
 					hudString.Append('\n');
 
 					hudString.Append("Thrust Offset: ");
@@ -177,7 +176,7 @@
 				#if DEBUG
 			else
 			{
-				ToadicusTools.Logging.PostDebugMessage(this, "CoM and CoT markers are not active, thrust offset skipped.");
+				Logging.PostDebugMessage(this, "CoM and CoT markers are not active, thrust offset skipped.");
 			}
 				#endif
 
@@ -217,7 +216,7 @@
 				return;
 			}
 
-			ToadicusTools.Logging.PostDebugMessage(this,
+			Logging.PostDebugMessage(this,
 				"EditorPartList topLeft.parent.parent.position: {0}\n" +
 				"EditorPartList topLeft.parent.position: {1}\n" +
 				"EditorPartList topLeft.position: {2}\n" +

--- a/VOID_HUD.cs
+++ b/VOID_HUD.cs
@@ -26,13 +26,12 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KerbalEngineer.VesselSimulator;
 using KSP;
 using System;
 using System.Collections.Generic;
 using System.Text;
+using ToadicusTools;
 using ToadicusTools.Text;
 using UnityEngine;
 
@@ -65,7 +64,7 @@
 			this.rightHUD = new HUDWindow("rightHUD", this.rightHUDWindow, new Rect(Screen.width * .625f, 0f, 300f, 90f));
 			this.Windows.Add(this.rightHUD);
 
-			ToadicusTools.Logging.PostDebugMessage ("VOID_HUD: Constructed.");
+			Logging.PostDebugMessage ("VOID_HUD: Constructed.");
 		}
 
 		protected void leftHUDWindow(int id)

--- a/VOID_HUDAdvanced.cs
+++ b/VOID_HUDAdvanced.cs
@@ -26,13 +26,12 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KerbalEngineer.VesselSimulator;
 using KSP;
 using System;
 using System.Collections.Generic;
 using System.Text;
+using ToadicusTools;
 using ToadicusTools.GUIUtils;
 using ToadicusTools.Text;
 using UnityEngine;
@@ -99,7 +98,7 @@
 
 			this.positionsLocked.value = true;
 
-			ToadicusTools.Logging.PostDebugMessage (this, "Constructed.");
+			Logging.PostDebugMessage (this, "Constructed.");
 		}
 
 		protected void leftHUDWindow(int id)

--- a/VOID_Orbital.cs
+++ b/VOID_Orbital.cs
@@ -26,10 +26,9 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KSP;
 using System;
+using ToadicusTools;
 using ToadicusTools.GUIUtils;
 using UnityEngine;
 
@@ -42,7 +41,7 @@
 
 		[AVOID_SaveValue("precisionValues")]
 		protected VOID_SaveValue<long> _precisionValues;
-		protected ToadicusTools.IntCollection precisionValues;
+		protected IntCollection precisionValues;
 
 		public VOID_Orbital()
 		{
@@ -118,11 +117,11 @@
 			base.ModuleWindow(id);
 		}
 
-		public override void LoadConfig ()
+		public override void LoadConfig(KSP.IO.PluginConfiguration config)
 		{
-			base.LoadConfig ();
+			base.LoadConfig(config);
 
-			this.precisionValues = new ToadicusTools.IntCollection (4, this._precisionValues);
+			this.precisionValues = new IntCollection (4, this._precisionValues);
 		}
 
 		public override void Save (KSP.IO.PluginConfiguration config, string sceneKey)

--- a/VOID_Rendezvous.cs
+++ b/VOID_Rendezvous.cs
@@ -26,11 +26,10 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KSP;
 using System;
 using System.Collections.Generic;
+using ToadicusTools;
 using ToadicusTools.GUIUtils;
 using ToadicusTools.Text;
 using UnityEngine;
@@ -99,7 +98,7 @@
 				if (GUILayout.Button("Unset Target", GUILayout.ExpandWidth(false)))
 				{
 					FlightGlobals.fetch.SetVesselTarget(null);
-					ToadicusTools.Logging.PostDebugMessage("VOID_Rendezvous: KSP Target set to null");
+					Logging.PostDebugMessage("VOID_Rendezvous: KSP Target set to null");
 				}
 
 			}
@@ -126,7 +125,7 @@
 						if (GUILayout.Button("Set Target", GUILayout.ExpandWidth(false)))
 						{
 							FlightGlobals.fetch.SetVesselTarget(rendezvessel);
-							ToadicusTools.Logging.PostDebugMessage("[VOID] KSP Target set to " + rendezvessel.vesselName);
+							Logging.PostDebugMessage("[VOID] KSP Target set to " + rendezvessel.vesselName);
 						}
 					}
 				}

--- a/VOID_SurfAtmo.cs
+++ b/VOID_SurfAtmo.cs
@@ -98,9 +98,9 @@
 			base.ModuleWindow(id);
 		}
 
-		public override void LoadConfig()
+		public override void LoadConfig(KSP.IO.PluginConfiguration config)
 		{
-			base.LoadConfig();
+			base.LoadConfig(config);
 
 			this.precisionValues = new IntCollection(4, this._precisionValues);
 		}

--- a/VOID_Transfer.cs
+++ b/VOID_Transfer.cs
@@ -26,11 +26,10 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// TODO: Remove ToadicusTools. prefixes after refactor is done.
-
 using KSP;
 using System;
 using System.Collections.Generic;
+using ToadicusTools;
 using UnityEngine;
 
 namespace VOID
@@ -164,7 +163,7 @@
 		            if (GUILayout.Button("Set Target", GUILayout.ExpandWidth(false)))
 		            {
 		                FlightGlobals.fetch.SetVesselTarget(body);
-						ToadicusTools.Logging.PostDebugMessage("[VOID] KSP Target set to CelestialBody " + body.bodyName);
+						Logging.PostDebugMessage("[VOID] KSP Target set to CelestialBody " + body.bodyName);
 		            }
 		        }
 		        else if ((CelestialBody)FlightGlobals.fetch.VesselTarget == body)
@@ -172,7 +171,7 @@
 		            if (GUILayout.Button("Unset Target", GUILayout.ExpandWidth(false)))
 		            {
 		                FlightGlobals.fetch.SetVesselTarget(null);
-		                ToadicusTools.Logging.PostDebugMessage("[VOID] KSP Target set to null");
+		                Logging.PostDebugMessage("[VOID] KSP Target set to null");
 		            }
 		        }
 		    }
@@ -182,7 +181,7 @@
 		        if (GUILayout.Button("Set Target", GUILayout.ExpandWidth(false)))
 		        {
 		            FlightGlobals.fetch.SetVesselTarget(body);
-		            ToadicusTools.Logging.PostDebugMessage("[VOID] KSP Target set to CelestialBody " + body.bodyName);
+		            Logging.PostDebugMessage("[VOID] KSP Target set to CelestialBody " + body.bodyName);
 		        }
 		    }
 		}

--- a/VOID_VesselInfo.cs
+++ b/VOID_VesselInfo.cs
@@ -59,27 +59,27 @@
 				VOID_Styles.labelCenterBold,
 				GUILayout.ExpandWidth(true));
 
-			VOID_Data.geeForce.DoGUIHorizontal ("F2");
+			VOID_Data.geeForce.DoGUIHorizontal("F2");
 
-			VOID_Data.partCount.DoGUIHorizontal ();
+			VOID_Data.partCount.DoGUIHorizontal();
 
-			VOID_Data.totalMass.DoGUIHorizontal ("F3");
+			VOID_Data.totalMass.DoGUIHorizontal("F3");
 
 			VOID_Data.stageResourceMass.DoGUIHorizontal("F3");
 
 			VOID_Data.resourceMass.DoGUIHorizontal("F3");
 
-			VOID_Data.stageDeltaV.DoGUIHorizontal (3, false);
+			VOID_Data.stageDeltaV.DoGUIHorizontal(3, false);
 
-			VOID_Data.totalDeltaV.DoGUIHorizontal (3, false);
+			VOID_Data.totalDeltaV.DoGUIHorizontal(3, false);
 
-			VOID_Data.mainThrottle.DoGUIHorizontal ("F0");
+			VOID_Data.mainThrottle.DoGUIHorizontal("P0");
 
-			VOID_Data.currmaxThrust.DoGUIHorizontal ();
+			VOID_Data.currmaxThrust.DoGUIHorizontal();
 
-			VOID_Data.currmaxThrustWeight.DoGUIHorizontal ();
+			VOID_Data.currmaxThrustWeight.DoGUIHorizontal();
 
-			VOID_Data.surfaceThrustWeight.DoGUIHorizontal ("F2");
+			VOID_Data.surfaceThrustWeight.DoGUIHorizontal("F2");
 
 			VOID_Data.intakeAirStatus.DoGUIHorizontal();
 

--- a/VOID_VesselRegister.cs
+++ b/VOID_VesselRegister.cs
@@ -79,6 +79,16 @@
 				return;
 			}
 
+			if (selectedBodyIdx >= this.core.SortedBodyList.Count)
+			{
+				selectedBodyIdx.value %= this.core.SortedBodyList.Count;
+			}
+
+			if (selectedBodyIdx < 0)
+			{
+				selectedBodyIdx.value += this.core.SortedBodyList.Count;
+			}
+
 			GUILayout.BeginVertical();
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
@@ -87,21 +97,21 @@
 				selectedBodyIdx.value--;
 				if (selectedBodyIdx < 0)
 				{
-					selectedBodyIdx.value = this.core.AllBodies.Count - 1;
+					selectedBodyIdx.value = this.core.SortedBodyList.Count - 1;
 				}
 			}
-			GUILayout.Label(this.core.AllBodies[selectedBodyIdx].bodyName, VOID_Styles.labelCenterBold, GUILayout.ExpandWidth(true));
+			GUILayout.Label(this.core.SortedBodyList[selectedBodyIdx].bodyName, VOID_Styles.labelCenterBold, GUILayout.ExpandWidth(true));
 			if (GUILayout.Button(">"))
 			{
 				selectedBodyIdx.value++;
-				if (selectedBodyIdx > this.core.AllBodies.Count - 1)
+				if (selectedBodyIdx > this.core.SortedBodyList.Count - 1)
 				{
 					selectedBodyIdx.value = 0;
 				}
 			}
 			GUILayout.EndHorizontal();
 
-			seletedBody = this.core.AllBodies[selectedBodyIdx];
+			seletedBody = this.core.SortedBodyList[selectedBodyIdx];
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 			if (GUILayout.Button("<"))