@@ -50,12 +50,6 @@ public class ModuleB9PartSwitch : CustomPartModule, IPartMassModifier, IPartCost
5050 [ NodeData ]
5151 public bool advancedTweakablesOnly = false ;
5252
53- [ NodeData ]
54- public bool showNextSubtypeAction = false ;
55-
56- [ NodeData ]
57- public bool showPreviousSubtypeAction = false ;
58-
5953 [ NodeData ( name = "currentSubtype" , persistent = true ) ]
6054 public string CurrentSubtypeName
6155 {
@@ -85,65 +79,6 @@ private set
8579
8680 #endregion
8781
88- #region Actions
89-
90- [ KSPAction ]
91- public void ShowSubtypesWindowAction ( KSPActionParam param ) => PartSwitchFlightDialog . Spawn ( this ) ;
92-
93- [ KSPAction ]
94- public void NextSubtypeAction ( KSPActionParam param )
95- {
96- if ( ! switchInFlight ) return ;
97-
98- PartSubtype FindNextSubtype ( )
99- {
100- for ( int i = currentSubtypeIndex + 1 ; i < subtypes . Count ; i ++ )
101- {
102- if ( subtypes [ i ] . allowSwitchInFlight ) return subtypes [ i ] ;
103- }
104- for ( int i = 0 ; i < currentSubtypeIndex ; i ++ )
105- {
106- if ( subtypes [ i ] . allowSwitchInFlight ) return subtypes [ i ] ;
107- }
108-
109- return null ;
110- }
111-
112- PartSubtype nextSubtype = FindNextSubtype ( ) ;
113-
114- if ( nextSubtype . IsNull ( ) ) return ;
115-
116- PartSwitchFlightDialog . MaybeCreateResourceRemovalWarning ( this , ( ) => SwitchSubtype ( nextSubtype . Name ) ) ;
117- }
118-
119- [ KSPAction ]
120- public void PreviousSubtypeAction ( KSPActionParam param )
121- {
122- if ( ! switchInFlight ) return ;
123-
124- PartSubtype FindPreviousSubtype ( )
125- {
126- for ( int i = currentSubtypeIndex - 1 ; i >= 0 ; i -- )
127- {
128- if ( subtypes [ i ] . allowSwitchInFlight ) return subtypes [ i ] ;
129- }
130- for ( int i = SubtypesCount - 1 ; i > currentSubtypeIndex ; i -- )
131- {
132- if ( subtypes [ i ] . allowSwitchInFlight ) return subtypes [ i ] ;
133- }
134-
135- return null ;
136- }
137-
138- PartSubtype nextSubtype = FindPreviousSubtype ( ) ;
139-
140- if ( nextSubtype . IsNull ( ) ) return ;
141-
142- PartSwitchFlightDialog . MaybeCreateResourceRemovalWarning ( this , ( ) => SwitchSubtype ( nextSubtype . Name ) ) ;
143- }
144-
145- #endregion
146-
14782 #region Private Fields
14883
14984 // Tweakscale integration (set via reflection, readonly is ok)
@@ -497,20 +432,6 @@ private void SetupGUI()
497432 subtypeTitleField . guiName = switcherDescription ;
498433 subtypeTitleField . advancedTweakable = advancedTweakablesOnly ;
499434 subtypeTitleField . guiActiveEditor = subtypes . Count == 1 ;
500-
501- bool switchInFlightEnabled = switchInFlight && subtypes . Any ( s => s . allowSwitchInFlight ) ;
502-
503- BaseAction showSubtypesWindowAction = Actions [ nameof ( ShowSubtypesWindowAction ) ] ;
504- showSubtypesWindowAction . guiName = Localization . ModuleB9PartSwitch_SelectSubtype ( switcherDescription ) ; // Select <<1>>
505- showSubtypesWindowAction . active = switchInFlightEnabled ;
506-
507- BaseAction nextSubtypeAction = Actions [ nameof ( NextSubtypeAction ) ] ;
508- nextSubtypeAction . guiName = Localization . ModuleB9PartSwitch_NextSubtype ( switcherDescription ) ; // Next <<1>>
509- nextSubtypeAction . active = showNextSubtypeAction && switchInFlightEnabled ;
510-
511- BaseAction previousSubtypeAction = Actions [ nameof ( PreviousSubtypeAction ) ] ;
512- previousSubtypeAction . guiName = Localization . ModuleB9PartSwitch_PreviousSubtype ( switcherDescription ) ; // Previous <<1>>
513- previousSubtypeAction . active = showPreviousSubtypeAction && switchInFlightEnabled ;
514435
515436 if ( HighLogic . LoadedSceneIsFlight )
516437 UpdateSwitchEventFlightVisibility ( ) ;
0 commit comments