public void RememberOrbit() { PrepareVessel(); QuickLaunchMissionTracker tracker = vessel.GetComponent <QuickLaunchMissionTracker>(); if (!tracker.isTracking) { Debug.Log("[BeenThereDoneThat]: Not tracking, aborting"); return; } QuickLaunchHangar.Instance.OnSaveOrbitVessel(vessel, tracker.launchVehicleName); }
public void Launch(Vessel vessel) { ProtoVessel prevlaunchProtoVessel = QuickLaunchHangar.Instance.LoadLaunchProtoVessel(vessel); if (prevlaunchProtoVessel == null) { Debug.Log("[BeenThereDoneThat]: No previously launched vessel found, aborting"); return; } if (protoVessel == null) { Debug.Log("[BeenThereDoneThat]: No orbit vessel found, aborting"); return; } QuickLaunchMissionTracker tracker = vessel.GetComponent <QuickLaunchMissionTracker>(); tracker.StartTracking(quickLaunchVessel.name); new QuickLauch(vessel, prevlaunchProtoVessel, protoVessel).Liftoff(); }
public void OnStartMission(Vessel vessel) { if (vessel.situation != Vessel.Situations.PRELAUNCH) { ScreenMessages.PostScreenMessage("Can't start, must be pre-launch!", 4, ScreenMessageStyle.UPPER_CENTER); return; } QuickLaunchMissionTracker tracker = vessel.GetComponent <QuickLaunchMissionTracker>(); LaunchVehicle launchVehicle = null; Payload payload = null; if (tracker.isTracking) { ScreenMessages.PostScreenMessage("Already tracking!", 4, ScreenMessageStyle.UPPER_CENTER); return; } if (!QuickLauncher.Instance.Split(vessel.parts, out launchVehicle, out payload)) { ScreenMessages.PostScreenMessage("No payload separator available", 4, ScreenMessageStyle.UPPER_CENTER); return; } QuickLaunchVessel quickLaunchVessel = null; if (quickLaunchVessels.TryGetValue(launchVehicle.GetHashCode(), out quickLaunchVessel)) { string vesselName = quickLaunchVessel.name; tracker.StartTracking(vesselName); ScreenMessages.PostScreenMessage(string.Format("Started tracking {0}", vesselName), 4, ScreenMessageStyle.UPPER_CENTER); return; } else { startMissionDialog = StartMissionDialog.Create(OnStartMissionDialogDismiss, vessel, launchVehicle, tracker); } }
public static StartMissionDialog Create(Callback onDismissMenu, Vessel vessel, LaunchVehicle launchVehicle, QuickLaunchMissionTracker tracker) { GameObject gameObject = new GameObject("BeenThereDoneThat mission start menu"); StartMissionDialog startMissionDialog = gameObject.AddComponent <StartMissionDialog>(); startMissionDialog.onDismissCallback = onDismissMenu; startMissionDialog.launchVehicleName = vessel.GetDisplayName(); startMissionDialog.vessel = vessel; startMissionDialog.launchVehicle = launchVehicle; startMissionDialog.tracker = tracker; return(startMissionDialog); }