Fixed errors and made compilable for KSP v1.1 (runs but contains bugs).
Fixed errors and made compilable for KSP v1.1 (runs but contains bugs).

--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,3 +1,5 @@
+    Changed: Thermal flux is now correctly indicated in kilowatts.
+
 1.0.19.4, 12-02-16
     Fixed: Only 'STAGE_STACK_FLOW' and 'STAGE_STACK_FLOW_BALANCE' resources include surface mounted parts as fuel targets.
     Fixed: Fairing mass being doubled in the VAB (removed workaround for a KSP bug which has been fixed).

--- a/KerbalEngineer/Editor/BuildOverlayPartInfo.cs
+++ b/KerbalEngineer/Editor/BuildOverlayPartInfo.cs
@@ -28,7 +28,7 @@
     public class BuildOverlayPartInfo : MonoBehaviour
     {
         private static bool clickToOpen = true;
-        private static ModuleGenerator.GeneratorResource generatorResource;
+        private static ModuleResource generatorResource;
         private static ModuleAlternator moduleAlternator;
         private static ModuleDataTransmitter moduleDataTransmitter;
         private static ModuleDeployableSolarPanel moduleDeployableSolarPanel;
@@ -131,7 +131,7 @@
                     position.x = Input.mousePosition.x - 3 - position.width;
                 }
 
