public override void OnStart(PartModule.StartState state)
 {
     autopilot = core.GetComputerModule <MechJebModuleAscentAutopilot>();
     if (autopilot != null)
     {
         desiredInclination = autopilot.desiredInclination;
     }
 }
 public override void OnStart(PartModule.StartState state)
 {
     autopilot = core.GetComputerModule<MechJebModuleAscentAutopilot>();
     if (autopilot != null)
     {
         desiredInclination = autopilot.desiredInclination;
     }
     navBall = core.GetComputerModule<MechJebModuleAscentNavBall>();
 }
 public override void OnStart(PartModule.StartState state)
 {
     autopilot = core.GetComputerModule<MechJebModuleAscentAutopilot>();
     if (autopilot != null)
     {
         autopilot.users.Add(this);
         desiredInclination = autopilot.desiredInclination;
     }
 }
 public MechJebModuleScriptActionAscent(MechJebModuleScript scriptModule, MechJebCore core) : base(scriptModule, core, NAME)
 {
     this.autopilot    = core.GetComputerModule <MechJebModuleAscentAutopilot>();
     this.ascentModule = core.GetComputerModule <MechJebModuleAscentGuidance>();
     this.mainBody     = core.target.mainBody;
     this.targetOrbit  = core.target.TargetOrbit;
     actionTypes.Add("Ascent Guidance");
     actionTypes.Add("Launching to Rendezvous");
     this.readModuleConfiguration();
 }
        public MechJebModuleJoke(MechJebCore core)
            : base(core)
        {
            hidden  = true;
            enabled = true;

            sorry = core.part.gameObject.AddComponent <AudioSource>();
            WWW www = new WWW("file://" + KSPUtil.ApplicationRootPath.Replace("\\", "/") + "Parts/mumech_MechJebPod/snd1.wav");

            if ((sorry != null) && (www != null))
            {
                sorry.clip   = www.GetAudioClip(false);
                sorry.volume = 0;
                sorry.Stop();
            }

            glitch      = core.part.gameObject.AddComponent <AudioSource>();
            glitchClips = new AudioClip[NUM_GLITCH_SOUNDS];
            for (int i = 0; i < NUM_GLITCH_SOUNDS; i++)
            {
                www = new WWW("file://" + KSPUtil.ApplicationRootPath.Replace("\\", "/") + "Parts/mumech_MechJebPod/glitch" + i + ".wav");
                if (www != null)
                {
                    glitchClips[i] = www.GetAudioClip(false);
                }
            }

            foreach (ComputerModule module in core.modules)
            {
                if (module is MechJebModuleAscentAutopilot)
                {
                    ascent = (MechJebModuleAscentAutopilot)module;
                }
                if (module is MechJebModuleLandingAutopilot)
                {
                    landing = (MechJebModuleLandingAutopilot)module;
                }
                if (module is MechJebModuleTranslatron)
                {
                    translatron = (MechJebModuleTranslatron)module;
                }
            }
        }
Esempio n. 6
0
        public MechJebModuleJoke(MechJebCore core)
            : base(core)
        {
            hidden = true;
            enabled = true;

            sorry = core.part.gameObject.AddComponent<AudioSource>();
            WWW www = new WWW("file://" + KSPUtil.ApplicationRootPath.Replace("\\", "/") + "Parts/mumech_MechJebPod/snd1.wav");
            if ((sorry != null) && (www != null))
            {
                sorry.clip = www.GetAudioClip(false);
                sorry.volume = 0;
                sorry.Stop();
            }

            glitch = core.part.gameObject.AddComponent<AudioSource>();
            glitchClips = new AudioClip[NUM_GLITCH_SOUNDS];
            for (int i = 0; i < NUM_GLITCH_SOUNDS; i++)
            {
                www = new WWW("file://" + KSPUtil.ApplicationRootPath.Replace("\\", "/") + "Parts/mumech_MechJebPod/glitch" + i + ".wav");
                if (www != null)
                {
                    glitchClips[i] = www.GetAudioClip(false);
                }
            }

            foreach (ComputerModule module in core.modules)
            {
                if (module is MechJebModuleAscentAutopilot)
                {
                    ascent = (MechJebModuleAscentAutopilot)module;
                }
                if (module is MechJebModuleLandingAutopilot)
                {
                    landing = (MechJebModuleLandingAutopilot)module;
                }
                if (module is MechJebModuleTranslatron)
                {
                    translatron = (MechJebModuleTranslatron)module;
                }
            }
        }
Esempio n. 7
0
        [KSPAction("#MechJeb_AscentAPtoggle")]//Ascent AP toggle
        public void OnAscentAPToggleAction(KSPActionParam param)
        {
            MechJebModuleAscentAutopilot autopilot      = GetComputerModule <MechJebModuleAscentAutopilot>();
            MechJebModuleAscentGuidance  ascentGuidance = GetComputerModule <MechJebModuleAscentGuidance>();


            if (autopilot == null || ascentGuidance == null)
            {
                return;
            }

            if (autopilot.enabled)
            {
                autopilot.users.Remove(ascentGuidance);
            }
            else
            {
                autopilot.users.Add(ascentGuidance);
            }
        }
 public override void OnStart(PartModule.StartState state)
 {
     autopilot = core.GetComputerModule <MechJebModuleAscentAutopilot>();
 }
 public override void OnStart(PartModule.StartState state)
 {
     autopilot = core.GetComputerModule<MechJebModuleAscentAutopilot>();
 }
Esempio n. 10
0
 public override void OnStart(PartModule.StartState state)
 {
     autopilot       = core.GetComputerModule <MechJebModuleAscentAutopilot>();
     NavBallGuidance = false;
     launchLatitude  = vesselState.latitude;
 }
 public override void OnStart(PartModule.StartState state)
 {
     autopilot = core.GetComputerModule<MechJebModuleAscentAutopilot>();
     NavBallGuidance = false;
     launchLatitude = vesselState.latitude;
 }