Example #1
0
 public override void OnLoad(ConfigNode node)
 {
     Globals.Load();
     #if DEBUG
     //UI = ConfigNodeObjectGUI.FromObject(Globals.Instance);
     #endif
     LoadConfigs(node);
     //navigation paths
     var paths = node.GetNode(PathDB.NODE_NAME);
     if (paths != null)
     {
         Paths.Load(paths);
     }
     else
     {
         Paths.Clear();
     }
     //patched conics availability
     HavePatchedConics = GameVariables.Instance
                         .GetOrbitDisplayMode(ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.TrackingStation))
                         == GameVariables.OrbitDisplayMode.PatchedConics;
     //check if MM is successfully installed ModuleTCA in any of the parts
     ModuleInstalled = false;
     foreach (var p in PartLoader.LoadedPartsList)
     {
         if (p.partPrefab != null && p.partPrefab.HasModule <ModuleTCA>())
         {
             ModuleInstalled = true;
             break;
         }
     }
     if (!ModuleInstalled)
     {
         TCAManual.ShowStatus();
     }
     //check for PersistentRotation
     HavePersistentRotation = AssemblyLoader.loadedAssemblies.FirstOrDefault(a => a.name == Globals.Instance.PersistentRotationName) != null;
 }
Example #2
0
 public override void OnLoad(ConfigNode node)
 {
     LoadConfigs(node);
     //patched conics availability
     HavePatchedConics = GameVariables.Instance
                         .GetOrbitDisplayMode(ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.TrackingStation))
                         == GameVariables.OrbitDisplayMode.PatchedConics;
     //update available parts
     Parts = TCAModulesDatabase.GetPurchasedParts();
     //check if MM is successfully installed ModuleTCA in any of the parts
     ModuleInstalled = false;
     foreach (var p in PartLoader.LoadedPartsList)
     {
         if (p.partPrefab != null && p.partPrefab.HasModule <ModuleTCA>())
         {
             ModuleInstalled = true;
             break;
         }
     }
     if (!ModuleInstalled)
     {
         TCAManual.ShowStatus();
     }
     //check for PersistentRotation
     HavePersistentRotation = AssemblyLoader.loadedAssemblies.FirstOrDefault(a => a.name == Globals.Instance.PersistentRotationName) != null;
     //deprecated: Old config conversion
     if (Configs.Count == 0 && NamedConfigs.Count == 0)
     {
         var cnode = loadNode(Globals.Instance.PluginData("TCA.conf"));
         if (cnode != null)
         {
             LoadLegacyConfigs(cnode);
         }
     }
     Globals.Load();
 }