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: 84bea4e79ad8
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 61fc78d86756
Choose a head ref
  • 6 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 8, 2021

  1. Allow typing in all fields.

    pleroy committed Oct 8, 2021
    Copy the full SHA
    0e21718 View commit details
  2. Comment.

    pleroy committed Oct 8, 2021
    Copy the full SHA
    b0a5798 View commit details
  3. Merge pull request #3143 from pleroy/Fix

    Allow typing in all fields
    eggrobin authored Oct 8, 2021
    Copy the full SHA
    5a46263 View commit details
  4. Copy the full SHA
    832b565 View commit details
  5. New Tencent link.

    pleroy authored Oct 8, 2021
    Copy the full SHA
    17b20a6 View commit details

Commits on Oct 17, 2021

  1. Copy the full SHA
    61fc78d View commit details
Showing with 24 additions and 5 deletions.
  1. +3 −1 README.md
  2. +2 −1 ksp_plugin_adapter/burn_editor.cs
  3. +13 −0 ksp_plugin_adapter/differential_slider.cs
  4. +6 −3 ksp_plugin_adapter/flight_planner.cs
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Principia

![⚠️](https://place-hold.it/10/f00000/000000&text=) _If you downloaded Hadamard before October 8, 23:10 UTC, you probably have a buggy version (see [#3144](https://github.com/mockingbirdnest/Principia/issues/3144)). Please download it again. If you have the correct version, the version string in the Principia UI says `2021100611-Hadamard-0-g5a4626303afea27800d7ef283ce66c54f98be3c8`. We apologize for the inconvenience._ ![⚠️](https://place-hold.it/10/f00000/000000&text=)

**[Hadamard](https://github.com/mockingbirdnest/Principia/wiki/Change-Log#hadamard), the October version of Principia, is available with UI fixes. Download it [here for 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.11.1, 1.11.2, and 1.12.2](https://bit.ly/3itb0VK).**

**For the convenience of Chinese users, downloads from 腾讯微云: [Principia Hadamard for 1.8.1—1.12.2](https://share.weiyun.com/qXuSrxCQ), [Trappist-1 for Principia](https://share.weiyun.com/5wVtWYQ).**
**For the convenience of Chinese users, downloads from 腾讯微云: [Principia Hadamard for 1.8.1—1.12.2](https://share.weiyun.com/ssSDt5I1), [Trappist-1 for Principia](https://share.weiyun.com/5wVtWYQ).**

Principia is a mod for Kerbal Space Program (KSP) which implements N-body and extended body gravitation. Instead of being within the sphere of influence of a single celestial body at any point in time, your vessels are influenced by all the celestials. This makes it possible to implement missions that are more complex and more realistic than in the stock game, especially if used in conjunction with a mod like RealSolarSystem which has real-life celestials.

3 changes: 2 additions & 1 deletion ksp_plugin_adapter/burn_editor.cs
Original file line number Diff line number Diff line change
@@ -151,7 +151,8 @@ public Event Render(string header, bool anomalous, double burn_final_time) {
changed |= Δv_binormal_.Render(enabled : !anomalous);
{
var render_time_base = time_base;
previous_coast_duration_.value = initial_time_ - render_time_base;
previous_coast_duration_.value_if_different =
initial_time_ - render_time_base;

// The duration of the previous coast is always enabled as it can make
// a manœuvre non-anomalous.
13 changes: 13 additions & 0 deletions ksp_plugin_adapter/differential_slider.cs
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ public double max_value {
set => max_value_ = value;
}

// Set from the UI.
public double value {
get => value_ ?? 0.0;
set {
@@ -68,6 +69,18 @@ public double value {
}
}

// Set from programmatic data, e.g., data obtained from C++. Does nothing if
// the value has not changed to avoid messing with UI input.
public double value_if_different {
set {
if (!value_.HasValue || value_ != value) {
value_ = value;
formatted_value_ = formatter_(value_.Value);
}
}
}

// TODO(phl): Remove and use value instead.
public void ResetValue(double new_value) {
value_ = null;
value = new_value;
9 changes: 6 additions & 3 deletions ksp_plugin_adapter/flight_planner.cs
Original file line number Diff line number Diff line change
@@ -77,7 +77,8 @@ protected override void RenderWindow(int window_id) {
plugin.FlightPlanCreate(vessel_guid,
plugin.CurrentTime() + 3600,
predicted_vessel.GetTotalMass());
final_time_.value = plugin.FlightPlanGetDesiredFinalTime(vessel_guid);
final_time_.value_if_different =
plugin.FlightPlanGetDesiredFinalTime(vessel_guid);
Shrink();
}
UnityEngine.GUI.DragWindow();
@@ -107,7 +108,8 @@ private void UpdateVesselAndBurnEditors() {
if (vessel_guid != null &&
plugin.FlightPlanExists(vessel_guid)) {
burn_editors_ = new List<BurnEditor>();
final_time_.value = plugin.FlightPlanGetDesiredFinalTime(vessel_guid);
final_time_.value_if_different =
plugin.FlightPlanGetDesiredFinalTime(vessel_guid);
for (int i = 0;
i < plugin.FlightPlanNumberOfManoeuvres(vessel_guid);
++i) {
@@ -154,7 +156,8 @@ private void RenderFlightPlan(string vessel_guid) {
}
// Always refresh the final time from C++ as it may have changed because
// the last burn changed.
final_time_.value = plugin.FlightPlanGetDesiredFinalTime(vessel_guid);
final_time_.value_if_different =
plugin.FlightPlanGetDesiredFinalTime(vessel_guid);

FlightPlanAdaptiveStepParameters parameters =
plugin.FlightPlanGetAdaptiveStepParameters(vessel_guid);