Systemic changes to facilitate enable/disable functionality in the editor and maybe fix some bugs elsewhere or something; it's been a long time.
Systemic changes to facilitate enable/disable functionality in the editor and maybe fix some bugs elsewhere or something; it's been a long time.

--- a/CoreStrut.cs
+++ b/CoreStrut.cs
@@ -6,9 +6,6 @@
 // Continued from QuantumStrut, © 2013 BoJaN.  Used with permission.
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using UnityEngine;
 
 namespace QuantumStrut

--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -6,13 +6,9 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("QuantumStrutsContinued")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyDescription("A KSP part mod that provides magical struts for rigidifying vessels constructed outside the VAB.")]
 [assembly: AssemblyProduct("QuantumStrutsContinued")]
 [assembly: AssemblyCopyright("Copyright © 2014 toadicus")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
 
 // Setting ComVisible to false makes the types in this assembly not visible 
 // to COM components.  If you need to access a type in this assembly from 
@@ -32,6 +28,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.*")]
 

--- a/QuantumStrut.cs
+++ b/QuantumStrut.cs
@@ -5,10 +5,8 @@
 //
 // Continued from QuantumStrut, © 2013 BoJaN.  Used with permission.
 
+using KSP;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using UnityEngine;
 
 namespace QuantumStrut
@@ -59,33 +57,35 @@
 		[KSPAction("Activate")]
 		public void ActivateStrut(KSPActionParam param)
 		{
+			this.ActivateStrut();
+		}
+
+		[KSPAction("Deactivate")]
+		public void DeactivateStrut(KSPActionParam param)
+		{
+			this.DeactivateStrut();
+		}
+
+		#endregion
+
+		#region Events
+
+		[KSPEvent(guiActive = true, guiName = "Activate", active = true, guiActiveEditor = true)]
+		public void ActivateStrut()
+		{
 			IsEnabled = true;
 			CheckHit();
-		}
-
-		[KSPAction("Deactivate")]
-		public void DeactivateStrut(KSPActionParam param)
+			this.Events["ActivateStrut"].guiActiveEditor = false;
+			this.Events["DeactivateStrut"].guiActiveEditor = true;
+		}
+
+		[KSPEvent(guiActive = true, guiName = "Deactivate", active = false, guiActiveEditor = false)]
+		public void DeactivateStrut()
 		{
 			IsEnabled = false;
 			CheckHit();
-		}
-
-		#endregion
-
-		#region Events
-
-		[KSPEvent(guiActive = true, guiName = "Activate", active = true, guiActiveUnfocused = true, unfocusedRange = 2f)]
-		public void ActivateStrut()
-		{
-			IsEnabled = true;
-			CheckHit();
-		}
-
-		[KSPEvent(guiActive = true, guiName = "Deactivate", active = false, guiActiveUnfocused = true, unfocusedRange = 2f)]
-		public void DeactivateStrut()
-		{
-			IsEnabled = false;
-			CheckHit();
+			this.Events["ActivateStrut"].guiActiveEditor = true;
+			this.Events["DeactivateStrut"].guiActiveEditor = false;
 		}
 
 		#endregion
@@ -178,15 +178,10 @@
 			base.OnStart(state);
 		}
 
