VOID_Module: Re-added default width and heights to the window calls.
VOID_Module: Re-added default width and heights to the window calls.

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -175,6 +175,8 @@
 		protected VOID_SaveValue<bool> _UseToolbarManager;
 		internal IButton ToolbarButton;
 
+		internal ApplicationLauncherButton AppLauncherButton;
+
 		/*
 		 * Properties
 		 * */
@@ -333,6 +335,12 @@
 				}
 				if (value == true)
 				{
+					if (this.AppLauncherButton != null)
+					{
+						ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
+						this.AppLauncherButton = null;
+					}
+
 					this.InitializeToolbarButton();
 				}
 
@@ -366,9 +374,9 @@
 
 			if (!this.UseToolbarManager)
 			{
-				if (GUI.Button(VOIDIconPos, VOIDIconTexture, this.iconStyle) && this.VOIDIconLocked)
-				{
-					this.ToggleMainWindow();
+				if (this.AppLauncherButton == null)
+				{
+					this.InitializeAppLauncherButton();
 				}
 			}
 			else if (this.ToolbarButton == null)
@@ -483,6 +491,7 @@
 				double radius = this.vessel.Radius();
 				SimManager.Gravity = this.vessel.mainBody.gravParameter /
 					(radius * radius);
+				SimManager.minSimTime = (long)(this.updatePeriod * 1000);
 				SimManager.TryStartSimulation();
 			}
 			else if (!this.vesselSimActive)
@@ -900,6 +909,27 @@
 			};
 
 			Tools.PostDebugMessage(string.Format("{0}: Toolbar Button initialized.", this.GetType().Name));
+		}
+
+		protected void InitializeAppLauncherButton()
+		{
+			if (ApplicationLauncher.Ready)
+			{
+				this.AppLauncherButton = ApplicationLauncher.Instance.AddModApplication(
+					this.ToggleMainWindow, this.ToggleMainWindow,
+					HighLogic.LoadedScene.ToAppScenes(),
+					this.VOIDIconTexture
+				);
+
+				Tools.PostDebugMessage(
+					this,
+					"AppLauncherButton initialized in {0}",
+					Enum.GetName(
+						typeof(GameScenes),
+						HighLogic.LoadedScene
+					)
+				);
+			}
 		}
 
 		protected void ToggleMainWindow()
@@ -937,6 +967,11 @@
 			}
 
 			this.VOIDIconTexture = GameDatabase.Instance.GetTexture(texturePath, false);
+
+			if (this.AppLauncherButton != null)
+			{
+				this.AppLauncherButton.SetTexture(VOIDIconTexture);
+			}
 		}
 
 		protected void CheckAndSave()
@@ -988,6 +1023,27 @@
 			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";

--- a/VOID_Module.cs
+++ b/VOID_Module.cs
@@ -231,7 +231,9 @@
 				this.core.windowID,
 				_Pos,
 				VOID_Tools.GetWindowHandler(this.ModuleWindow),
-				this.Name
+				this.Name,
+				GUILayout.Width(this.defWidth),
+				GUILayout.Height(this.defHeight)
 			);
 
 			_Pos = Tools.ClampRectToScreen (_Pos);

--- a/VOID_Tools.cs
+++ b/VOID_Tools.cs
@@ -334,7 +334,11 @@
 					{
 						func(id);
 					}
+					#if DEBUG
 					catch (ArgumentException ex)
+					#else
+					catch (ArgumentException)
+					#endif
 					{
 						Debug.LogWarning(
 							string.Format("[{0}]: ArgumentException caught during window call.", func.Target.GetType().Name)