Added readout help strings.
[VesselSimulator.git] / KerbalEngineer / Flight / Readouts / ReadoutLibrary.cs
blob:a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs -> blob:b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -9,6 +9,7 @@
 

 using KerbalEngineer.Flight.Readouts.Orbital;

 using KerbalEngineer.Flight.Readouts.Surface;

+using KerbalEngineer.Settings;

 

 #endregion

 

@@ -62,6 +63,8 @@
             this.readoutModules.Add(new Longitude());

             this.readoutModules.Add(new Latitude());

             this.readoutModules.Add(new GeeForce());

+

+            this.LoadHelpStrings();

         }

 

         #endregion

@@ -79,7 +82,7 @@
 

         #endregion

 

-        #region Methods

+        #region Public Methods

 

         /// <summary>

         ///     Gets a readout module with the specified name or class name. (Returns null if not found.)

@@ -109,5 +112,22 @@
         }

 

         #endregion

+

+        #region Private Methods

+

+        /// <summary>

+        ///     Loads the help strings from file.

+        /// </summary>

+        private void LoadHelpStrings()

+        {

+            var handler = SettingHandler.Load("HelpStrings.xml");

+            foreach (var readout in this.readoutModules)

+            {

+                readout.HelpString = handler.GetSet(readout.GetType().Name, readout.HelpString);

+            }

+            handler.Save("HelpStrings.xml");

+        }

+

+        #endregion

     }

 }