internal IEnumerator AirlaunchRoutine(AirlaunchParams launchParams, Guid vesselId, bool skipCountdown = false) { if (!skipCountdown) { yield return(_wfsTwo); } for (int i = 10; i > 0 && !skipCountdown; i--) { if (FlightGlobals.ActiveVessel == null || FlightGlobals.ActiveVessel.id != vesselId) { ScreenMessages.PostScreenMessage("[KCT] Airlaunch cancelled", 5f, ScreenMessageStyle.UPPER_CENTER, XKCDColors.Red); yield break; } if (i == 1 && FlightGlobals.ActiveVessel.situation == Vessel.Situations.PRELAUNCH) { // Make sure that the vessel situation transitions from Prelaunch to Landed before airlaunching FlightGlobals.ActiveVessel.situation = Vessel.Situations.LANDED; } ScreenMessages.PostScreenMessage($"[KCT] Launching in {i}...", 1f, ScreenMessageStyle.UPPER_CENTER, XKCDColors.Red); yield return(_wfsOne); } HyperEdit_Utilities.DoAirlaunch(launchParams); if (Utilities.IsPrincipiaInstalled) { StartCoroutine(ClobberPrincipia()); } }
private IEnumerator AirlaunchRoutine(AirlaunchParams launchParams, Guid vesselId) { yield return(new WaitForSeconds(2)); for (int i = 10; i > 0; i--) { if (FlightGlobals.ActiveVessel == null || FlightGlobals.ActiveVessel.id != vesselId) { ScreenMessages.PostScreenMessage("[KCT] Airlaunch cancelled", 5f, ScreenMessageStyle.UPPER_CENTER, XKCDColors.Red); yield break; } ScreenMessages.PostScreenMessage($"[KCT] Launching in {i}...", 1f, ScreenMessageStyle.UPPER_CENTER, XKCDColors.Red); yield return(new WaitForSeconds(1)); } HyperEdit_Utilities.DoAirlaunch(launchParams); }
private IEnumerator AirlaunchRoutine(AirlaunchParams launchParams, Guid vesselId) { yield return(wfsTwo); // new WaitForSeconds(2); for (int i = 10; i > 0; i--) { if (FlightGlobals.ActiveVessel == null || FlightGlobals.ActiveVessel.id != vesselId) { ScreenMessages.PostScreenMessage("[KCT] Airlaunch cancelled", 5f, ScreenMessageStyle.UPPER_CENTER, XKCDColors.Red); yield break; } if (i == 1 && FlightGlobals.ActiveVessel.situation == Vessel.Situations.PRELAUNCH) { // Make sure that the vessel situation transitions from Prelaunch to Landed before airlaunching FlightGlobals.ActiveVessel.situation = Vessel.Situations.LANDED; } ScreenMessages.PostScreenMessage($"[KCT] Launching in {i}...", 1f, ScreenMessageStyle.UPPER_CENTER, XKCDColors.Red); yield return(wfsOne); // new WaitForSeconds(1); } HyperEdit_Utilities.DoAirlaunch(launchParams); }