-                part = EditorLogic.fetch.ship.parts.Find(p => p.stackIcon.highlightIcon) ?? EditorLogic.SelectedPart;
+                part = EditorLogic.fetch.ship.parts.Find(p => p.stackIcon.Highlighted) ?? EditorLogic.SelectedPart;
                 if (part != null)
                 {
                     if (!part.Equals(selectedPart))

--- a/KerbalEngineer/Editor/BuildToolbar.cs
+++ b/KerbalEngineer/Editor/BuildToolbar.cs
@@ -27,6 +27,9 @@
 
 namespace KerbalEngineer.Editor
 {
+    using KSP.UI;
+    using KSP.UI.Screens;
+
     [KSPAddon(KSPAddon.Startup.EditorAny, false)]
     public class BuildToolbar : MonoBehaviour
     {
@@ -95,16 +98,16 @@
 
                 if (EditorLogic.fetch != null && EditorLogic.fetch.ship.parts.Count > 0)
                 {
-                    if (BuildAdvanced.Instance.Visible && this.button.State != RUIToggleButton.ButtonState.TRUE)
+                    if (BuildAdvanced.Instance.Visible && this.button.toggleButton.CurrentState != UIRadioButton.State.True)
                     {
                         this.button.SetTrue();
                     }
-                    else if (!BuildAdvanced.Instance.Visible && this.button.State != RUIToggleButton.ButtonState.FALSE)
+                    else if (!BuildAdvanced.Instance.Visible && this.button.toggleButton.CurrentState != UIRadioButton.State.False)
                     {
                         this.button.SetFalse();
                     }
                 }
-                else if (this.button.State != RUIToggleButton.ButtonState.DISABLED)
+                else if (this.button.toggleButton.Interactable)
                 {
                     this.button.Disable();
                 }

--- a/KerbalEngineer/Flight/ActionMenu.cs
+++ b/KerbalEngineer/Flight/ActionMenu.cs
@@ -27,6 +27,8 @@
 
 namespace KerbalEngineer.Flight
 {
+    using KSP.UI.Screens;
+
     /// <summary>
     ///     Graphical controller for section interaction in the form of a menu system.
     /// </summary>
@@ -90,11 +92,11 @@
                 {
                     return;
                 }
-                if (FlightEngineerCore.IsDisplayable && this.button.State == RUIToggleButton.ButtonState.DISABLED)
+                if (FlightEngineerCore.IsDisplayable && this.button.toggleButton.Interactable == false)
                 {
                     this.button.Enable();
                 }
-                else if (!FlightEngineerCore.IsDisplayable && this.button.State != RUIToggleButton.ButtonState.DISABLED)
+                else if (!FlightEngineerCore.IsDisplayable && this.button.toggleButton.Interactable)
                 {
                     this.button.Disable();
                 }

--- a/KerbalEngineer/Flight/Readouts/Miscellaneous/LogSimToggle.cs
+++ /dev/null
@@ -1,56 +1,1 @@
-// 
-//     Kerbal Engineer Redux
-// 
-//     Copyright (C) 2014 CYBUTEK
-// 
-//     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/>.
-// 
 
-namespace KerbalEngineer.Flight.Readouts.Miscellaneous
-{
-    #region Using Directives
-
-    using Sections;
-    using UnityEngine;
-    using VesselSimulator;
-
-    #endregion
-
-    public class LogSimToggle : ReadoutModule
-    {
-        #region Constructors
-
-        public LogSimToggle()
-        {
-            this.Name = "Log Simulation";
-            this.Category = ReadoutCategory.GetCategory("Miscellaneous");
-            this.HelpString = "Shows a button that allows you to make the next run of the simulation code dump extra debugging output.";
-            this.IsDefault = false;
-        }
-
-        #endregion
-
-        #region Methods
-
-        public override void Draw(SectionModule section)
-        {
-            GUILayout.BeginHorizontal();
-            GUILayout.Label("Log Simulation: ", this.NameStyle);
-            SimManager.logOutput = GUILayout.Toggle(SimManager.logOutput, "ENABLED", this.ButtonStyle);
-            GUILayout.EndHorizontal();
-        }
-
-        #endregion
-    }
-}

--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -192,7 +192,6 @@
                 readouts.Add(new SimulationDelay());
                 readouts.Add(new VectoredThrustToggle());
                 readouts.Add(new SystemTime());
-                readouts.Add(new LogSimToggle());
 
                 LoadHelpStrings();
             }

--- a/KerbalEngineer/Flight/Readouts/Surface/HorizontalSpeed.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/HorizontalSpeed.cs
@@ -45,12 +45,11 @@
 
         public override void Draw(SectionModule section)
         {
-            this.DrawLine(FlightGlobals.ActiveVessel.horizontalSrfSpeed.ToSpeed(), section.IsHud);
-
-            // This workaround was used for KSP 1.0.3 and 1.0.4 where horizontalSrfSpeed was really badly broken
-            //var ves = FlightGlobals.ActiveVessel;
-            //double horizSpeed = Math.Sqrt(ves.srfSpeed * ves.srfSpeed - ves.verticalSpeed * ves.verticalSpeed);
-            //this.DrawLine(horizSpeed.ToSpeed(), section.IsHud);
+            // Used to do this but the bug-fix to horizontalSrfSpeed in KSP 1.0.3 actually made it worse so workaround
+            //this.DrawLine(FlightGlobals.ActiveVessel.horizontalSrfSpeed.ToSpeed(), section.IsHud);
+            var ves = FlightGlobals.ActiveVessel;
+            double horizSpeed = Math.Sqrt(ves.srfSpeed * ves.srfSpeed - ves.verticalSpeed * ves.verticalSpeed);
+            this.DrawLine(horizSpeed.ToSpeed(), section.IsHud);
         }
 
         #endregion

--- a/KerbalEngineer/Helpers/TimeFormatter.cs
+++ b/KerbalEngineer/Helpers/TimeFormatter.cs
@@ -28,11 +28,11 @@
 
             if (seconds > 0.0)
             {
-                years = (int)(seconds / KSPUtil.Year);
-                seconds -= years * KSPUtil.Year;
+                years = (int)(seconds / KSPUtil.dateTimeFormatter.Year);
+                seconds -= years * KSPUtil.dateTimeFormatter.Year;
 
-                days = (int)(seconds / KSPUtil.Day);
-                seconds -= days * KSPUtil.Day;
+                days = (int)(seconds / KSPUtil.dateTimeFormatter.Day);
+                seconds -= days * KSPUtil.dateTimeFormatter.Day;
 
                 hours = (int)(seconds / 3600.0);
                 seconds -= hours * 3600.0;

--- a/KerbalEngineer/Helpers/Units.cs
+++ b/KerbalEngineer/Helpers/Units.cs
@@ -127,7 +127,7 @@
 
         public static string ToFlux(double value)
         {
-            return value.ToString("#,0.00") + "W";
+            return value.ToString("#,0.00") + "kW";
         }
 
         public static string ToForce(double value)

--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -51,7 +51,6 @@
     <Compile Include="Extensions\StringExtensions.cs" />
     <Compile Include="Flight\ActionMenuGui.cs" />
     <Compile Include="Flight\Presets\Preset.cs" />
-    <Compile Include="Flight\Readouts\Miscellaneous\LogSimToggle.cs" />
     <Compile Include="Flight\Readouts\Miscellaneous\SystemTime.cs" />
     <Compile Include="Flight\Readouts\Miscellaneous\VectoredThrustToggle.cs" />
     <Compile Include="Flight\Readouts\Miscellaneous\Separator.cs" />
@@ -242,6 +241,22 @@
       <HintPath>..\..\Game\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
       <Private>False</Private>
     </Reference>
+    <Reference Include="Assembly-CSharp-firstpass">
+      <HintPath>..\..\game\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="KSPAssets">
+      <HintPath>..\..\game\KSP_Data\Managed\KSPAssets.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="KSPCore">
+      <HintPath>..\..\game\KSP_Data\Managed\KSPCore.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="KSPUtil">
+      <HintPath>..\..\game\KSP_Data\Managed\KSPUtil.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="System">
       <HintPath>..\Game\KSP_Data\Managed\System.dll</HintPath>
       <Private>False</Private>
@@ -252,6 +267,10 @@
     </Reference>
     <Reference Include="UnityEngine">
       <HintPath>..\..\Game\KSP_Data\Managed\UnityEngine.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="UnityEngine.UI">
+      <HintPath>..\..\game\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
       <Private>False</Private>
     </Reference>
   </ItemGroup>

--- a/KerbalEngineer/KeyBinding/KeyBindPopup.cs
+++ b/KerbalEngineer/KeyBinding/KeyBindPopup.cs
@@ -179,6 +179,10 @@
             GUILayout.BeginVertical(HighLogic.Skin.textArea);
             GUILayout.Label("Key Bind: " + Name);
             GUILayout.Label("Selected: " + Binding);
+            if (GUILayout.Button("Clear", HighLogic.Skin.button))
+            {
+                Binding = KeyCode.None;
+            }
             GUILayout.EndVertical();
 
             // Window buttons.

--- a/KerbalEngineer/TapeDriveAnimator.cs
+++ b/KerbalEngineer/TapeDriveAnimator.cs
@@ -83,6 +83,8 @@
         private bool sceneIsEditor;
         private float speed;
         private float targetSpeed;
+        private Renderer renderer;
+        private Light light;
 
         #endregion
 
@@ -120,6 +122,8 @@
 
         public override void OnStart(StartState state)
         {
+            renderer = GetComponent<Renderer>();
+
             this.random = new Random();
 
             this.StopBakedAnimation();
@@ -167,37 +171,37 @@
             if (this.Lights1 != "")
             {
                 this.lights1Transform = this.part.FindModelTransform(this.Lights1);
-                this.lights1ShaderOff = this.lights1Transform.renderer.material.shader;
+                this.lights1ShaderOff = renderer.material.shader;
             }
 
             if (this.Lights2 != "")
             {
                 this.lights2Transform = this.part.FindModelTransform(this.Lights2);
-                this.lights2ShaderOff = this.lights2Transform.renderer.material.shader;
+                this.lights2ShaderOff = renderer.material.shader;
             }
 
             if (this.Lights3 != "")
             {
                 this.lights3Transform = this.part.FindModelTransform(this.Lights3);
-                this.lights3ShaderOff = this.lights3Transform.renderer.material.shader;
+                this.lights3ShaderOff = renderer.material.shader;
             }
 
             if (this.Lights4 != "")
             {
                 this.lights4Transform = this.part.FindModelTransform(this.Lights4);
-                this.lights4ShaderOff = this.lights4Transform.renderer.material.shader;
+                this.lights4ShaderOff = renderer.material.shader;
             }
 
             if (this.Lights5 != "")
             {
                 this.lights5Transform = this.part.FindModelTransform(this.Lights5);
-                this.lights5ShaderOff = this.lights5Transform.renderer.material.shader;
+                this.lights5ShaderOff = renderer.material.shader;
             }
 
             if (this.Lights6 != "")
             {
                 this.lights6Transform = this.part.FindModelTransform(this.Lights6);
-                this.lights6ShaderOff = this.lights6Transform.renderer.material.shader;
+                this.lights6ShaderOff = renderer.material.shader;
             }
 
             this.lightsShaderOn = Shader.Find("Unlit/Texture");
@@ -381,7 +385,7 @@
                 lightsOn = (this.speed == 0);
             }
 
-            lights.renderer.material.shader = lightsOn ? @on : off;
+            lights.GetComponent<Renderer>().material.shader = lightsOn ? @on : off;
         }
 
         #endregion

--- a/KerbalEngineer/VesselSimulator/EngineSim.cs
+++ b/KerbalEngineer/VesselSimulator/EngineSim.cs
@@ -72,30 +72,26 @@
         }
 
         public static EngineSim New(PartSim theEngine,
-									ModuleEngines engineMod,
-									double atmosphere,
-									float machNumber,
-									bool vectoredThrust,
-									bool fullThrust,
-									LogMsg log)
-        {
-            float maxFuelFlow = engineMod.maxFuelFlow;
-            float minFuelFlow = engineMod.minFuelFlow;
-            float thrustPercentage = engineMod.thrustPercentage;
-            Vector3 vecThrust = CalculateThrustVector(vectoredThrust ? engineMod.thrustTransforms : null, log);
-            FloatCurve atmosphereCurve = engineMod.atmosphereCurve;
-            bool atmChangeFlow = engineMod.atmChangeFlow;
-            FloatCurve atmCurve = engineMod.useAtmCurve ? engineMod.atmCurve : null;
-            FloatCurve velCurve = engineMod.useVelCurve ? engineMod.velCurve : null;
-            float currentThrottle = engineMod.currentThrottle;
-            float IspG = engineMod.g;
-            bool throttleLocked = engineMod.throttleLocked || fullThrust;
-            List<Propellant> propellants = engineMod.propellants;
-            bool active = engineMod.isOperational;
-            float resultingThrust = engineMod.resultingThrust;
-            List<Transform> thrustTransforms = engineMod.thrustTransforms;
-			
-			EngineSim engineSim = pool.Borrow();
+                         double atmosphere,
+                         float machNumber,
+                         float maxFuelFlow,
+                         float minFuelFlow,
+                         float thrustPercentage,
+                         Vector3 vecThrust,
+                         FloatCurve atmosphereCurve,
+                         bool atmChangeFlow,
+                         FloatCurve atmCurve,
+                         FloatCurve velCurve,
+                         float currentThrottle,
+                         float IspG,
+                         bool throttleLocked,
+                         List<Propellant> propellants,
+                         bool active,
+                         float resultingThrust,
+                         List<Transform> thrustTransforms,
+                        LogMsg log)
+        {
+            EngineSim engineSim = pool.Borrow();
 
             engineSim.isp = 0.0;
             engineSim.maxMach = 0.0f;
@@ -124,7 +120,7 @@
                     log.buf.AppendFormat("actual  = {0:g6}\n", engineSim.actualThrust);
                 }
 
-				if (throttleLocked)
+                if (throttleLocked)
                 {
                     if (log != null) log.buf.AppendLine("throttleLocked is true, using thrust for flowRate");
                     flowRate = GetFlowRate(engineSim.thrust, engineSim.isp);
@@ -133,8 +129,7 @@
                 {
                     if (currentThrottle > 0.0f && engineSim.partSim.isLanded == false)
                     {
-						// TODO: This bit doesn't work for RF engines
-						if (log != null) log.buf.AppendLine("throttled up and not landed, using actualThrust for flowRate");
+                        if (log != null) log.buf.AppendLine("throttled up and not landed, using actualThrust for flowRate");
                         flowRate = GetFlowRate(engineSim.actualThrust, engineSim.isp);
                     }
                     else
@@ -208,32 +203,6 @@
 
             return engineSim;
         }
-
-		private static Vector3 CalculateThrustVector(List<Transform> thrustTransforms, LogMsg log)
-		{
-			if (thrustTransforms == null)
-			{
-				return Vector3.forward;
-			}
-
-			Vector3 thrustvec = Vector3.zero;
-			for (int i = 0; i < thrustTransforms.Count; ++i)
-			{
-				Transform trans = thrustTransforms[i];
-
-				if (log != null) log.buf.AppendFormat("Transform = ({0:g6}, {1:g6}, {2:g6})   length = {3:g6}\n", trans.forward.x, trans.forward.y, trans.forward.z, trans.forward.magnitude);
-
-				thrustvec -= trans.forward;
-			}
-
-			if (log != null) log.buf.AppendFormat("ThrustVec  = ({0:g6}, {1:g6}, {2:g6})   length = {3:g6}\n", thrustvec.x, thrustvec.y, thrustvec.z, thrustvec.magnitude);
-
-			thrustvec.Normalize();
-
-			if (log != null) log.buf.AppendFormat("ThrustVecN = ({0:g6}, {1:g6}, {2:g6})   length = {3:g6}\n", thrustvec.x, thrustvec.y, thrustvec.z, thrustvec.magnitude);
-
-			return thrustvec;
-		}
 
         public ResourceContainer ResourceConsumptions
         {

--- a/KerbalEngineer/VesselSimulator/PartSim.cs
+++ b/KerbalEngineer/VesselSimulator/PartSim.cs
@@ -234,13 +234,27 @@
                     {
                         if (log != null) log.buf.AppendLine("Module: " + engine.moduleName);
 
+                        Vector3 thrustvec = this.CalculateThrustVector(vectoredThrust ? engine.thrustTransforms : null, log);
+
                         EngineSim engineSim = EngineSim.New(
                             this,
-							engine,
-							atmosphere,
+                            atmosphere,
                             (float)mach,
-							vectoredThrust,
-							fullThrust,
+                            engine.maxFuelFlow,
+                            engine.minFuelFlow,
+                            engine.thrustPercentage,
+                            thrustvec,
+                            engine.atmosphereCurve,
+                            engine.atmChangeFlow,
+                            engine.useAtmCurve ? engine.atmCurve : null,
+                            engine.useVelCurve ? engine.velCurve : null,
+                            engine.currentThrottle,
+                            engine.g,
+                            engine.throttleLocked || fullThrust,
+                            engine.propellants,
+                            engine.isOperational,
+                            engine.resultingThrust,
+                            engine.thrustTransforms,
                             log);
                         allEngines.Add(engineSim);
                     }
@@ -254,14 +268,28 @@
                     ModuleEngines engine = engines[i];
                     if (log != null) log.buf.AppendLine("Module: " + engine.moduleName);
 
+                    Vector3 thrustvec = this.CalculateThrustVector(vectoredThrust ? engine.thrustTransforms : null, log);
+
                     EngineSim engineSim = EngineSim.New(
                         this,
-						engine,
                         atmosphere,
                         (float)mach,
-						vectoredThrust,
-						fullThrust,
-						log);
+                        engine.maxFuelFlow,
+                        engine.minFuelFlow,
+                        engine.thrustPercentage,
+                        thrustvec,
+                        engine.atmosphereCurve,
+                        engine.atmChangeFlow,
+                        engine.useAtmCurve ? engine.atmCurve : null,
+                        engine.useVelCurve ? engine.velCurve : null,
+                        engine.currentThrottle,
+                        engine.g,
+                        engine.throttleLocked || fullThrust,
+                        engine.propellants,
+                        engine.isOperational,
+                        engine.resultingThrust,
+                        engine.thrustTransforms,
+                        log);
                     allEngines.Add(engineSim);
                 }
             }

 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