Merge branch 'laptop_dev' 0.9.10
Merge branch 'laptop_dev'

--- a/VOID.csproj
+++ b/VOID.csproj
@@ -22,7 +22,7 @@
     <ConsolePause>false</ConsolePause>
     <CustomCommands>
       <CustomCommands>
-        <Command type="AfterBuild" command="xcopy /Y ${ProjectDir}\bin\Debug\*.dll ..\..\..\Games\KSP_win\GameData\VOID\Plugins\" workingdir="${ProjectDir}" externalConsole="True" />
+        <Command type="AfterBuild" command="/usr/bin/cp -fv ${ProjectDir}/bin/Debug/VOID.dll /mnt/games/ssd/KSP_linux/GameData/VOID/Plugins/" />
       </CustomCommands>
     </CustomCommands>
   </PropertyGroup>
@@ -35,7 +35,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <CustomCommands>
       <CustomCommands>
-        <Command type="AfterBuild" command="xcopy /Y ${ProjectDir}\bin\Release\*.dll ..\..\..\Games\KSP_win\GameData\VOID\Plugins\" workingdir="${ProjectDir}" externalConsole="True" />
+        <Command type="AfterBuild" command="/usr/bin/cp -fv ${ProjectDir}/bin/Release/VOID.dll /mnt/games/ssd/KSP_linux/GameData/VOID/Plugins/" />
       </CustomCommands>
     </CustomCommands>
   </PropertyGroup>
@@ -61,13 +61,16 @@
   </ItemGroup>
   <ItemGroup>
     <Reference Include="Assembly-CSharp">
-      <HintPath>..\..\..\Games\KSP_win\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
+      <HintPath>..\..\..\..\..\mnt\games-ssd\KSP_linux\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>..\..\..\Games\KSP_win\KSP_Data\Managed\UnityEngine.dll</HintPath>
+      <HintPath>..\..\..\..\..\mnt\games-ssd\KSP_linux\KSP_Data\Managed\UnityEngine.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="System">
-      <HintPath>..\..\..\Games\KSP_win\KSP_Data\Managed\System.dll</HintPath>
+      <HintPath>..\..\..\..\..\mnt\games-ssd\KSP_linux\KSP_Data\Managed\System.dll</HintPath>
+      <Private>False</Private>
     </Reference>
   </ItemGroup>
   <ItemGroup>

--- a/VOIDFlightMaster.cs
+++ b/VOIDFlightMaster.cs
@@ -55,8 +55,9 @@
 
 		public void Update()
 		{
-			if (!HighLogic.LoadedSceneIsEditor)
+			if (!HighLogic.LoadedSceneIsFlight && this.Core != null)
 			{
+				this.Core.SaveConfig ();
 				this.Core = null;
 				VOID_Core.Reset();
 				return;
@@ -120,8 +121,9 @@
 
 		public void Update()
 		{
-			if (!HighLogic.LoadedSceneIsEditor)
+			if (!HighLogic.LoadedSceneIsEditor && this.Core != null)
 			{
+				this.Core.SaveConfig ();
 				this.Core = null;
 				VOID_EditorCore.Reset();
 				return;

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -68,7 +68,7 @@
 		 * Fields
 		 * */
 		protected string VoidName = "VOID";
-		protected string VoidVersion = "0.9.9";
+		protected string VoidVersion = "0.9.10";
 
 		protected bool _factoryReset = false;
 
@@ -130,8 +130,9 @@
 
 		public float saveTimer = 0;
 
-		protected string defaultSkin = "KSP window 2";
-		protected VOID_SaveValue<int> _skinIdx = int.MinValue;
+		[AVOID_SaveValue("defaultSkin")]
+		protected VOID_SaveValue<string> defaultSkin = "KSP window 2";
+		protected int _skinIdx = int.MinValue;
 		protected List<GUISkin> skin_list;
 		protected string[] forbiddenSkins =
 		{
@@ -246,6 +247,13 @@
 				));
 			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,
@@ -520,7 +528,12 @@
 			{
 				this._skinIdx--;
 				if (this._skinIdx < 0) this._skinIdx = skin_list.Count - 1;
-				Tools.PostDebugMessage("[VOID] new this._skin = " + this._skinIdx + " :: skin_list.Count = " + skin_list.Count);
+				Tools.PostDebugMessage (string.Format (
+					"{0}: new this._skinIdx = {1} :: skin_list.Count = {2}",
+					this.GetType().Name,
+					this._skinIdx,
+					this.skin_list.Count
+				));
 			}
 
 			string skin_name = skin_list[this._skinIdx].name;
@@ -534,7 +547,17 @@
 			{
 				this._skinIdx++;
 				if (this._skinIdx >= skin_list.Count) this._skinIdx = 0;
-				Tools.PostDebugMessage("[VOID] new this._skin = " + this._skinIdx + " :: skin_list.Count = " + skin_list.Count);
+				Tools.PostDebugMessage (string.Format (
+					"{0}: new this._skinIdx = {1} :: skin_list.Count = {2}",
+					this.GetType().Name,
+					this._skinIdx,
+					this.skin_list.Count
+					));
+			}
+
+			if (this.Skin.name != this.defaultSkin)
+			{
+				this.defaultSkin = this.Skin.name;
 			}
 
 			GUILayout.EndHorizontal();

--- a/VOID_SaveValue.cs
+++ b/VOID_SaveValue.cs
@@ -85,7 +85,7 @@
 
 			if (VOID_EditorCore.Initialized)
 			{
-				VOID_Core.Instance.configDirty = true;
+				VOID_EditorCore.Instance.configDirty = true;
 			}
 
 			return r;