Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9067d8c96e81
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8865e20b1140
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Apr 15, 2020

  1. Copy the full SHA
    5c84e76 View commit details
  2. Merge pull request #2529 from pleroy/2528

    Avoid changing the layout between Layout and Repaint and fix a message
    pleroy authored Apr 15, 2020
    Copy the full SHA
    8865e20 View commit details
Showing with 11 additions and 5 deletions.
  1. +11 −5 ksp_plugin_adapter/flight_planner.cs
16 changes: 11 additions & 5 deletions ksp_plugin_adapter/flight_planner.cs
Original file line number Diff line number Diff line change
@@ -140,6 +140,10 @@ private void UpdateVesselAndBurnEditors() {
break;
}
}
// Must be computed during layout as it affects the layout of some of the
// differential sliders.
number_of_anomalous_manœuvres_ =
plugin.FlightPlanNumberOfAnomalousManoeuvres(vessel_guid);
}
}

@@ -248,16 +252,14 @@ private void RenderFlightPlan(string vessel_guid) {
}
// Allow extending the flight plan.
final_times.Add(double.PositiveInfinity);
int number_of_anomalous_manœuvres =
plugin.FlightPlanNumberOfAnomalousManoeuvres(vessel_guid);

for (int i = 0; i < burn_editors_.Count; ++i) {
Style.HorizontalLine();
BurnEditor burn = burn_editors_[i];
if (burn.Render(header : "Manœuvre #" + (i + 1),
anomalous :
i >= (burn_editors_.Count -
number_of_anomalous_manœuvres),
number_of_anomalous_manœuvres_),
burn_final_time : final_times[i])) {
var status = plugin.FlightPlanReplace(vessel_guid, burn.Burn(), i);
UpdateStatus(status, i);
@@ -532,8 +534,11 @@ private string GetStatusMessage() {
if (anomalous_manœuvres > 0) {
message = "The last " + anomalous_manœuvres + " manœuvres could " +
"not be drawn because the " + status_message + "; try " +
remedy_message + " or adjusting manœuvre " +
(manœuvres - anomalous_manœuvres - 1) + ".";
remedy_message +
(anomalous_manœuvres < manœuvres
? " or adjusting manœuvre #" +
(manœuvres - anomalous_manœuvres)
: "") + ".";
} else {
message = "The " + status_message + "; try " + remedy_message + ".";
}
@@ -549,6 +554,7 @@ private string GetStatusMessage() {
private List<BurnEditor> burn_editors_;
private readonly DifferentialSlider final_time_;
private int? first_future_manœuvre_;
private int number_of_anomalous_manœuvres_ = 0;

private bool show_guidance_ = false;
private float warning_height_ = 1;