Exemple #1
0
 private void OnDestroy()
 {
     if (Instance != null)
     {
         if (Instance == this)
         {
             Instance = null;
         }
     }
     InputLockManager.RemoveControlLock("BeenThereDoneThatStartMissionDialog");
     FlightDriver.SetPause(false, true);
 }
Exemple #2
0
        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);
        }
        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 void OnStartMissionDialogDismiss()
 {
     startMissionDialog = null;
 }
Exemple #5
0
 public void Awake()
 {
     Instance = this;
     FlightDriver.SetPause(true, true);
     InputLockManager.SetControlLock("BeenThereDoneThatStartMissionDialog");
 }