mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Squadron Livery Selector : Allow to show all liveries even if squadron is using livery set in the selector when in the Flight Payload Tab.
This commit is contained in:
parent
ecb81ec32d
commit
b1efaf6448
@ -11,7 +11,9 @@ class SquadronLiverySelector(QComboBox):
|
||||
The combo box will automatically be populated with all available liveries.
|
||||
"""
|
||||
|
||||
def __init__(self, squadron: Squadron) -> None:
|
||||
def __init__(
|
||||
self, squadron: Squadron, full_list_view_override: bool = False
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
|
||||
|
||||
@ -33,7 +35,11 @@ class SquadronLiverySelector(QComboBox):
|
||||
for x in faction.liveries_overrides.get(self.aircraft_type, [])
|
||||
if x in [y.id.lower() for y in liveries]
|
||||
]
|
||||
if selected_livery is None and squadron.livery_set:
|
||||
if (
|
||||
selected_livery is None
|
||||
and squadron.livery_set
|
||||
and not full_list_view_override
|
||||
):
|
||||
self.addItem("Using livery-set from squadron's yaml", userData=None)
|
||||
self.setEnabled(False)
|
||||
return
|
||||
|
||||
@ -151,7 +151,9 @@ class QFlightPayloadTab(QFrame):
|
||||
)
|
||||
self.same_livery_for_all_checkbox.toggled.connect(self.on_same_livery_toggled)
|
||||
hbox.addWidget(self.same_livery_for_all_checkbox)
|
||||
self.livery_selector = SquadronLiverySelector(self.flight.squadron)
|
||||
self.livery_selector = SquadronLiverySelector(
|
||||
self.flight.squadron, full_list_view_override=True
|
||||
)
|
||||
self.livery_selector.insertItem(0, "Default", None)
|
||||
self.livery_selector.setCurrentIndex(
|
||||
self.livery_selector.findData(self.member_selector.selected_member.livery)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user