Fixed editor overlay loading and added heading/pitch/roll rate readouts.
Fixed editor overlay loading and added heading/pitch/roll rate readouts.

--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,3 +1,11 @@
+1.0.12.1
+    Added: New readouts to the vessel category:
+        - Heading Rate
+        - Pitch Rate
+        - Roll Rate
+
+	Fixed: Editor Overlay now loads the saved visibility value properly.
+
 1.0.12.0, 01-12-2014
 	Added: Setting in Build Engineer to enable/disable vectored thrust calculations.
 	Added: Thrust torque field in Build Engineer (courtesy of mic_e).

--- a/KerbalEngineer/Editor/BuildOverlay.cs
+++ b/KerbalEngineer/Editor/BuildOverlay.cs
@@ -196,7 +196,7 @@
         public static void Load()
         {
             var handler = SettingHandler.Load("BuildOverlay.xml");
-            handler.GetSet("visible", Visible);
+            Visible = handler.GetSet("visible", Visible);
             BuildOverlayPartInfo.NamesOnly = handler.GetSet("namesOnly", BuildOverlayPartInfo.NamesOnly);
             BuildOverlayPartInfo.ClickToOpen = handler.GetSet("clickToOpen", BuildOverlayPartInfo.ClickToOpen);
             buildOverlayVessel.Open = handler.GetSet("vesselOpen", buildOverlayVessel.Open);

--- a/KerbalEngineer/EngineerGlobals.cs
+++ b/KerbalEngineer/EngineerGlobals.cs
@@ -33,7 +33,7 @@
         /// <summary>
         ///     Current version of the Kerbal Engineer assembly.
         /// </summary>
-        public const string AssemblyVersion = "1.0.12";
+        public const string AssemblyVersion = "1.0.12.1";
 
         #endregion
 

--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -108,9 +108,6 @@
                 readouts.Add(new VerticalAcceleration());
                 readouts.Add(new HorizontalSpeed());
                 readouts.Add(new HorizontalAcceleration());
-                readouts.Add(new Heading());
-                readouts.Add(new Pitch());
-                readouts.Add(new Roll());
                 readouts.Add(new Latitude());
                 readouts.Add(new Longitude());
                 readouts.Add(new GeeForce());
@@ -146,6 +143,12 @@
                 readouts.Add(new IntakeAirSupply());
                 readouts.Add(new IntakeAirDemandSupply());
                 readouts.Add(new PartCount());
+                readouts.Add(new Heading());
+                readouts.Add(new Pitch());
+                readouts.Add(new Roll());
+                readouts.Add(new HeadingRate());
+                readouts.Add(new PitchRate());
+                readouts.Add(new RollRate());
 
                 // Rendezvous
                 readouts.Add(new TargetSelector());

--- a/KerbalEngineer/Flight/Readouts/Vessel/AttitudeProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/AttitudeProcessor.cs
@@ -34,9 +34,15 @@
         private Vector3 centreOfMass = Vector3.zero;
 
         private double heading;
+        private double headingRate;
         private Vector3 north = Vector3.zero;
         private double pitch;
+        private double pitchRate;
+        private double previousHeading;
+        private double previousPitch;
+        private double previousRoll;
         private double roll;
+        private double rollRate;
         private Quaternion surfaceRotation;
         private Vector3 up = Vector3.zero;
 
@@ -49,6 +55,11 @@
             get { return instance.heading; }
         }
 
+        public static double HeadingRate
+        {
+            get { return instance.headingRate; }
+        }
+
         public static AttitudeProcessor Instance
         {
             get { return instance; }
@@ -59,9 +70,19 @@
             get { return instance.pitch; }
         }
 
+        public static double PitchRate
+        {
+            get { return instance.pitchRate; }
+        }
+
         public static double Roll
         {
             get { return instance.roll; }
+        }
+
+        public static double RollRate
+        {
+            get { return instance.rollRate; }
         }
 
         public bool UpdateRequested { get; set; }
@@ -79,6 +100,10 @@
         {
             this.surfaceRotation = this.GetSurfaceRotation();
 
+            this.previousHeading = this.heading;
+            this.previousPitch = this.pitch;
+            this.previousRoll = this.roll;
+
             // This code was derived from MechJeb2's implementation for getting the vessel's surface relative rotation.
             this.heading = this.surfaceRotation.eulerAngles.y;
             this.pitch = this.surfaceRotation.eulerAngles.x > 180.0f
@@ -87,6 +112,10 @@
             this.roll = this.surfaceRotation.eulerAngles.z > 180.0f
                 ? this.surfaceRotation.eulerAngles.z - 360.0f
                 : this.surfaceRotation.eulerAngles.z;
+
+            this.headingRate = this.heading - this.previousHeading;
+            this.pitchRate = this.pitch - this.previousPitch;
+            this.rollRate = this.roll - this.previousRoll;
         }
 
         private Quaternion GetSurfaceRotation()

--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Vessel/HeadingRate.cs
@@ -1,1 +1,62 @@
+// 
+//     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.Vessel
+{
+    #region Using Directives
+
+    using Helpers;
+    using Sections;
+
+    #endregion
+
+    public class HeadingRate : ReadoutModule
+    {
+        #region Constructors
+
+        public HeadingRate()
+        {
+            this.Name = "Heading Rate";
+            this.Category = ReadoutCategory.GetCategory("Vessel");
+            this.HelpString = string.Empty;
+            this.IsDefault = false;
+        }
+
+        #endregion
+
+        #region Methods
+
+        public override void Draw(SectionModule section)
+        {
+            this.DrawLine(Units.ToAngle(AttitudeProcessor.HeadingRate) + "/sec", section.IsHud);
+        }
+
+        public override void Reset()
+        {
+            FlightEngineerCore.Instance.AddUpdatable(AttitudeProcessor.Instance);
+        }
+
+        public override void Update()
+        {
+            AttitudeProcessor.RequestUpdate();
+        }
+
+        #endregion
+    }
+}

--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Vessel/PitchRate.cs
@@ -1,1 +1,62 @@
+// 
+//     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.Vessel
+{
+    #region Using Directives
+
+    using Helpers;
+    using Sections;
+
+    #endregion
+
+    public class PitchRate : ReadoutModule
+    {
+        #region Constructors
+
+        public PitchRate()
+        {
+            this.Name = "Pitch Rate";
+            this.Category = ReadoutCategory.GetCategory("Vessel");
+            this.HelpString = string.Empty;
+            this.IsDefault = false;
+        }
+
+        #endregion
+
+        #region Methods
+
+        public override void Draw(SectionModule section)
+        {
+            this.DrawLine(Units.ToAngle(AttitudeProcessor.PitchRate) + "/sec", section.IsHud);
+        }
+
+        public override void Reset()
+        {
+            FlightEngineerCore.Instance.AddUpdatable(AttitudeProcessor.Instance);
+        }
+
+        public override void Update()
+        {
+            AttitudeProcessor.RequestUpdate();
+        }
+
+        #endregion
+    }
+}

--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Vessel/RollRate.cs
@@ -1,1 +1,62 @@
+// 
+//     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.Vessel
+{
+    #region Using Directives
+
+    using Helpers;
+    using Sections;
+
+    #endregion
+
+    public class RollRate : ReadoutModule
+    {
+        #region Constructors
+
+        public RollRate()
+        {
+            this.Name = "Roll Rate";
+            this.Category = ReadoutCategory.GetCategory("Vessel");
+            this.HelpString = string.Empty;
+            this.IsDefault = false;
+        }
+
+        #endregion
+
+        #region Methods
+
+        public override void Draw(SectionModule section)
+        {
+            this.DrawLine(Units.ToAngle(AttitudeProcessor.RollRate) + "/sec", section.IsHud);
+        }
+
+        public override void Reset()
+        {
+            FlightEngineerCore.Instance.AddUpdatable(AttitudeProcessor.Instance);
+        }
+
+        public override void Update()
+        {
+            AttitudeProcessor.RequestUpdate();
+        }
+
+        #endregion
+    }
+}

--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -90,6 +90,9 @@
     <Compile Include="Flight\Readouts\Surface\VerticalAcceleration.cs" />
     <Compile Include="Flight\Readouts\Vessel\AttitudeProcessor.cs" />
     <Compile Include="Flight\Readouts\Vessel\DeltaVCurrentTotal.cs" />
