Added career mode limitations.
Added career mode limitations.

--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,6 +1,10 @@
 1.0.14.0,
+    Added: Career mode that limits the Flight Engineer by:
+        - Requiring an Engineer Kerbal of any level, or placement of an Engineer Chip or ER-7500 part.
+        - Tracking station level 3 enables Flight Engineer everywhere.
+
     Added: New readouts to the miscellaneous category:
-        System Time
+        - System Time
 
     Added: Editor Overlay Tab's X position is now changable in the BuildOverlay.xml settings file.
     Changed: Editor Overlay Tabs start position moved over as to not overlap the parts menu.

--- a/KerbalEngineer/Editor/BuildAdvanced.cs
+++ b/KerbalEngineer/Editor/BuildAdvanced.cs
@@ -168,11 +168,6 @@
             }
         }
 
-        private void GetStageInfo()
-        {
-            this.stages = SimManager.Stages;
-        }
-
         protected void OnGUI()
         {
             try
@@ -479,8 +474,14 @@
 
             GUILayout.BeginHorizontal();
             GUILayout.Label("Flight Engineer activation mode:", this.settingStyle);
-            FlightEngineerPartless.IsPartless = GUILayout.Toggle(FlightEngineerPartless.IsPartless, "PARTLESS", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
-            FlightEngineerPartless.IsPartless = !GUILayout.Toggle(!FlightEngineerPartless.IsPartless, "MODULE", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+            FlightEngineerCore.IsCareerMode = GUILayout.Toggle(FlightEngineerCore.IsCareerMode, "CAREER", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+            FlightEngineerCore.IsCareerMode = !GUILayout.Toggle(!FlightEngineerCore.IsCareerMode, "PARTLESS", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            GUILayout.Label("Flight Engineer Career Limitations:", this.settingStyle);
+            FlightEngineerCore.IsKerbalLimited = GUILayout.Toggle(FlightEngineerCore.IsKerbalLimited, "KERBAL", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+            FlightEngineerCore.IsTrackingStationLimited = GUILayout.Toggle(FlightEngineerCore.IsTrackingStationLimited, "TRACKING", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
             GUILayout.EndHorizontal();
 
             GUILayout.BeginHorizontal();
@@ -583,6 +584,11 @@
                 BuildOverlayPartInfo.Hidden = false;
                 this.isEditorLocked = false;
             }
+        }
+
+        private void GetStageInfo()
+        {
+            this.stages = SimManager.Stages;
         }
 
         /// <summary>

--- a/KerbalEngineer/Flight/ActionMenu.cs
+++ b/KerbalEngineer/Flight/ActionMenu.cs
@@ -79,11 +79,11 @@
                 {
                     return;
                 }
-                if (FlightEngineerCore.Instance != null && this.button.State == RUIToggleButton.ButtonState.DISABLED)
+                if (FlightEngineerCore.IsDisplayable && this.button.State == RUIToggleButton.ButtonState.DISABLED)
                 {
                     this.button.Enable();
                 }
-                else if (FlightEngineerCore.Instance == null && this.button.State != RUIToggleButton.ButtonState.DISABLED)
+                else if (!FlightEngineerCore.IsDisplayable && this.button.State != RUIToggleButton.ButtonState.DISABLED)
                 {
                     this.button.Disable();
                 }

--- a/KerbalEngineer/Flight/ActionMenuGui.cs
+++ b/KerbalEngineer/Flight/ActionMenuGui.cs
@@ -132,7 +132,7 @@
         {
             try
             {
-                if (this.Hidden)
+                if (this.Hidden || !FlightEngineerCore.IsDisplayable)
                 {
                     return;
                 }

--- a/KerbalEngineer/Flight/DisplayStack.cs
+++ b/KerbalEngineer/Flight/DisplayStack.cs
@@ -33,6 +33,8 @@
 
 namespace KerbalEngineer.Flight
 {
+    using Upgradeables;
+
     /// <summary>
     ///     Graphical controller for displaying stacked sections.
     /// </summary>
@@ -150,7 +152,7 @@
         {
             try
             {
-                if (FlightEngineerCore.Instance == null)
+                if (!FlightEngineerCore.IsDisplayable)
                 {
                     return;
                 }
@@ -177,7 +179,7 @@
         {
             try
             {
-                if (FlightEngineerCore.Instance == null)
+                if (!FlightEngineerCore.IsDisplayable)
                 {
                     return;
                 }

--- a/KerbalEngineer/Flight/FlightEngineerCore.cs
+++ b/KerbalEngineer/Flight/FlightEngineerCore.cs
@@ -19,21 +19,27 @@
 
 #region Using Directives
 
-using System;
-using System.Collections.Generic;
-
-using KerbalEngineer.Flight.Readouts;
-using KerbalEngineer.Flight.Sections;
-
-using UnityEngine;
-
 #endregion
 
 namespace KerbalEngineer.Flight
 {
+    #region Using Directives
+
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using Extensions;
+    using Readouts;
+    using Sections;
+    using Settings;
+    using UnityEngine;
+
+    #endregion
+
     /// <summary>
     ///     Core management system for the Flight Engineer.
     /// </summary>
+    [KSPAddon(KSPAddon.Startup.Flight, false)]
     public sealed class FlightEngineerCore : MonoBehaviour
     {
         #region Instance
@@ -45,7 +51,210 @@
 
         #endregion
 
+        #region Fields
+
+        private static bool isCareerMode = true;
+        private static bool isKerbalLimited = true;
+        private static bool isTrackingStationLimited = true;
+
+        #endregion
+
         #region Constructors
+
+        static FlightEngineerCore()
+        {
+            try
+            {
+                var handler = SettingHandler.Load("FlightEngineerCore.xml");
+                handler.Get("isCareerMode", ref isCareerMode);
+                handler.Get("isKerbalLimited", ref isKerbalLimited);
+                handler.Get("isTrackingStationLimited", ref isTrackingStationLimited);
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
+            }
+        }
+
+        #endregion
+
+        #region Properties
+
+        /// <summary>
+        ///     Gets and sets whether to the Flight Engineer should be run using career limitations.
+        /// </summary>
+        public static bool IsCareerMode
+        {
+            get { return isCareerMode; }
+            set
+            {
+                try
+                {
+                    if (isCareerMode != value)
+                    {
+                        var handler = SettingHandler.Load("FlightEngineerCore.xml");
+                        handler.Set("isCareerMode", value);
+                        handler.Save("FlightEngineerCore.xml");
+                    }
+                    isCareerMode = value;
+                }
+                catch (Exception ex)
+                {
+                    Logger.Exception(ex);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Gets whether the FlightEngineer should be displayed.
+        /// </summary>
+        public static bool IsDisplayable
+        {
+            get
+            {
+                if (isCareerMode)
+                {
+                    if (isKerbalLimited && FlightGlobals.ActiveVessel.GetVesselCrew().Exists(c => c.experienceTrait.TypeName == "Engineer"))
+                    {
+                        return true;
+                    }
+                    if (isTrackingStationLimited && ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.TrackingStation) == 1.0f)
+                    {
+                        return true;
+                    }
+                    return FlightGlobals.ActiveVessel.parts.Any(p => p.HasModule<FlightEngineerModule>());
+                }
+
+                return true;
+            }
+        }
+
+        /// <summary>
+        ///     Gets and sets whether to the Flight Engineer should be kerbal limited.
+        /// </summary>
+        public static bool IsKerbalLimited
+        {
+            get { return isKerbalLimited; }
+            set
+            {
+                try
+                {
+                    if (isKerbalLimited != value)
+                    {
+                        var handler = SettingHandler.Load("FlightEngineerCore.xml");
+                        handler.Set("isKerbalLimited", value);
+                        handler.Save("FlightEngineerCore.xml");
+                    }
+                    isKerbalLimited = value;
+                }
+                catch (Exception ex)
+                {
+                    Logger.Exception(ex);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Gets and sets whether to the Flight Engineer should be tracking station limited.
+        /// </summary>
+        public static bool IsTrackingStationLimited
+        {
+            get { return isTrackingStationLimited; }
+            set
+            {
+                try
+                {
+                    if (isTrackingStationLimited != value)
+                    {
+                        var handler = SettingHandler.Load("FlightEngineerCore.xml");
+                        handler.Set("isTrackingStationLimited", value);
+                        handler.Save("FlightEngineerCore.xml");
+                    }
+                    isTrackingStationLimited = value;
+                }
+                catch (Exception ex)
+                {
+                    Logger.Exception(ex);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Gets the editor windows for sections with open editors.
+        /// </summary>
+        public List<SectionEditor> SectionEditors { get; private set; }
+
+        /// <summary>
+        ///     Gets the section windows for floating sections.
+        /// </summary>
+        public List<SectionWindow> SectionWindows { get; private set; }
+
+        /// <summary>
+        ///     Gets the list of currently running updatable modules.
+        /// </summary>
+        public List<IUpdatable> UpdatableModules { get; private set; }
+
+        #endregion
+
+        #region Methods
+
+        /// <summary>
+        ///     Creates a section editor, adds it to the FlightEngineerCore and returns a reference to it.
+        /// </summary>
+        public SectionEditor AddSectionEditor(SectionModule section)
+        {
+            try
+            {
+                var editor = this.gameObject.AddComponent<SectionEditor>();
+                editor.ParentSection = section;
+                editor.Position = new Rect(section.EditorPositionX, section.EditorPositionY, SectionEditor.Width, SectionEditor.Height);
+                this.SectionEditors.Add(editor);
+                return editor;
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
+                return null;
+            }
+        }
+
+        /// <summary>
+        ///     Creates a section window, adds it to the FlightEngineerCore and returns a reference to it.
+        /// </summary>
+        public SectionWindow AddSectionWindow(SectionModule section)
+        {
+            try
+            {
+                var window = this.gameObject.AddComponent<SectionWindow>();
+                window.ParentSection = section;
+                window.WindowPosition = new Rect(section.FloatingPositionX, section.FloatingPositionY, 0, 0);
+                this.SectionWindows.Add(window);
+                return window;
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
+                return null;
+            }
+        }
+
+        /// <summary>
+        ///     Adds an updatable object to be automatically updated every frame and will ignore duplicate objects.
+        /// </summary>
+        public void AddUpdatable(IUpdatable updatable)
+        {
+            try
+            {
+                if (!this.UpdatableModules.Contains(updatable))
+                {
+                    this.UpdatableModules.Add(updatable);
+                }
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
+            }
+        }
 
         /// <summary>
         ///     Create base Flight Engineer child objects.
@@ -63,7 +272,51 @@
             }
             catch (Exception ex)
             {
-                Logger.Exception(ex, "FlightEngineerCore->Awake");
+                Logger.Exception(ex);
+            }
+        }
+
+        /// <summary>
+        ///     Fixed update all required Flight Engineer objects.
+        /// </summary>
+        private void FixedUpdate()
+        {
+            try
+            {
+                SectionLibrary.FixedUpdate();
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
+            }
+        }
+
+        /// <summary>
+        ///     Force the destruction of child objects on core destruction.
+        /// </summary>
+        private void OnDestroy()
+        {
+            try
+            {
+                SectionLibrary.Save();
+
+                foreach (var window in this.SectionWindows)
+                {
+                    print("[FlightEngineer]: Destroying Floating Window for " + window.ParentSection.Name);
+                    Destroy(window);
+                }
+
+                foreach (var editor in this.SectionEditors)
+                {
+                    print("[FlightEngineer]: Destroying Editor Window for " + editor.ParentSection.Name);
+                    Destroy(editor);
+                }
+
+                Logger.Log("FlightEngineerCore->OnDestroy");
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
             }
         }
 
@@ -80,44 +333,6 @@
             }
             catch (Exception ex)
             {
-                Logger.Exception(ex, "FlightEngineerCore->Start");
-            }
-        }
-
-        #endregion
-
-        #region Properties
-
-        /// <summary>
-        ///     Gets the section windows for floating sections.
-        /// </summary>
-        public List<SectionWindow> SectionWindows { get; private set; }
-
-        /// <summary>
-        ///     Gets the editor windows for sections with open editors.
-        /// </summary>
-        public List<SectionEditor> SectionEditors { get; private set; }
-
-        /// <summary>
-        ///     Gets the list of currently running updatable modules.
-        /// </summary>
-        public List<IUpdatable> UpdatableModules { get; private set; }
-
-        #endregion
-
-        #region Updating
-
-        /// <summary>
-        ///     Fixed update all required Flight Engineer objects.
-        /// </summary>
-        private void FixedUpdate()
-        {
-            try
-            {
-                SectionLibrary.FixedUpdate();
-            }
-            catch (Exception ex)
-            {
                 Logger.Exception(ex);
             }
         }
@@ -134,7 +349,7 @@
             }
             catch (Exception ex)
             {
-                Logger.Exception(ex, "FlightEngineerCore->Update");
+                Logger.Exception(ex);
             }
         }
 
@@ -164,102 +379,7 @@
             }
             catch (Exception ex)
             {
-                Logger.Exception(ex, "FlightEngineerCore->UpdateModules");
-            }
-        }
-
-        #endregion
-
-        #region Destruction
-
-        /// <summary>
-        ///     Force the destruction of child objects on core destruction.
-        /// </summary>
-        private void OnDestroy()
-        {
-            try
-            {
-                SectionLibrary.Save();
-
-                foreach (var window in this.SectionWindows)
-                {
-                    print("[FlightEngineer]: Destroying Floating Window for " + window.ParentSection.Name);
-                    Destroy(window);
-                }
-
-                foreach (var editor in this.SectionEditors)
-                {
-                    print("[FlightEngineer]: Destroying Editor Window for " + editor.ParentSection.Name);
-                    Destroy(editor);
-                }
-
-                Logger.Log("FlightEngineerCore->OnDestroy");
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerCore->OnDestroy");
-            }
-        }
-
-        #endregion
-
-        #region Methods
-
-        /// <summary>
-        ///     Creates a section window, adds it to the FlightEngineerCore and returns a reference to it.
-        /// </summary>
-        public SectionWindow AddSectionWindow(SectionModule section)
-        {
-            try
-            {
-                var window = this.gameObject.AddComponent<SectionWindow>();
-                window.ParentSection = section;
-                window.WindowPosition = new Rect(section.FloatingPositionX, section.FloatingPositionY, 0, 0);
-                this.SectionWindows.Add(window);
-                return window;
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerCore->AddSectionWindow");
-                return null;
-            }
-        }
-
-        /// <summary>
-        ///     Creates a section editor, adds it to the FlightEngineerCore and returns a reference to it.
-        /// </summary>
-        public SectionEditor AddSectionEditor(SectionModule section)
-        {
-            try
-            {
-                var editor = this.gameObject.AddComponent<SectionEditor>();
-                editor.ParentSection = section;
-                editor.Position = new Rect(section.EditorPositionX, section.EditorPositionY, SectionEditor.Width, SectionEditor.Height);
-                this.SectionEditors.Add(editor);
-                return editor;
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerCore->AddSectionEditor");
-                return null;
-            }
-        }
-
-        /// <summary>
-        ///     Adds an updatable object to be automatically updated every frame and will ignore duplicate objects.
-        /// </summary>
-        public void AddUpdatable(IUpdatable updatable)
-        {
-            try
-            {
-                if (!this.UpdatableModules.Contains(updatable))
-                {
-                    this.UpdatableModules.Add(updatable);
-                }
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerCore->AddUpdatable");
+                Logger.Exception(ex);
             }
         }
 

--- a/KerbalEngineer/Flight/FlightEngineerModule.cs
+++ b/KerbalEngineer/Flight/FlightEngineerModule.cs
@@ -19,9 +19,6 @@
 
 #region Using Directives
 
-using System;
-using System.Linq;
-
 #endregion
 
 namespace KerbalEngineer.Flight
@@ -29,73 +26,5 @@
     /// <summary>
     ///     Module that can be attached to parts, giving them FlightEngineerCore management.
     /// </summary>
-    public sealed class FlightEngineerModule : PartModule
-    {
-        #region Fields
-
-        /// <summary>
-        ///     Contains the current FlightEngineerCore through the lifespan of this part.
-        /// </summary>
-        private FlightEngineerCore flightEngineerCore;
-
-        #endregion
-
-        #region Updating
-
-        /// <summary>
-        ///     Logic to create and destroy the FlightEngineerCore.
-        /// </summary>
-        private void Update()
-        {
-            try
-            {
-                if (!HighLogic.LoadedSceneIsFlight || FlightEngineerPartless.IsPartless)
-                {
-                    return;
-                }
-
-                if (this.vessel == FlightGlobals.ActiveVessel)
-                {
-                    // Checks for an existing instance of FlightEngineerCore, and if this part is the first part containing FlightEngineerModule within the vessel.
-                    if (flightEngineerCore == null && this.part == this.vessel.parts.FirstOrDefault(p => p.Modules.Contains("FlightEngineerModule")))
-                    {
-                        this.flightEngineerCore = this.gameObject.AddComponent<FlightEngineerCore>();
-                    }
-                }
-                else if (flightEngineerCore != null)
-                {
-                    // Using DestroyImmediate to force early destruction and keep saving/loading in synch when switching vessels.
-                    DestroyImmediate(flightEngineerCore);
-                }
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerModule->Update");
-            }
-        }
-
-        #endregion
-
-        #region Destruction
-
-        /// <summary>
-        ///     Force the destruction of the FlightEngineerCore on part destruction.
-        /// </summary>
-        private void OnDestroy()
-        {
-            try
-            {
-                if (flightEngineerCore != null)
-                {
-                    DestroyImmediate(flightEngineerCore);
-                }
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerModule->OnDestroy");
-            }
-        }
-
-        #endregion
-    }
+    public class FlightEngineerModule : PartModule { }
 }

--- a/KerbalEngineer/Flight/FlightEngineerPartless.cs
+++ /dev/null
@@ -1,101 +1,1 @@
-// 
-//     Kerbal Engineer Redux
-// 
-//     Copyright (C) 2014 CYBUTEK
-// 
-//     This program is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 3 of the License, or
-//     (at your option) any later version.
-// 
-//     This program is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-// 
-//     You should have received a copy of the GNU General Public License
-//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
-// 
 
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Settings;
-
-using UnityEngine;
-
-#endregion
-
-namespace KerbalEngineer.Flight
-{
-    [KSPAddon(KSPAddon.Startup.Flight, false)]
-    public class FlightEngineerPartless : MonoBehaviour
-    {
-        #region Fields
-
-        private FlightEngineerCore flightEngineerCore;
-
-        #endregion
-
-        #region Initialisation
-
-        static FlightEngineerPartless()
-        {
-            try
-            {
-                var handler = SettingHandler.Load("FlightEngineerPartless.xml");
-                handler.Get("isPartless", ref isPartless);
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerPartless->FlightEngineerPartless");
-            }
-        }
-
-        private void Awake()
-        {
-            try
-            {
-                if (isPartless)
-                {
-                    this.flightEngineerCore = this.gameObject.AddComponent<FlightEngineerCore>();
-                }
-            }
-            catch (Exception ex)
-            {
-                Logger.Exception(ex, "FlightEngineerPartless->Awake");
-            }
-        }
-
-        #endregion
-
-        #region Properties
-
-        private static bool isPartless = true;
-
-        public static bool IsPartless
-        {
-            get { return isPartless; }
-            set
-            {
-                try
-                {
-                    if (isPartless != value)
-                    {
-                        var handler = SettingHandler.Load("FlightEngineerPartless.xml");
-                        handler.Set("isPartless", value);
-                        handler.Save("FlightEngineerPartless.xml");
-                    }
-                    isPartless = value;
-                }
-                catch (Exception ex)
-                {
-                    Logger.Exception(ex, "FlightEngineerPartless->IsPartless");
-                }
-            }
-        }
-
-        #endregion
-    }
-}

--- a/KerbalEngineer/Flight/Sections/SectionWindow.cs
+++ b/KerbalEngineer/Flight/Sections/SectionWindow.cs
@@ -118,7 +118,7 @@
         /// </summary>
         private void Draw()
         {
-            if (this.ParentSection == null || !this.ParentSection.IsVisible || (DisplayStack.Instance.Hidden && !this.ParentSection.IsHud))
+            if (this.ParentSection == null || !this.ParentSection.IsVisible || (DisplayStack.Instance.Hidden && !this.ParentSection.IsHud) || !FlightEngineerCore.IsDisplayable)
             {
                 return;
             }

--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -49,7 +49,6 @@
     <Compile Include="Extensions\FloatExtensions.cs" />
     <Compile Include="Extensions\OrbitExtensions.cs" />
     <Compile Include="Flight\ActionMenuGui.cs" />
-    <Compile Include="Flight\FlightEngineerPartless.cs" />
     <Compile Include="Flight\Presets\Preset.cs" />
     <Compile Include="Flight\Readouts\Miscellaneous\SystemTime.cs" />
     <Compile Include="Flight\Readouts\Miscellaneous\VectoredThrustToggle.cs" />

 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