VOID_Core: Wrapped some of the flight-specific things in HighLogic.LoadedSceneIs
VOID_Core: Wrapped some of the flight-specific things in HighLogic.LoadedSceneIs
Editor checks.
VOID_EditorCore: Disable icon relocation; clamp to window instead.

--- a/IVOID_Module.cs
+++ b/IVOID_Module.cs
@@ -39,12 +39,12 @@
 		void _SaveToConfig(KSP.IO.PluginConfiguration config);
 	}
 
-	
-
 	public interface IVOID_BehaviorModule : IVOID_Module
 	{
 		void Update();
 		void FixedUpdate();
 	}
+
+	public interface IVOID_EditorModule : IVOID_Module {}
 }
 

--- a/VOID.csproj
+++ b/VOID.csproj
@@ -22,7 +22,7 @@
     <ConsolePause>false</ConsolePause>
     <CustomCommands>
       <CustomCommands>
-        <Command type="AfterBuild" command="/usr/bin/cp -fv ${ProjectDir}/bin/Debug/VOID.dll /mnt/games/ssd/KSP_linux/GameData/VOID/Plugins/" />
+        <Command type="AfterBuild" command="xcopy /Y ${ProjectDir}\bin\Debug\*.dll ..\..\..\Games\KSP_win\GameData\VOID\Plugins\" workingdir="${ProjectDir}" externalConsole="True" />
       </CustomCommands>
     </CustomCommands>
   </PropertyGroup>
@@ -33,6 +33,11 @@
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <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" />
+      </CustomCommands>
+    </CustomCommands>
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
@@ -51,19 +56,18 @@
     <Compile Include="VOID_Rendezvous.cs" />
     <Compile Include="VOID_VesselRegister.cs" />
     <Compile Include="VOID_DataLogger.cs" />
+    <Compile Include="VOID_EditorCore.cs" />
+    <Compile Include="VOID_EditorHUD.cs" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="Assembly-CSharp">
-      <HintPath>..\..\..\..\..\mnt\games-ssd\KSP_linux\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
-      <Private>False</Private>
+      <HintPath>..\..\..\Games\KSP_win\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>..\..\..\..\..\mnt\games-ssd\KSP_linux\KSP_Data\Managed\UnityEngine.dll</HintPath>
-      <Private>False</Private>
+      <HintPath>..\..\..\Games\KSP_win\KSP_Data\Managed\UnityEngine.dll</HintPath>
     </Reference>
     <Reference Include="System">
-      <HintPath>..\..\..\..\..\mnt\games-ssd\KSP_linux\KSP_Data\Managed\System.dll</HintPath>
-      <Private>False</Private>
+      <HintPath>..\..\..\Games\KSP_win\KSP_Data\Managed\System.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>

--- a/VOIDFlightMaster.cs
+++ b/VOIDFlightMaster.cs
@@ -54,6 +54,13 @@
 
 		public void Update()
 		{
+			if (!HighLogic.LoadedSceneIsEditor)
+			{
+				this.Core = null;
+				VOID_Core.Reset();
+				return;
+			}
+
 			if (this.Core == null)
 			{
 				this.Awake();
@@ -77,13 +84,81 @@
 
 		public void FixedUpdate()
 		{
-			if (this.Core == null)
+			if (this.Core == null || !HighLogic.LoadedSceneIsFlight)
 			{
 				return;
 			}
 
 			this.Core.FixedUpdate ();
 		}
+
+		public void OnGUI()
+		{
+			if (this.Core == null)
+			{
+				return;
+			}
+
+			this.Core.OnGUI();
+		}
     }
+
+	[KSPAddon(KSPAddon.Startup.EditorAny, false)]
+	public class VOIDEditorMaster : MonoBehaviour
+	{
+		protected VOID_EditorCore Core;
+
+		public void Awake()
+		{
+			Tools.PostDebugMessage ("VOIDEditorMaster: Waking up.");
+			this.Core = VOID_EditorCore.Instance;
+			this.Core.StartGUI ();
+			Tools.PostDebugMessage ("VOIDEditorMaster: Awake.");
+		}
+
+		public void Update()
+		{
+			if (!HighLogic.LoadedSceneIsEditor)
+			{
+				this.Core = null;
+				VOID_EditorCore.Reset();
+				return;
+			}
+
+			if (this.Core == null)
+			{
+				this.Awake();
+			}
+
+			this.Core.Update ();
+
+			if (this.Core.factoryReset)
+			{
+				KSP.IO.File.Delete<VOID_EditorCore>("config.xml");
+				this.Core = null;
+				VOID_EditorCore.Reset();
+			}
+		}
+
+		public void FixedUpdate()
+		{
+			if (this.Core == null || !HighLogic.LoadedSceneIsEditor)
+			{
+				return;
+			}
+
+			this.Core.FixedUpdate ();
+		}
+
+		public void OnGUI()
+		{
+			if (this.Core == null)
+			{
+				return;
+			}
+
+			this.Core.OnGUI();
+		}
+	}
 }
 

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -97,6 +97,7 @@
 		protected Texture2D VOIDIconTexture;
 		protected string VOIDIconOnPath = "VOID/Textures/void_icon_on";
 		protected string VOIDIconOffPath = "VOID/Textures/void_icon_off";
