Skip to content

Commit

Permalink
Merge pull request #224 from linuxgurugamer/master
Browse files Browse the repository at this point in the history
Add allowSwitchFromInFlight on part subtypes
  • Loading branch information
blowfishpro committed Mar 4, 2022
2 parents 1149556 + 27a58c1 commit d3197ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion B9PartSwitch/PartSwitch/ModuleB9PartSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions B9PartSwitch/PartSwitch/PartSubtype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public class PartSubtype : IContextualNode
[NodeData]
public bool allowSwitchInFlight = true;

[NodeData]
public bool allowSwitchFromInFlight = true;

[NodeData]
public string mirrorSymmetrySubtype;

Expand Down

0 comments on commit d3197ea

Please sign in to comment.