VOID_HUD.cs: Added Experiment Situation indication to the Biome line.
VOID_HUD.cs: Added Experiment Situation indication to the Biome line.

--- a/ToolbarButtonWrapper.cs
+++ b/ToolbarButtonWrapper.cs
@@ -134,11 +134,8 @@
 		protected PropertyInfo ButtonEnalbed;
 		protected PropertyInfo ButtonImportant;
 		protected EventInfo ButtonOnClick;
-		protected System.Type ClickHandlerType;
 		protected EventInfo ButtonOnMouseEnter;
-		protected System.Type MouseEnterHandlerType;
 		protected EventInfo ButtonOnMouseLeave;
-		protected System.Type MouseLeaveHandlerType;
 		protected MethodInfo ButtonDestroy;
 		protected System.Type GameScenesVisibilityType;
 
@@ -437,41 +434,72 @@
 			this.AddButtonEventHandler(this.ButtonOnClick, Handler);
 		}
 
+		/// <summary>
+		/// Adds event handler that can be registered with to receive "on mouse enter" events.
+		/// </summary>
+		/// <example>
+		/// <code>
+		/// ToolbarWrapperButton button = ...
+		/// button.AddButtonOnMouseEnterHandler(
+		/// 	(e) =>
+		/// 	{
+		/// 		Debug.Log("mouse entered button");
+		/// 	}
+		/// );
+		/// </code>
+		/// </example>
+		/// <param name="Handler">Delegate to handle "OnMouseEnter" events.</param>
 		public void AddButtonOnMouseEnterHandler(Action<object> Handler)
 		{
 			this.AddButtonEventHandler(this.ButtonOnMouseEnter, Handler);
 		}
 
+		/// <summary>
+		/// Adds event handler that can be registered with to receive "on mouse leave" events.
+		/// </summary>
+		/// <example>
+		/// <code>
+		/// ToolbarWrapperButton button = ...
+		/// button.AddButtonOnMouseLeaveHandler(
+		/// 	(e) =>
+		/// 	{
+		/// 		Debug.Log("mouse left button");
+		/// 	}
+		/// );
+		/// </code>
+		/// </example>
+		/// <param name="Handler">Delegate to handle "OnMouseLeave" events.</param>
 		public void AddButtonOnMouseLeaveHandler(Action<object> Handler)
 		{
 			this.AddButtonEventHandler(this.ButtonOnMouseLeave, Handler);
 		}
 
+		/// <summary>
+		/// Sets this button's visibility. Can be used in addition to or as a replacement for <see cref="Visible"/>.
+		/// </summary>
+		/// <param name="gameScenes">Array of GameScene objects in which the button should be visible.</param>
+		public void SetButtonVisibility(params GameScenes[] gameScenes)
+		{
+			object GameScenesVisibilityObj = Activator.CreateInstance(this.GameScenesVisibilityType, gameScenes);
+			this.ButtonVisibility.SetValue(this.Button, GameScenesVisibilityObj, null);
+		}
+
+		/// <summary>
+		/// Permanently destroys this button so that it is no longer displayed.
+		/// Should be used when a plugin is stopped to remove leftover buttons.
+		/// </summary>
+		public void Destroy()
+		{
+			this.ButtonDestroy.Invoke(this.Button, null);
+		}
+
+		// Utility method for use with the AddButton<event>Handler API methods.
 		protected void AddButtonEventHandler(EventInfo Event, Action<object> Handler)
 		{
 			Delegate d = Delegate.CreateDelegate(Event.EventHandlerType, Handler.Target, Handler.Method);
 			MethodInfo addHandler = Event.GetAddMethod();
 			addHandler.Invoke(this.Button, new object[] { d });
 		}
-
-		/// <summary>
-		/// Sets this button's visibility. Can be used in addition to or as a replacement for <see cref="Visible"/>.
-		/// </summary>
-		/// <param name="gameScenes">Array of GameScene objects in which the button should be visible.</param>
-		public void SetButtonVisibility(params GameScenes[] gameScenes)
-		{
-			object GameScenesVisibilityObj = Activator.CreateInstance(this.GameScenesVisibilityType, gameScenes);
-			this.ButtonVisibility.SetValue(this.Button, GameScenesVisibilityObj, null);
-		}
-
-		/// <summary>
-		/// Permanently destroys this button so that it is no longer displayed.
-		/// Should be used when a plugin is stopped to remove leftover buttons.
-		/// </summary>
-		public void Destroy()
-		{
-			this.ButtonDestroy.Invoke(this.Button, null);
-		}
 	}
 }
 

file:a/Tools.cs -> file:b/Tools.cs
--- a/Tools.cs
+++ b/Tools.cs
@@ -959,6 +959,59 @@
 			return icon;
 		}
 
+		public static ExperimentSituations GetExperimentSituation(this Vessel vessel)
+		{
+			Vessel.Situations situation = vessel.situation;
+
+			switch (situation)
+			{
+				case Vessel.Situations.PRELAUNCH:
+				case Vessel.Situations.LANDED:
+					return ExperimentSituations.SrfLanded;
+				case Vessel.Situations.SPLASHED:
+					return ExperimentSituations.SrfSplashed;
+				case Vessel.Situations.FLYING:
+					if (vessel.altitude < (double)vessel.mainBody.scienceValues.flyingAltitudeThreshold)
+					{
+						return ExperimentSituations.FlyingLow;
+					}
+					else
+					{
+						return ExperimentSituations.FlyingHigh;
+					}
+			}
+
+			if (vessel.altitude < (double)vessel.mainBody.scienceValues.spaceAltitudeThreshold)
+			{
+				return ExperimentSituations.InSpaceLow;
+			}
+			else
+			{
+				return ExperimentSituations.InSpaceHigh;
+			}
+		}
+
+		public static string HumanString(this ExperimentSituations situation)
+		{
+			switch (situation)
+			{
+				case ExperimentSituations.FlyingHigh:
+					return "Upper Atmosphere";
+				case ExperimentSituations.FlyingLow:
+					return "Flying";
+				case ExperimentSituations.SrfLanded:
+					return "Surface";
+				case ExperimentSituations.InSpaceLow:
+					return "Near in Space";
+				case ExperimentSituations.InSpaceHigh:
+					return "High in Space";
+				case ExperimentSituations.SrfSplashed:
+					return "Splashed Down";
+				default:
+					return "Unknown";
+			}
+		}
+
 		private static ScreenMessage debugmsg = new ScreenMessage("", 2f, ScreenMessageStyle.UPPER_RIGHT);
 
 		[System.Diagnostics.Conditional("DEBUG")]

--- a/VOID_HUD.cs
+++ b/VOID_HUD.cs
@@ -113,7 +113,8 @@
 					" Lon: " + Tools.GetLongitudeString (vessel, "F3") +
 					"\nHdg: " + Tools.MuMech_get_heading (vessel).ToString ("F2") + "° " +
 					Tools.get_heading_text (Tools.MuMech_get_heading (vessel)) +
-					"\nBiome: " + Tools.Toadicus_GetAtt (vessel).name,
+					"\nBiome: " + Tools.Toadicus_GetAtt (vessel).name +
+					" Sit: " + vessel.GetExperimentSituation().HumanString(),
 					VOID_Core.Instance.LabelStyles["hud"]);
 			}
 			else