A few tweaks around the ApplicationLauncher button to accomodate KSP 0.24.1 fixes.
[VOID.git] / VOID_Core.cs
blob:a/VOID_Core.cs -> blob:b/VOID_Core.cs
--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -348,6 +348,21 @@
 			}
 		}
 
+		protected ApplicationLauncher.AppScenes appIconVisibleScenes
+		{
+			get
+			{
+				if (this is VOID_EditorCore)
+				{
+					return ApplicationLauncher.AppScenes.VAB | ApplicationLauncher.AppScenes.SPH;
+				}
+				else
+				{
+					return ApplicationLauncher.AppScenes.FLIGHT;
+				}
+			}
+		}
+
 		/*
 		 * Methods
 		 * */
@@ -917,7 +932,7 @@
 			{
 				this.AppLauncherButton = ApplicationLauncher.Instance.AddModApplication(
 					this.ToggleMainWindow, this.ToggleMainWindow,
-					HighLogic.LoadedScene.ToAppScenes(),
+					this.appIconVisibleScenes,
 					this.VOIDIconTexture
 				);
 
@@ -1023,27 +1038,6 @@
 			this.configDirty = false;
 		}
 
-		public void onSceneChangeRequested(GameScenes scene)
-		{
-			if (this.AppLauncherButton != null)
-			{
-				if (this is VOID_EditorCore)
-				{
-					if (!HighLogic.LoadedSceneIsEditor)
-					{
-						ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
-					}
-				}
-				else
-				{
-					if (!HighLogic.LoadedSceneIsFlight)
-					{
-						ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
-					}
-				}
-			}
-		}
-
 		protected VOID_Core()
 		{
 			this._Name = "VOID Core";