Add support for some extra loadout types.

Also fixes the bug that @Starfire13 spotted in Khopa/dcs_liberation#744.
This commit is contained in:
Simon Clark 2021-01-07 13:37:16 +00:00
parent a81890e844
commit 7085bce6d4
2 changed files with 11 additions and 9 deletions

View File

@ -1026,22 +1026,23 @@ resources/payloads/UNIT_TYPE.lua file. A Flight has no concept of a PyDCS task,
used here. This is used in the payload editor, for setting the default loadout of an object.
The left element is the FlightType name, and the right element is a tuple containing what is used in the lua file.
Some aircraft differ from the standard loadout 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, etc.
"""
EXPANDED_TASK_PAYLOAD_OVERRIDE = {
"TARCAP": ("CAP", "CAP HEAVY"),
"BARCAP": ("CAP", "CAP HEAVY"),
"CAS": ("CAS","CAS MAVERICK F"),
"INTERCEPTION": ("CAP", "CAP HEAVY"),
"TARCAP": ("CAP HEAVY", "CAP"),
"BARCAP": ("CAP HEAVY", "CAP"),
"CAS": ("CAS MAVERICK F", "CAS"),
"INTERCEPTION": ("CAP HEAVY", "CAP"),
"STRIKE": ("STRIKE"),
"ANTISHIP": ("ANTISHIP"),
"SEAD": ("SEAD"),
"DEAD": ("SEAD"),
"ESCORT": ("CAP", "CAP HEAVY"),
"BAI": ("CAS","CAS MAVERICK F"),
"SWEEP": ("CAP", "CAP HEAVY"),
"OCA_RUNWAY": ("STRIKE"),
"OCA_AIRCRAFT": ("CAS","CAS MAVERICK F")
"ESCORT": ("CAP HEAVY", "CAP"),
"BAI": ( "BAI", "CAS MAVERICK F", "CAS"),
"SWEEP": ("CAP HEAVY", "CAP"),
"OCA_RUNWAY": ("OCA","RUNWAY_ATTACK","STRIKE"),
"OCA_AIRCRAFT": ("CAS MAVERICK F", "CAS")
}
PLANE_PAYLOAD_OVERRIDES: Dict[Type[PlaneType], Dict[Type[Task], str]] = {

View File

@ -46,6 +46,7 @@ class QPylonEditor(QComboBox):
def default_loadout(self, pylon: Pylon) -> None:
self.flight.unit_type.load_payloads()
pylon_default_weapon = None
loadout = None
# Iterate through each possible payload type for a given aircraft.
# Some aircraft have custom loadouts that in aren't the standard set.
for payload_override in db.EXPANDED_TASK_PAYLOAD_OVERRIDE.get(self.flight.flight_type.name):