Fix livery overrides

This commit is contained in:
Raffson 2022-12-03 21:28:13 +01:00
parent 4af7255917
commit 6c673697f0
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -161,6 +161,14 @@ class SquadronLiverySelector(QComboBox):
valid_livery = livery.countries is None or cc in livery.countries
if valid_livery or cc in ["BLUE", "RED"]:
liveries.add(livery)
faction = squadron.coalition.faction
overrides = [
x
for x in faction.liveries_overrides.get(self.aircraft_type, [])
if x in [y.id.lower() for y in liveries]
]
if len(overrides) > 0:
self.addItem("Use livery overrides", userData=None)
for livery in sorted(liveries):
self.addItem(livery.name, userData=livery.id)
if selected_livery is not None: