Added AltitudeUnderWater
Added AltitudeUnderWater

- Will only turn on while splashed.
- Also AltitudeTerrain will switch off while splashed as it is redundant
to AltitudeSeaLevel at that point and not required as a fail save.

--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,4 +1,4 @@
-1.0.19.0
+1.0.19.1, 09-11-15
     Added: Key binding editor accessible under 'Settings' on the Build Engineer.
     Added: Added current vessel name readout. (antplant)
     Added: 'Relative Radial Velocity' and 'Time To Rendezvous' readouts. (itwtx)

--- a/KerbalEngineer/EngineerGlobals.cs
+++ b/KerbalEngineer/EngineerGlobals.cs
@@ -25,7 +25,7 @@
         /// <summary>
         ///     Current version of the Kerbal Engineer assembly.
         /// </summary>
-        public const string ASSEMBLY_VERSION = "1.0.19.0";
+        public const string ASSEMBLY_VERSION = "1.0.19.1";
 
         private static string assemblyFile;
         private static string assemblyName;

--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -98,8 +98,9 @@
                 readouts.Add(new TimeToAtmosphere());
 
                 // Surface
-                readouts.Add(new AltitudeSeaLevel());
-                readouts.Add(new AltitudeTerrain());
+				readouts.Add(new AltitudeSeaLevel());
+				readouts.Add(new AltitudeTerrain());
+				readouts.Add(new AltitudeUnderWater());
                 readouts.Add(new VerticalSpeed());
                 readouts.Add(new VerticalAcceleration());
                 readouts.Add(new HorizontalSpeed());

--- a/KerbalEngineer/Flight/Readouts/Surface/AltitudeTerrain.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/AltitudeTerrain.cs
@@ -36,9 +36,9 @@
 
         public AltitudeTerrain()
         {
-            this.Name = "Altitude (Terrain)";
+			this.Name = "Altitude (Terrain)";
             this.Category = ReadoutCategory.GetCategory("Surface");
-            this.HelpString = "Shows the vessel's altitude above the terrain.";
+            this.HelpString = "Shows the vessel's altitude above the terrain. Turns off if splashed.";
             this.IsDefault = true;
         }
 
@@ -47,15 +47,18 @@
         #region Methods
 
         public override void Draw(SectionModule section)
-        {
-            if (FlightGlobals.ActiveVessel.terrainAltitude > 0.0)
-            {
-                this.DrawLine((FlightGlobals.ship_altitude - FlightGlobals.ActiveVessel.terrainAltitude).ToDistance(), section.IsHud);
-            }
-            else
-            {
-                this.DrawLine((FlightGlobals.ship_altitude).ToDistance(), section.IsHud);
-            }
+		{
+			if (ScienceUtil.GetExperimentSituation (FlightGlobals.ActiveVessel) != ExperimentSituations.SrfSplashed) 
+			{
+				if (FlightGlobals.ActiveVessel.terrainAltitude > 0.0) 
+				{
+					this.DrawLine ((FlightGlobals.ship_altitude - FlightGlobals.ActiveVessel.terrainAltitude).ToDistance (), section.IsHud);
+				} 
+				else 
+				{
+					this.DrawLine ((FlightGlobals.ship_altitude).ToDistance (), section.IsHud);
+				}
+			}
         }
 
         #endregion

--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Surface/AltitudeUnderWater.cs
@@ -1,1 +1,55 @@
+// 
+//     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/>.
+// 
 
+#region Using Directives
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Surface
+{
+    public class AltitudeUnderWater : ReadoutModule
+    {
+        #region Constructors
+
+        public AltitudeUnderWater()
+        {
+            this.Name = "Altitude (Terrain Under Water)";
+            this.Category = ReadoutCategory.GetCategory("Surface");
+            this.HelpString = "While splashed shows the vessel's altitude to the under water Terrain.";
+            this.IsDefault = false;
+        }
+
+        #endregion
+
+        #region Methods: public
+
+        public override void Draw(SectionModule section)
+        {
+			if (ScienceUtil.GetExperimentSituation (FlightGlobals.ActiveVessel) == ExperimentSituations.SrfSplashed) 
+			{
+				this.DrawLine ((-(FlightGlobals.ActiveVessel.terrainAltitude - FlightGlobals.ship_altitude)).ToDistance (), section.IsHud);
+			}
+        }
+
+        #endregion
+    }
+}

--- a/KerbalEngineer/VesselSimulator/EngineSim.cs
+++ b/KerbalEngineer/VesselSimulator/EngineSim.cs
@@ -327,6 +327,7 @@
                         break;
 
                     case ResourceFlowMode.ALL_VESSEL:
+                    case ResourceFlowMode.ALL_VESSEL_BAlANCE:
                         for (int i = 0; i < allParts.Count; i++)
                         {
                             PartSim aPartSim = allParts[i];
@@ -338,6 +339,7 @@
                         break;
 
                     case ResourceFlowMode.STAGE_PRIORITY_FLOW:
+                    case ResourceFlowMode.STAGE_PRIORITY_FLOW_BALANCE:
 
                         foreach (HashSet<PartSim> stagePartSet in stagePartSets.Values)
                         {
@@ -386,6 +388,8 @@
                         break;
 
                     case ResourceFlowMode.STACK_PRIORITY_SEARCH:
+                    case ResourceFlowMode.STAGE_STACK_FLOW:
+                    case ResourceFlowMode.STAGE_STACK_FLOW_BALANCE:
                         visited.Clear();
 
                         if (SimManager.logOutput)

 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ
--- a/Output/KerbalEngineer/KerbalEngineer.version
+++ b/Output/KerbalEngineer/KerbalEngineer.version
@@ -6,7 +6,7 @@
 		"MAJOR":1,
 		"MINOR":0,
 		"PATCH":19,
-		"BUILD":0
+		"BUILD":1
 	},
 	"KSP_VERSION":
 	{