diff --git a/qt_ui/windows/mission/flight/QFlightCreator.py b/qt_ui/windows/mission/flight/QFlightCreator.py index 880c28d9..3383e790 100644 --- a/qt_ui/windows/mission/flight/QFlightCreator.py +++ b/qt_ui/windows/mission/flight/QFlightCreator.py @@ -115,6 +115,11 @@ class QFlightCreator(QDialog): tooltip="Selects the start type for this flight.", ) ) + squadron: Squadron = self.squadron_selector.currentData() + home_base: ControlPoint = squadron.location + if isinstance(home_base, OffMapSpawn): + self.start_type.setCurrentText(StartType.IN_FLIGHT.value) + self.start_type.setEnabled(False) layout.addWidget( QLabel( "Any option other than Cold will make this flight " @@ -213,7 +218,7 @@ class QFlightCreator(QDialog): else: self.start_type.setEnabled(True) if self.restore_start_type is not None: - self.start_type.setCurrentText(self.restore_start_type) + self.start_type.setCurrentText(self.restore_start_type.value) self.restore_start_type = None def on_task_changed(self, index: int) -> None: diff --git a/qt_ui/windows/mission/flight/settings/QFlightStartType.py b/qt_ui/windows/mission/flight/settings/QFlightStartType.py index 59e870d2..5b207e34 100644 --- a/qt_ui/windows/mission/flight/settings/QFlightStartType.py +++ b/qt_ui/windows/mission/flight/settings/QFlightStartType.py @@ -8,6 +8,7 @@ from PySide2.QtWidgets import ( from game.ato.flight import Flight from game.ato.starttype import StartType +from game.theater import OffMapSpawn from qt_ui.models import PackageModel @@ -26,6 +27,9 @@ class QFlightStartType(QGroupBox): self.start_type.addItem(start_type.value, start_type) self.start_type.setCurrentText(flight.start_type.value) + if isinstance(self.flight.departure, OffMapSpawn): + self.start_type.setEnabled(False) + self.start_type.currentTextChanged.connect(self._on_start_type_selected) self.main_row.addWidget(self.start_type_label) self.main_row.addWidget(self.start_type)