Skip to content

Commit 7f3385f

Browse files
I added a new option: allowSwitchFromInFlight (defaults to true)
1 parent 76ef4af commit 7f3385f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ private void SetupGUI()
502502

503503
private void UpdateSwitchEventFlightVisibility()
504504
{
505-
bool switchInFlightEnabled = subtypes.Any(s => s != CurrentSubtype && s.allowSwitchInFlight && s.IsUnlocked());
505+
bool switchInFlightEnabled = subtypes.Any(s => s != CurrentSubtype && s.allowSwitchInFlight && s.IsUnlocked()) && subtypes[SubtypeIndex].allowSwitchFromInFlight;
506+
506507
BaseEvent switchSubtypeEvent = Events[nameof(ShowSubtypesWindow)];
507508
switchSubtypeEvent.guiActive = switchInFlight && switchInFlightEnabled;
508509

B9PartSwitch/PartSwitch/PartSubtype.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ public class PartSubtype : IContextualNode
116116
[NodeData]
117117
public bool allowSwitchInFlight = true;
118118

119+
[NodeData]
120+
public bool allowSwitchFromInFlight = true;
121+
119122
[NodeData]
120123
public string mirrorSymmetrySubtype;
121124

0 commit comments

Comments
 (0)