Fixed preset removal bug.
[VesselSimulator.git] / KerbalEngineer / Flight / Sections / SectionEditor.cs
blob:a/KerbalEngineer/Flight/Sections/SectionEditor.cs -> blob:b/KerbalEngineer/Flight/Sections/SectionEditor.cs
--- a/KerbalEngineer/Flight/Sections/SectionEditor.cs
+++ b/KerbalEngineer/Flight/Sections/SectionEditor.cs
@@ -119,7 +119,7 @@
             try
             {
                 this.InitialiseStyles();
-                ReadoutCategory.Selected = ReadoutCategory.GetCategory("Orbital");
+                //ReadoutCategory.Selected = ReadoutCategory.GetCategory("Orbital");
                 RenderingManager.AddToPostDrawQueue(0, this.Draw);
             }
             catch (Exception ex)
@@ -215,12 +215,20 @@
             this.ParentSection.Name = GUILayout.TextField(this.ParentSection.Name, this.textStyle);
             var isShowingInControlBar = !string.IsNullOrEmpty(this.ParentSection.Abbreviation);
             this.ParentSection.Abbreviation = GUILayout.TextField(this.ParentSection.Abbreviation, this.textStyle, GUILayout.Width(75.0f));
+
+            ParentSection.IsHud = GUILayout.Toggle(this.ParentSection.IsHud, "HUD", this.readoutButtonStyle, GUILayout.Width(50.0f));
+            if (ParentSection.IsHud)
+            {
+                this.ParentSection.IsHudBackground = GUILayout.Toggle(this.ParentSection.IsHudBackground, "BG", this.readoutButtonStyle, GUILayout.Width(50.0f));
+            }
+
             if (this.ParentSection.IsCustom)
             {
                 if (isShowingInControlBar && string.IsNullOrEmpty(this.ParentSection.Abbreviation))
                 {
                     DisplayStack.Instance.RequestResize();
                 }
+
                 if (GUILayout.Button("DELETE SECTION", this.readoutButtonStyle, GUILayout.Width(150.0f)))
                 {
                     this.ParentSection.IsFloating = false;
@@ -296,6 +304,8 @@
             this.ParentSection.Name = preset.Name;
             this.ParentSection.Abbreviation = preset.Abbreviation;
             this.ParentSection.ReadoutModuleNames = preset.ReadoutNames;
+            this.ParentSection.IsHud = preset.IsHud;
+            this.ParentSection.IsHudBackground = preset.IsHudBackground;
             this.presetList.enabled = false;
         }
 
@@ -462,6 +472,8 @@
             preset.Name = this.ParentSection.Name;
             preset.Abbreviation = this.ParentSection.Abbreviation;
             preset.ReadoutNames = this.ParentSection.ReadoutModuleNames;
+            preset.IsHud = this.ParentSection.IsHud;
+            preset.IsHudBackground = this.ParentSection.IsHudBackground;
 
             PresetLibrary.Save(preset);
         }