+		protected bool VOIDIconLocked = true;
 
 		protected int windowBaseID = -96518722;
 		protected int _windowID = 0;
@@ -430,12 +431,16 @@
 		{
 			GUILayout.BeginVertical();
 			
-			if (this.powerAvailable)
-			{
-				string str = "ON";
-				if (togglePower) str = "OFF";
-				if (GUILayout.Button("Power " + str)) togglePower = !togglePower;
-			    if (togglePower)
+			if (this.powerAvailable || HighLogic.LoadedSceneIsEditor)
+			{
+				if (!HighLogic.LoadedSceneIsEditor)
+				{
+					string str = "ON";
+					if (togglePower) str = "OFF";
+					if (GUILayout.Button("Power " + str)) togglePower = !togglePower;
+				}
+
+				if (togglePower || HighLogic.LoadedSceneIsEditor)
 			    {
 					foreach (IVOID_Module module in this.Modules)
 					{
@@ -469,7 +474,12 @@
 
 		public override void DrawConfigurables()
 		{
-			this.consumeResource = GUILayout.Toggle (this.consumeResource, "Consume Resources");
+			if (HighLogic.LoadedSceneIsFlight)
+			{
+				this.consumeResource = GUILayout.Toggle (this.consumeResource, "Consume Resources");
+
+				this.VOIDIconLocked = GUILayout.Toggle (this.VOIDIconLocked, "Lock Icon Position");
+			}
 
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 
@@ -510,6 +520,59 @@
 			this._factoryReset = GUILayout.Toggle (this._factoryReset, "Factory Reset");
 		}
 
+		public void OnGUI()
+		{
+			if (Event.current.type == EventType.Repaint)
+			{
+				return;
+			}
+
+			Tools.PostDebugMessage(string.Format(
+				"Event.current.type: {0}" +
+				"\nthis.VOIDIconLocked: {1}" +
+				"\nEvent.current.mousePosition: {2}" +
+				"\nVOIDIconPos: ({3}, {4}),({5}, {6})",
+				Event.current.type,
+				this.VOIDIconLocked,
+				Event.current.mousePosition,
+				this.VOIDIconPos.value.xMin,
+				this.VOIDIconPos.value.yMin,
+				this.VOIDIconPos.value.xMax,
+				this.VOIDIconPos.value.yMax
+				));
+
+			if (!this.VOIDIconLocked &&
+			    VOIDIconPos.value.Contains(Event.current.mousePosition)
+			    && Event.current.type == EventType.mouseDrag
+			    )
+			{
+				Tools.PostDebugMessage(string.Format(
+					"Event.current.type: {0}" +
+					"\ndelta.x: {1}; delta.y: {2}",
+					Event.current.type,
+					Event.current.delta.x,
+					Event.current.delta.y
+				));
+
+				Rect tmp = new Rect(VOIDIconPos);
+
+				tmp.x = Event.current.mousePosition.x - tmp.width / 2;
+				tmp.y = Event.current.mousePosition.y - tmp.height / 2;
+
+				if (tmp.x > Screen.width - tmp.width)
+				{
+					tmp.x = Screen.width - tmp.width;
+				}
+
+				if (tmp.y > Screen.height - tmp.height)
+				{
+					tmp.y = Screen.height - tmp.height;
+				}
+
+				VOIDIconPos = tmp;
+			}
+		}
+
 		public override void DrawGUI()
 		{
 			if (!this._modulesLoaded)
@@ -533,7 +596,7 @@
 
 			this.VOIDIconTexture = this.VOIDIconOff;  //icon off default
 			if (this.togglePower) this.VOIDIconTexture = this.VOIDIconOn;     //or on if power_toggle==true
-			if (GUI.Button(new Rect(VOIDIconPos), VOIDIconTexture, new GUIStyle()))
+			if (GUI.Button(VOIDIconPos, VOIDIconTexture, new GUIStyle()) && this.VOIDIconLocked)
 			{
 				this.mainGuiMinimized = !this.mainGuiMinimized;
 			}

--- /dev/null
+++ b/VOID_EditorCore.cs
@@ -1,1 +1,145 @@
+//
+//  VOID_EditorCore.cs
+//
+//  Author:
+//       toadicus <>
+//
+//  Copyright (c) 2013 toadicus
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+using Engineer.VesselSimulator;
+using KSP;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
 
+namespace VOID
+{
+	public class VOID_EditorCore : VOID_Core
+	{
+		/*
+		 * Static Members
+		 * */
+		protected new static bool _initialized = false;
+		public new static bool Initialized
+		{
+			get 
+			{
+				return _initialized;
+			}
+		}
+
+		protected new static VOID_EditorCore _instance;
+		public new static VOID_EditorCore Instance
+		{
+			get
+			{
+				if (_instance == null)
+				{
+					_instance = new VOID_EditorCore();
+					_initialized = true;
+				}
+				return _instance;
+			}
+		}
+
+		public new static void Reset()
+		{
+			if (_initialized)
+			{
+				_instance.StopGUI();
+				_instance = null;
+				_initialized = false;
+			}
+		}
+
+		public VOID_EditorCore() : base()
+		{
+			this._Name = "VOID Editor Core";
+		}
+
+		public new void OnGUI() {}
+
+		public override void DrawGUI()
+		{
+			if (!this._modulesLoaded)
+			{
+				this.LoadModulesOfType<IVOID_EditorModule>();
+			}
+
+			Rect _iconPos = new Rect(this.VOIDIconPos);
+			Vector2 _iconCtr = new Vector2 ();
+			_iconCtr.x = ((Rect)this.mainWindowPos).center.x;
+
+			if (this.mainWindowPos.value.center.y < Screen.height / 2)
+			{
+				_iconCtr.y = ((Rect)this.mainWindowPos).yMin - 15;
+			}
+			else
+			{
+				_iconCtr.y = ((Rect)this.mainWindowPos).yMax + 15;
+			}
+
+			_iconPos.center = _iconCtr;
+
+			if (this.VOIDIconPos != _iconPos)
+			{
+				this.VOIDIconPos = _iconPos;
+			}
+
+			base.DrawGUI();
+		}
+
+		public new void Update()
+		{
+			foreach (IVOID_EditorModule module in this.Modules)
+			{
+				if (EditorLogic.startPod == null)
+				{
+					module.StopGUI();
+					continue;
+				}
+				if (HighLogic.LoadedSceneIsEditor && module.toggleActive && EditorLogic.SortedShipList.Any())
+				{
+					module.StartGUI();
+				}
+				if (!HighLogic.LoadedSceneIsEditor || !module.toggleActive || !EditorLogic.SortedShipList.Any())
+				{
+					module.StopGUI();
+				}
+			}
+
+			if (EditorLogic.startPod == null)
+			{
+				this.StopGUI();
+				return;
+			}
+			else if (!this.guiRunning)
+			{
+				this.StartGUI();
+			}
+
+			if (EditorLogic.SortedShipList.Count > 0)
+			{
+				SimManager.Instance.Gravity = 9.08665;
+				SimManager.Instance.TryStartSimulation();
+			}
+		}
+
+		public new void FixedUpdate() {}
+	}
+}
+
+

file:b/VOID_EditorHUD.cs (new)
--- /dev/null
+++ b/VOID_EditorHUD.cs
@@ -1,1 +1,122 @@
+//
+//  VOID_Hud.cs
+//
+//  Author:
+//       toadicus <>
+//
+//  Copyright (c) 2013 toadicus
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
 
+using Engineer.VesselSimulator;
+using KSP;
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace VOID
+{
+	public class VOID_EditorHUD : VOID_Module, IVOID_EditorModule
+	{
+		/*
+		 * Fields
+		 * */
+		[AVOID_SaveValue("colorIndex")]
+		protected VOID_SaveValue<int> _colorIndex = 0;
+
+		protected List<Color> textColors = new List<Color>();
+
+		protected GUIStyle labelStyle;
+
+		/*
+		 * Properties
+		 * */
+		public int ColorIndex
+		{
+			get
+			{
+				return this._colorIndex;
+			}
+			set
+			{
+				if (this._colorIndex >= this.textColors.Count - 1)
+				{
+					this._colorIndex = 0;
+					return;
+				}
+
+				this._colorIndex = value;
+			}
+		}
+
+		/* 
+		 * Methods
+		 * */
+		public VOID_EditorHUD() : base()
+		{
+			this._Name = "Heads-Up Display";
+
+			this._Active = true;
+
+			this.textColors.Add(Color.green);
+			this.textColors.Add(Color.black);
+			this.textColors.Add(Color.white);
+			this.textColors.Add(Color.red);
+			this.textColors.Add(Color.blue);
+			this.textColors.Add(Color.yellow);
+			this.textColors.Add(Color.gray);
+			this.textColors.Add(Color.cyan);
+			this.textColors.Add(Color.magenta);
+
+			this.labelStyle = new GUIStyle ();
+			this.labelStyle.alignment = TextAnchor.UpperRight;
+			this.labelStyle.normal.textColor = this.textColors [this.ColorIndex];
+
+			Tools.PostDebugMessage (this.GetType().Name + ": Constructed.");
+		}
+
+		public override void DrawGUI()
+		{
+			SimManager.Instance.RequestSimulation();
+
+			if (SimManager.Instance.LastStage == null)
+			{
+				return;
+			}
+
+			// GUI.skin = AssetBase.GetGUISkin("KSP window 2");
+
+			labelStyle.normal.textColor = textColors [ColorIndex];
+
+			GUI.Label (
+				new Rect (Screen.width - 310, 80, 300f, 32f),
+				"Total Mass: " + SimManager.Instance.LastStage.totalMass.ToString("F3") + "t" +
+				" Part Count: " + EditorLogic.SortedShipList.Count +
+				"\nTotal Delta-V: " + Tools.MuMech_ToSI(SimManager.Instance.LastStage.totalDeltaV) + "m/s" +
+				"\nBottom Stage Delta-V: " + Tools.MuMech_ToSI(SimManager.Instance.LastStage.deltaV) + "m/s" +
+				"\nBottom Stage T/W Ratio: " + SimManager.Instance.LastStage.thrustToWeight.ToString("F3"),
+				labelStyle);
+		}
+
+		public override void DrawConfigurables()
+		{
+			if (GUILayout.Button ("Change HUD color", GUILayout.ExpandWidth (false)))
+			{
+				++this.ColorIndex;
+			}
+		}
+	}
+}
+

--- a/VOID_Module.cs
+++ b/VOID_Module.cs
@@ -81,7 +81,7 @@
 		 * */
 		public void StartGUI()
 		{
-			if (!this.toggleActive)
+			if (!this.toggleActive || this.guiRunning)
 			{
 				return;
 			}
@@ -93,6 +93,10 @@
 
 		public void StopGUI()
 		{
+			if (!this.guiRunning)
+			{
+				return;
+			}
 			Tools.PostDebugMessage (string.Format("Removing {0} from the draw queue.", this.GetType().Name));
 			RenderingManager.RemoveFromPostDrawQueue (3, this.DrawGUI);
 			this._Running = false;