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: 173c386c6916
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f3bf2ab852dc
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 29, 2019

  1. Copy the full SHA
    65ca62c View commit details

Commits on Aug 30, 2019

  1. Merge pull request #2314 from pleroy/2313

    Don't attempt to use the plugin in the main window if it's not running
    pleroy authored Aug 30, 2019
    Copy the full SHA
    f3bf2ab View commit details
Showing with 10 additions and 6 deletions.
  1. +1 −1 ksp_plugin_adapter/ksp_plugin_adapter.cs
  2. +9 −5 ksp_plugin_adapter/main_window.cs
2 changes: 1 addition & 1 deletion ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ private KSP.UI.Screens.DebugToolbar.Screens.Cheats.HackGravity hack_gravity {
Interface.DeletePlugin(ref plugin_);
}

private bool PluginRunning() {
public bool PluginRunning() {
return plugin_ != IntPtr.Zero;
}

14 changes: 9 additions & 5 deletions ksp_plugin_adapter/main_window.cs
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ public override void Save(ConfigNode node) {

protected override void RenderWindow(int window_id) {
using (new UnityEngine.GUILayout.VerticalScope()) {
if (plugin == IntPtr.Zero) {
if (!adapter_.PluginRunning()) {
UnityEngine.GUILayout.Label(
text : "Plugin is not started",
style : Style.Warning(UnityEngine.GUI.skin.label));
@@ -226,13 +226,17 @@ protected override void RenderWindow(int window_id) {
}
selecting_active_vessel_target = false;
}
if (plugin != IntPtr.Zero) {

// The plugin is destroyed, e.g., when using the "Switch To" button. Wait
// until it's back alive to display information that requires to cross the
// interface.
if (adapter_.PluginRunning()) {
plotting_frame_selector_.RenderButton();
flight_planner_.RenderButton();
RenderToggleableSection(name : "Prediction Settings",
show : ref show_prediction_settings_,
render : RenderPredictionSettings);
}
RenderToggleableSection(name : "Prediction Settings",
show : ref show_prediction_settings_,
render : RenderPredictionSettings);
RenderToggleableSection(name : "KSP Features",
show : ref show_ksp_features_,
render : RenderKSPFeatures);