Exemple #1
0
 static bool init()
 {
     clear_fields();
     TCAToolbarManager.AttachTCA(null);
     TCA = ModuleTCA.AvailableTCA(vessel);
     if (TCA == null)
     {
         return(false);
     }
     if (CFG != null)
     {
         window_enabled = CFG.GUIVisible;
     }
     TCAToolbarManager.AttachTCA(TCA);
     create_fields();
     update_configs();
     return(true);
 }
Exemple #2
0
 bool init()
 {
     clear_fields();
     TCAToolbarManager.AttachTCA(null);
     TCA = ModuleTCA.AvailableTCA(vessel);
     if (TCA == null || CFG == null)
     {
         return(false);
     }
     ShowInstance(CFG.GUIVisible);
     ModulesGraph.SetCFG(CFG);
     TCAToolbarManager.AttachTCA(TCA);
     create_fields();
     if (ADV != null)
     {
         ADV.UpdateNamedConfigs();
     }
     return(true);
 }
 bool init()
 {
     clear_fields();
     ClearStatus();
     TCAToolbarManager.AttachTCA(null);
     TCA = ModuleTCA.AvailableTCA(vessel);
     if (TCA == null || CFG == null)
     {
         return(false);
     }
     ActiveVesselTCA   = ModuleTCA.AvailableTCA(FlightGlobals.ActiveVessel);
     HaveRemoteControl = ActiveVesselTCA != null && ActiveVesselTCA.GetModule <SquadControl>() != null;
     RemoteControl     = ActiveVesselTCA != TCA;
     ShowInstance(CFG.GUIVisible);
     ModulesGraph.SetCFG(CFG);
     TCAToolbarManager.AttachTCA(TCA);
     create_fields();
     if (ADV != null)
     {
         ADV.UpdateNamedConfigs();
     }
     return(true);
 }
        void switch_vessel(Func <Vessel, Vessel> get_next)
        {
            if (ActiveVesselTCA == null)
            {
                return;
            }
            var       next_vessel = vessel;
            ModuleTCA next        = null;

            while (next == null ||
                   !SquadControl.IsCommReachable(ActiveVesselTCA, next))
            {
                next_vessel = get_next(next_vessel);
                if (next_vessel.loaded)
                {
                    next = ModuleTCA.AvailableTCA(next_vessel);
                }
            }
            if (next != TCA)
            {
                SquadControl.UnpackVessel(ActiveVesselTCA.vessel, next_vessel);
                onVesselChange(next_vessel);
            }
        }