Add loadout names for every Liberation task type.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/867
This commit is contained in:
Dan Albert 2021-05-17 01:46:38 -07:00
parent d41e69d770
commit f2e3ccd18c

View File

@ -83,7 +83,8 @@ class Loadout:
# names, so those have been included here too. The priority goes from first to # names, so those have been included here too. The priority goes from first to
# last - the first element in the tuple will be tried first, then the second, # last - the first element in the tuple will be tried first, then the second,
# etc. # etc.
yield from { loadout_names = {t: [f"Liberation {t.value}"] for t in FlightType}
legacy_names = {
FlightType.TARCAP: ("CAP HEAVY", "CAP"), FlightType.TARCAP: ("CAP HEAVY", "CAP"),
FlightType.BARCAP: ("CAP HEAVY", "CAP"), FlightType.BARCAP: ("CAP HEAVY", "CAP"),
FlightType.CAS: ("CAS MAVERICK F", "CAS"), FlightType.CAS: ("CAS MAVERICK F", "CAS"),
@ -97,9 +98,10 @@ class Loadout:
FlightType.SWEEP: ("CAP HEAVY", "CAP"), FlightType.SWEEP: ("CAP HEAVY", "CAP"),
FlightType.OCA_RUNWAY: ("RUNWAY_ATTACK", "RUNWAY_STRIKE", "STRIKE"), FlightType.OCA_RUNWAY: ("RUNWAY_ATTACK", "RUNWAY_STRIKE", "STRIKE"),
FlightType.OCA_AIRCRAFT: ("OCA", "CAS MAVERICK F", "CAS"), FlightType.OCA_AIRCRAFT: ("OCA", "CAS MAVERICK F", "CAS"),
FlightType.TRANSPORT: (), }
FlightType.AEWC: (), for flight_type, names in legacy_names.items():
}.get(flight.flight_type, []) loadout_names[flight_type].extend(names)
yield from loadout_names[flight.flight_type]
@classmethod @classmethod
def default_for(cls, flight: Flight) -> Loadout: def default_for(cls, flight: Flight) -> Loadout: