Added facility to lock, unlock, and move the VOID icon.
Added facility to lock, unlock, and move the VOID icon.

--- 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
@@ -33,6 +33,11 @@
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <DefineConstants>TRACE</DefineConstants>
+    <CustomCommands>
+      <CustomCommands>
+        <Command type="AfterBuild" command="/usr/bin/cp -fv ${ProjectDir}/bin/Release/VOID.dll /mnt/games/ssd/KSP_linux/GameData/VOID/Plugins/" />
+      </CustomCommands>
+    </CustomCommands>
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
@@ -51,8 +56,6 @@
     <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">

--- a/VOIDFlightMaster.cs
+++ b/VOIDFlightMaster.cs
@@ -54,13 +54,6 @@
 
 		public void Update()
 		{
-			if (!HighLogic.LoadedSceneIsEditor)
-			{
-				this.Core = null;
-				VOID_Core.Reset();
-				return;
-			}
-
 			if (this.Core == null)
 			{
 				this.Awake();
@@ -84,61 +77,23 @@
 
 		public void FixedUpdate()
 		{
-			if (this.Core == null || !HighLogic.LoadedSceneIsFlight)
+			if (this.Core == null)
 			{
 				return;
 			}
 
 			this.Core.FixedUpdate ();
 		}
-    }
 
-	[KSPAddon(KSPAddon.Startup.EditorAny, false)]
-	public class VOIDEditorMaster : MonoBehaviour
-	{
-		protected VOID_EditorCore Core;
-
-		public void Awake()
+		public void OnGUI()
 		{
-			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 ();
+			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;
@@ -471,6 +472,8 @@
 		{
 			this.consumeResource = GUILayout.Toggle (this.consumeResource, "Consume Resources");
 
+			this.VOIDIconLocked = GUILayout.Toggle (this.VOIDIconLocked, "Lock Icon Position");
+
 			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 
 			GUILayout.Label("Skin:", GUILayout.ExpandWidth(false));
@@ -510,6 +513,40 @@
 			this._factoryReset = GUILayout.Toggle (this._factoryReset, "Factory Reset");
 		}
 
+		public void OnGUI()
+		{
+			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 +570,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;
 			}

file:a/VOID_EditorCore.cs (deleted)
--- a/VOID_EditorCore.cs
+++ /dev/null
@@ -1,121 +1,1 @@
-//
-//  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 override void DrawGUI()
-		{
-			if (!this._modulesLoaded)
-			{
-				this.LoadModulesOfType<IVOID_EditorModule>();
-			}
-		}
-
-		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:a/VOID_EditorHUD.cs (deleted)
--- a/VOID_EditorHUD.cs
+++ /dev/null
@@ -1,122 +1,1 @@
-//
-//  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 || this.guiRunning)
+			if (!this.toggleActive)
 			{
 				return;
 			}
@@ -93,10 +93,6 @@
 
 		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;