diff --git a/changelog.md b/changelog.md index 47e0ae3a..b5300e56 100644 --- a/changelog.md +++ b/changelog.md @@ -35,6 +35,8 @@ Saves from 5.x are not compatible with 6.0. * **[Mission Generation]** Fixed adding additional mission types for a squadron causing error messages when the mission type is not supported by the aircraft type by default * **[Mission Generation]** AAA ground units now spawn correctly at the frontline * **[UI]** Fixed and issue where the liberation main exe was still running after application close. +* **[UI]** Disable player slots for non-flyable aircraft. + # 5.2.0 diff --git a/qt_ui/windows/AirWingConfigurationDialog.py b/qt_ui/windows/AirWingConfigurationDialog.py index 64200835..03bf3cd0 100644 --- a/qt_ui/windows/AirWingConfigurationDialog.py +++ b/qt_ui/windows/AirWingConfigurationDialog.py @@ -213,12 +213,15 @@ class SquadronConfigurationBox(QGroupBox): ) left_column.addWidget(self.base_selector) - if squadron.player: + if squadron.player and squadron.aircraft.flyable: player_label = QLabel( "Players (one per line, leave empty for an AI-only squadron):" ) else: - player_label = QLabel("Player slots not available for opfor") + msg1 = "Player slots not available for opfor" + msg2 = "Player slots not available for non-flyable aircraft" + text = msg2 if squadron.player else msg1 + player_label = QLabel(text) left_column.addWidget(player_label) players = [p for p in squadron.pilot_pool if p.player] @@ -228,7 +231,7 @@ class SquadronConfigurationBox(QGroupBox): players = [] self.player_list = QTextEdit("
".join(p.name for p in players)) self.player_list.setAcceptRichText(False) - self.player_list.setEnabled(squadron.player) + self.player_list.setEnabled(squadron.player and squadron.aircraft.flyable) left_column.addWidget(self.player_list) delete_button = QPushButton("Remove Squadron") delete_button.setMaximumWidth(140) diff --git a/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py b/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py index 7da3f0d6..8ff93f73 100644 --- a/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py +++ b/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py @@ -94,6 +94,10 @@ class PilotControls(QHBoxLayout): self.player_checkbox = QCheckBox(text="Player") self.player_checkbox.setToolTip("Checked if this pilot is a player.") self.on_pilot_changed(self.selector.currentIndex()) + enabled = False + if self.roster is not None and self.roster.squadron is not None: + enabled = self.roster.squadron.aircraft.flyable + self.player_checkbox.setEnabled(enabled) self.addWidget(self.player_checkbox) self.player_checkbox.toggled.connect(self.on_player_toggled)