Implemented creation of custom sections via the flight engineer menu.
[VesselSimulator.git] / KerbalEngineer / Flight / FlightAppLauncher.cs
blob:a/KerbalEngineer/Flight/FlightAppLauncher.cs -> blob:b/KerbalEngineer/Flight/FlightAppLauncher.cs
--- a/KerbalEngineer/Flight/FlightAppLauncher.cs
+++ b/KerbalEngineer/Flight/FlightAppLauncher.cs
@@ -113,6 +113,25 @@
             }
         }
 
+        /// <summary>
+        ///     Creates and initialises a new custom section.
+        /// </summary>
+        public ISectionModule NewCustomSection()
+        {
+            SectionModule section = new SectionModule
+            {
+                Name = "Custom " + (SectionLibrary.CustomSections.Count + 1),
+                Abbreviation = "CUST " + (SectionLibrary.CustomSections.Count + 1),
+                IsVisible = true,
+                IsCustom = true,
+                IsEditorVisible = true
+            };
+
+            SectionLibrary.CustomSections.Add(section);
+
+            return section;
+        }
+
         protected override void Awake()
         {
             base.Awake();