Added dynamic readout categories.
[VesselSimulator.git] / KerbalEngineer / Flight / Readouts / Surface / ImpactLongitude.cs
blob:a/KerbalEngineer/Flight/Readouts/Surface/ImpactLongitude.cs -> blob:b/KerbalEngineer/Flight/Readouts/Surface/ImpactLongitude.cs
--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactLongitude.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactLongitude.cs
@@ -20,6 +20,8 @@
 #region Using Directives
 
 using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
 
 #endregion
 
@@ -27,14 +29,31 @@
 {
     public class ImpactLongitude : ReadoutModule
     {
-        private bool showing;
+        #region Constructors
 
         public ImpactLongitude()
         {
             this.Name = "Impact Longitude";
             this.Category = ReadoutCategory.GetCategory("Surface");
-            this.HelpString = string.Empty;
-            this.IsDefault = true;
+            this.HelpString = "Longditude of the impact position.";
+            this.IsDefault = false;
+        }
+
+        #endregion
+
+        #region Methods: public
+
+        public override void Draw(SectionModule section)
+        {
+            if (ImpactProcessor.ShowDetails)
+            {
+                this.DrawLine(Units.ToAngleDMS(ImpactProcessor.Longitude) + (ImpactProcessor.Longitude < 0.0 ? "W" : " E"), section.IsHud);
+            }
+        }
+
+        public override void Reset()
+        {
+            FlightEngineerCore.Instance.AddUpdatable(ImpactProcessor.Instance);
         }
 
         public override void Update()
@@ -42,23 +61,6 @@
             ImpactProcessor.RequestUpdate();
         }
 
-        public override void Draw()
-        {
-            if (ImpactProcessor.ShowDetails)
-            {
-                this.showing = true;
-                this.DrawLine(ImpactProcessor.Longitude.ToAngle());
-            }
-            else if (this.showing)
-            {
-                this.showing = false;
-                this.ResizeRequested = true;
-            }
-        }
-
-        public override void Reset()
-        {
-            FlightEngineerCore.Instance.AddUpdatable(ImpactProcessor.Instance);
-        }
+        #endregion
     }
 }