mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix incorrect start types for off-map squadrons.
This commit is contained in:
parent
13546d77e7
commit
cc4237d076
@ -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:
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user