From 27a58c1606e3c2be242a4fe658c3f857401e8e1c Mon Sep 17 00:00:00 2001 From: Jonathan Bayer Date: Fri, 24 Dec 2021 09:40:58 -0500 Subject: [PATCH] I added a new option: allowSwitchFromInFlight (defaults to true) --- B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs | 3 ++- B9PartSwitch/PartSwitch/PartSubtype.cs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs b/B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs index 6e11725..185dd82 100644 --- a/B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs +++ b/B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs @@ -502,7 +502,8 @@ private void SetupGUI() private void UpdateSwitchEventFlightVisibility() { - bool switchInFlightEnabled = subtypes.Any(s => s != CurrentSubtype && s.allowSwitchInFlight && s.IsUnlocked()); + bool switchInFlightEnabled = subtypes.Any(s => s != CurrentSubtype && s.allowSwitchInFlight && s.IsUnlocked()) && subtypes[SubtypeIndex].allowSwitchFromInFlight; + BaseEvent switchSubtypeEvent = Events[nameof(ShowSubtypesWindow)]; switchSubtypeEvent.guiActive = switchInFlight && switchInFlightEnabled; diff --git a/B9PartSwitch/PartSwitch/PartSubtype.cs b/B9PartSwitch/PartSwitch/PartSubtype.cs index a19ed78..ad27a8d 100644 --- a/B9PartSwitch/PartSwitch/PartSubtype.cs +++ b/B9PartSwitch/PartSwitch/PartSubtype.cs @@ -116,6 +116,9 @@ public class PartSubtype : IContextualNode [NodeData] public bool allowSwitchInFlight = true; + [NodeData] + public bool allowSwitchFromInFlight = true; + [NodeData] public string mirrorSymmetrySubtype;