-		public override void OnFixedUpdate()
-		{
-			base.OnFixedUpdate();
-		}
-
-		public override void OnUpdate()
-		{
-			Events["ActivateStrut"].active = !IsEnabled;
-			Events["DeactivateStrut"].active = IsEnabled;
+		public void Update()
+		{
+			Events["ActivateStrut"].guiActiveEditor = Events["ActivateStrut"].active = !IsEnabled;
+			Events["DeactivateStrut"].guiActiveEditor = Events["DeactivateStrut"].active = IsEnabled;
 
 			if (IsEnabled)
 			{
@@ -224,37 +219,68 @@
 
 		void CheckHit()
 		{
+			if (HighLogic.LoadedSceneIsEditor)
+			{
+				Tools.PostDebugMessage(this, "Checking bailing out: in the editor!");
+				return;
+			}
+
 			if (!isEnabled)
 			{
+				Tools.PostDebugMessage(this, "Destroying strut.");
+
 				strut.Destroy();
 				strut = null;
 				return;
 			}
 
+			Tools.PostDebugMessage(this, "Checking for ray hit.");
+
+			Tools.PostDebugMessage(this, "Enabled, continuing.");
+
 			if (strut == null || strut.isDestroyed)
 			{
+				Tools.PostDebugMessage(this, "We have no strut, or the strut has been destroyed.");
+
 				Vector3 dir = getTransform().TransformDirection(Dir);
 				Vector3 start = getTransform().TransformPoint(Start);
 
+				Tools.PostDebugMessage(this, "Got transforms.  Checking for raycast hit.");
+
 				UnityEngine.RaycastHit info = new RaycastHit();
 				bool hit = Physics.Raycast(new UnityEngine.Ray(start + (dir * 0.05f), dir), out info, 10);
+
 				if (hit)
 				{
+					Tools.PostDebugMessage(this, "Found raycast hit.  Fetching target part.");
+
 					Part targetPart = Util.partFromRaycast(info);
 
-					if (targetPart && vessel.parts.Contains(targetPart) && Util.GetEnergy(part.vessel) > 5 * TimeWarp.fixedDeltaTime)
+					Tools.PostDebugMessage(this, "Found target part.");
+
+					if (
+						targetPart && vessel.parts.Contains(targetPart) &&
+						Util.GetEnergy(part.vessel) > 5 * TimeWarp.fixedDeltaTime
+					)
 					{
+						Tools.PostDebugMessage(this, "Target part is in our vessel and we have the energy to continue.");
+
 						strut = new Strut(
 							part,
 							targetPart,
 							targetPart.transform.InverseTransformPoint(info.point),
 							getTransform()
 						);
+
+						Tools.PostDebugMessage(this, "Built a new strut, setting material, colors, and sizes.");
+
 						strut.Material = material;
 						strut.StartColor = startColor;
 						strut.EndColor = endColor;
 						strut.StartSize = StartSize;
 						strut.EndSize = EndSize;
+
+						Tools.PostDebugMessage(this, "Strut all done!");
 					}
 				}
 			}
@@ -304,7 +330,7 @@
 
 					UnityEngine.RaycastHit info = new RaycastHit();
 					bool hit = Physics.Raycast(new UnityEngine.Ray(start + (dir * 0.05f), dir), out info, 10);
-					if (hit)
+					if (hit && IsEnabled)
 					{
 						if (Util.isValid(material))
 							lr.material = material;

--- a/QuantumStrutCore.cs
+++ b/QuantumStrutCore.cs
@@ -5,13 +5,12 @@
 //
 // Continued from QuantumStrut, © 2013 BoJaN.  Used with permission.
 
+using KSP;
+using KSP.IO;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Linq;
-using System.Text;
 using UnityEngine;
-using KSP.IO;
 
 namespace QuantumStrut
 {

file:a/Strut.cs -> file:b/Strut.cs
--- a/Strut.cs
+++ b/Strut.cs
@@ -5,10 +5,8 @@
 //
 // Continued from QuantumStrut, © 2013 BoJaN.  Used with permission.
 
+using KSP;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using UnityEngine;
 
 namespace QuantumStrut

file:b/Tools.cs (new)
--- /dev/null
+++ b/Tools.cs
@@ -1,1 +1,126 @@
+// QuantumStrutsContinued © 2014 toadicus
+//
+// This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a
+// copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
+//
+// Continued from QuantumStrut, © 2013 BoJaN.  Used with permission.
 
+using System.Linq;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace QuantumStrut
+{
+	public static partial class Tools
+	{
+		public enum MessageLevel
+		{
+			Log,
+			Warning,
+			Error,
+			Exception
+		}
+
+		/// <summary>
+		/// Formats objects into a message for logging.
+		/// </summary>
+		/// <param name="Sender">Sending object</param>
+		/// <param name="args">A set of arguments to be printed.</param>
+		private static string FormatMessage(object Sender, params object[] args)
+		{
+			string Msg;
+
+			Msg = string.Format(
+				"{0}:\t{1}",
+				Sender.GetType().Name,
+				string.Join("\n\t", args.Select(a => (string)a).ToArray())
+			);
+
+			return Msg;
+		}
+
+		private static ScreenMessage debugmsg = new ScreenMessage("", 4f, ScreenMessageStyle.UPPER_RIGHT);
+
+		[System.Diagnostics.Conditional("DEBUG")]
+		public static void PostDebugMessage(string Msg)
+		{
+			PostLogMessage(MessageLevel.Log, Msg);
+
+			if (HighLogic.LoadedScene > GameScenes.SPACECENTER)
+			{
+				debugmsg.message = Msg;
+				ScreenMessages.PostScreenMessage(debugmsg, true);
+			}
+		}
+
+		[System.Diagnostics.Conditional("DEBUG")]
+		public static void PostDebugMessage(object Sender, params object[] args)
+		{
+			string Msg;
+			Msg = FormatMessage(Sender, args);
+
+			PostDebugMessage(Msg);
+		}
+
+		/// <summary>
+		/// Posts a message to the KSP log.
+		/// </summary>
+		/// <param name="Level">Log level</param>
+		/// <param name="Msg">The message to be printed</param>
+		public static void PostLogMessage(MessageLevel Level, string Msg)
+		{
+			System.Action<string> logMethod;
+
+			switch (Level)
+			{
+				case MessageLevel.Log:
+					logMethod = Debug.Log;
+					break;
+				case MessageLevel.Warning:
+					logMethod = Debug.LogWarning;
+					break;
+				case MessageLevel.Error:
+					logMethod = Debug.LogError;
+					break;
+				default:
+					throw new System.NotImplementedException("Exception message levels not yet implemented.");
+			}
+
+			logMethod(Msg);
+		}
+
+		/// <summary>
+		/// Posts a message to the KSP log.
+		/// </summary>
+		/// <param name="Level">Log level</param>
+		/// <param name="Sender">Sending object</param>
+		/// <param name="args">A set of arguments to be printed.</param>
+		public static void PostLogMessage(MessageLevel Level, object Sender, params object[] args)
+		{
+			string Msg;
+			Msg = FormatMessage(Sender, args);
+
+			PostLogMessage(Level, Msg);
+		}
+
+		/// <summary>
+		/// Posts a warning message to the KSP log.
+		/// </summary>
+		/// <param name="Msg">The message to be logged.</param>
+		public static void PostWarningMessage(string Msg)
+		{
+			PostLogMessage(MessageLevel.Warning, Msg);
+		}
+
+		/// <summary>
+		/// Posts a warning message to the KSP log.
+		/// </summary>
+		/// <param name="Sender">The sending object</param>
+		/// <param name="args">A set of arguments to be printed.</param>
+		public static void PostWarningMessage(object Sender, params object[] args)
+		{
+			PostLogMessage(MessageLevel.Warning, Sender, args);
+		}
+	}
+}
+

file:a/Util.cs -> file:b/Util.cs
--- a/Util.cs
+++ b/Util.cs
@@ -5,12 +5,9 @@
 //
 // Continued from QuantumStrut, © 2013 BoJaN.  Used with permission.
 
+using KSP.IO;
 using System;
-using System.Collections.Generic;
 using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using KSP.IO;
 using UnityEngine;
 
 namespace QuantumStrut