mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add campaign support for ferry-only bases.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/3170.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import textwrap
|
||||
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtGui import QCloseEvent, QPixmap
|
||||
from PySide6.QtWidgets import (
|
||||
@@ -60,13 +62,32 @@ class QBaseMenu2(QDialog):
|
||||
pixmap = QPixmap(self.get_base_image())
|
||||
header.setPixmap(pixmap)
|
||||
|
||||
description_layout = QVBoxLayout()
|
||||
top_layout.addLayout(description_layout)
|
||||
|
||||
title = QLabel("<b>" + self.cp.name + "</b>")
|
||||
title.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
title.setProperty("style", "base-title")
|
||||
description_layout.addWidget(title)
|
||||
|
||||
if self.cp.ferry_only:
|
||||
description_layout.addWidget(
|
||||
QLabel(
|
||||
"<br />".join(
|
||||
textwrap.wrap(
|
||||
"This base only supports ferry missions. Transfer the "
|
||||
"squadrons to a different base to use them.",
|
||||
width=80,
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
description_layout.addStretch()
|
||||
|
||||
self.intel_summary = QLabel()
|
||||
self.intel_summary.setToolTip(self.generate_intel_tooltip())
|
||||
self.update_intel_summary()
|
||||
top_layout.addWidget(title)
|
||||
top_layout.addWidget(self.intel_summary)
|
||||
top_layout.setAlignment(Qt.AlignTop)
|
||||
|
||||
|
||||
@@ -48,8 +48,13 @@ class SquadronSelector(QComboBox):
|
||||
return
|
||||
|
||||
for squadron in self.air_wing.squadrons_for(aircraft):
|
||||
if squadron.capable_of(task) and squadron.untasked_aircraft:
|
||||
self.addItem(f"{squadron.location}: {squadron}", squadron)
|
||||
if not squadron.capable_of(task):
|
||||
continue
|
||||
if not squadron.untasked_aircraft:
|
||||
continue
|
||||
if squadron.location.ferry_only:
|
||||
continue
|
||||
self.addItem(f"{squadron.location}: {squadron}", squadron)
|
||||
|
||||
if self.count() == 0:
|
||||
self.addItem("No capable aircraft available", None)
|
||||
|
||||
Reference in New Issue
Block a user