+    <Compile Include="Flight\Readouts\Vessel\PitchRate.cs" />
+    <Compile Include="Flight\Readouts\Vessel\HeadingRate.cs" />
+    <Compile Include="Flight\Readouts\Vessel\RollRate.cs" />
     <Compile Include="Flight\Readouts\Vessel\Roll.cs" />
     <Compile Include="Flight\Readouts\Vessel\Pitch.cs" />
     <Compile Include="Flight\Readouts\Vessel\Heading.cs" />

--- a/KerbalEngineer/VesselSimulator/EngineSim.cs
+++ b/KerbalEngineer/VesselSimulator/EngineSim.cs
@@ -267,46 +267,36 @@
                         break;
 
                     case ResourceFlowMode.STAGE_PRIORITY_FLOW:
-                    {
-                        Dictionary<int, HashSet<PartSim>> stagePartSets = new Dictionary<int, HashSet<PartSim>>();
-                        int maxStage = -1;
-                        foreach (PartSim aPartSim in allParts)
-                        {
-                            if (aPartSim.resources[type] > SimManager.RESOURCE_MIN)
-                            {
-                                //int stage = aPartSim.decoupledInStage;            // Use the number of the stage the tank is decoupled in
-                                int stage = aPartSim.DecouplerCount(); // Use the count of decouplers between tank and root
-                                if (stage > maxStage)
-                                {
-                                    maxStage = stage;
-                                }
-                                if (stagePartSets.ContainsKey(stage))
-                                {
-                                    sourcePartSet = stagePartSets[stage];
-                                }
-                                else
-                                {
-                                    sourcePartSet = new HashSet<PartSim>();
-                                    stagePartSets.Add(stage, sourcePartSet);
-                                }
-
-                                sourcePartSet.Add(aPartSim);
-                            }
-                        }
-
-                        while (maxStage >= 0)
-                        {
-                            if (stagePartSets.ContainsKey(maxStage))
-                            {
-                                if (stagePartSets[maxStage].Count() > 0)
-                                {
-                                    sourcePartSet = stagePartSets[maxStage];
-                                    break;
-                                }
-                            }
-                            maxStage--;
-                        }
-                    }
+                        var stagePartSets = new Dictionary<int, HashSet<PartSim>>();
+                        var maxStage = -1;
+
+                        Logger.Log(type);
+                        foreach (var aPartSim in allParts)
+                        {
+                            if (aPartSim.resources[type] <= SimManager.RESOURCE_MIN) continue;
+
+                            var stage = aPartSim.DecouplerCount();
+                            if (stage > maxStage)
+                            {
+                                maxStage = stage;
+                            }
+
+                            if (!stagePartSets.TryGetValue(stage, out sourcePartSet))
+                            {
+                                sourcePartSet = new HashSet<PartSim>();
+                                stagePartSets.Add(stage, sourcePartSet);
+                            }
+                            sourcePartSet.Add(aPartSim);
+                        }
+
+                        for (var i = 0; i <= maxStage; i++)
+                        {
+                            HashSet<PartSim> stagePartSet;
+                            if (stagePartSets.TryGetValue(i, out stagePartSet) && stagePartSet.Count > 0)
+                            {
+                                sourcePartSet = stagePartSet;
+                            }
+                        }
                         break;
 
                     case ResourceFlowMode.STACK_PRIORITY_SEARCH:

--- a/KerbalEngineer/VesselSimulator/SimManager.cs
+++ b/KerbalEngineer/VesselSimulator/SimManager.cs
@@ -325,7 +325,7 @@
                     timer.Start();
                 }
 
-                var parts = HighLogic.LoadedSceneIsEditor ? EditorLogic.SortedShipList : FlightGlobals.ActiveVessel.Parts;
+                var parts = HighLogic.LoadedSceneIsEditor ? EditorLogic.fetch.ship.parts : FlightGlobals.ActiveVessel.Parts;
 
                 // Create the Simulation object in this thread
                 var sim = new Simulation();

--- a/KerbalEngineer/VesselSimulator/Simulation.cs
+++ b/KerbalEngineer/VesselSimulator/Simulation.cs
@@ -786,7 +786,6 @@
                             partSim.DumpPartToBuffer(buffer, "Decoupled part not empty => false: ");
                             MonoBehaviour.print(buffer);
                         }
-
                         return false;
                     }
 

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