From 7085bce6d431afde9bc8e898124b236b03a8e44f Mon Sep 17 00:00:00 2001 From: Simon Clark Date: Thu, 7 Jan 2021 13:37:16 +0000 Subject: [PATCH] Add support for some extra loadout types. Also fixes the bug that @Starfire13 spotted in Khopa/dcs_liberation#744. --- game/db.py | 19 ++++++++++--------- .../mission/flight/payload/QPylonEditor.py | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/game/db.py b/game/db.py index 3fa8bc8f..8657b816 100644 --- a/game/db.py +++ b/game/db.py @@ -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]] = { diff --git a/qt_ui/windows/mission/flight/payload/QPylonEditor.py b/qt_ui/windows/mission/flight/payload/QPylonEditor.py index 4d67aa1e..8333bf21 100644 --- a/qt_ui/windows/mission/flight/payload/QPylonEditor.py +++ b/qt_ui/windows/mission/flight/payload/QPylonEditor.py @@ -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):