From 896c473b13ffdc329a7e1b5949de343f4e041087 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Sun, 23 Oct 2022 13:54:29 +0200 Subject: [PATCH] Only show patched conics if the frame makes sense --- ksp_plugin_adapter/ksp_plugin_adapter.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ksp_plugin_adapter/ksp_plugin_adapter.cs b/ksp_plugin_adapter/ksp_plugin_adapter.cs index a6c34fbce7..228d4c3b13 100644 --- a/ksp_plugin_adapter/ksp_plugin_adapter.cs +++ b/ksp_plugin_adapter/ksp_plugin_adapter.cs @@ -4,6 +4,8 @@ using System.Linq; using KSP.Localization; +using static principia.ksp_plugin_adapter.ReferenceFrameSelector.FrameType; + namespace principia { namespace ksp_plugin_adapter { @@ -2021,7 +2023,9 @@ private void RemoveStockTrajectoriesIfNeeded(CelestialBody celestial) { return; } celestial.orbitDriver.Renderer.drawMode = - main_window_.display_patched_conics + main_window_.display_patched_conics && + plotting_frame_selector_.frame_type == BODY_CENTRED_NON_ROTATING && + plotting_frame_selector_.Centre() == celestial.orbit.referenceBody ? OrbitRenderer.DrawMode.REDRAW_AND_RECALCULATE : OrbitRenderer.DrawMode.OFF; } @@ -2032,7 +2036,11 @@ private void RemoveStockTrajectoriesIfNeeded(Vessel vessel) { PatchRendering.RelativityMode.RELATIVE; } - if (main_window_.display_patched_conics || !is_manageable(vessel)) { + if ((main_window_.display_patched_conics && + plotting_frame_selector_.frame_type == BODY_CENTRED_NON_ROTATING && + plotting_frame_selector_.Centre() == + vessel.orbitDriver.orbit.referenceBody) || + !is_manageable(vessel)) { vessel.orbitDriver.Renderer.drawMode = vessel.PatchedConicsAttached ? OrbitRenderer.DrawMode.OFF