void Update()
 {
     if (EditorLogic.fetch == null || EditorLogic.fetch.ship == null)
     {
         return;
     }
     update_stats |= HaveSelectedPart;
     if (reset)
     {
         Available = false;
         Modules.Clear();
         Engines.Clear();
         PartsEditor.SetCFG(null);
         CFG   = null;
         reset = false;
     }
     if (init_engines)
     {
         if (UpdateEngines())
         {
             GetCFG();
         }
         init_engines = false;
         update_stats = true;
     }
     if (update_engines)
     {
         if (UpdateEngines())
         {
             if (CFG != null)
             {
                 UpdateCFG();
             }
             else
             {
                 GetCFG();
             }
         }
         update_engines = false;
         update_stats   = true;
     }
     if (autoconfigure_profile)
     {
         AutoconfigureProfile();
         autoconfigure_profile = false;
         update_stats          = true;
     }
     if (update_stats)
     {
         UpdateShipStats();
         update_stats = false;
     }
     Available |= CFG != null && Engines.Count > 0;
     TCA_highlight.Update(Available && doShow);
     Engines_highlight.Update(Available && doShow && show_imbalance && ActiveEngines.Count > 0);
 }
Esempio n. 2
0
 void UpdateEngines()
 {
     Engines_highlight.Reset();
     Engines.Clear();
     RCS.Clear();
     if (TCAScenario.HasTCA && EditorLogic.RootPart)
     {
         find_engines_recursively(EditorLogic.RootPart, Engines, RCS);
     }
 }
        bool UpdateEngines()
        {
            Engines_highlight.Reset();
            Engines.Clear();
            if (TCAScenario.HasTCA && EditorLogic.RootPart)
            {
                find_engines_recursively(EditorLogic.RootPart, Engines);
            }
            var ret = Engines.Count > 0;

            if (!ret)
            {
                Reset();
            }
            return(ret);
        }