mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
MAde it possible to setup liveries in faction files.
This commit is contained in:
parent
28e00055ab
commit
e26b692631
@ -3,6 +3,7 @@
|
|||||||
# Features/Improvements
|
# Features/Improvements
|
||||||
* **[Flight Planner]** Added fighter sweep missions.
|
* **[Flight Planner]** Added fighter sweep missions.
|
||||||
* **[Flight Planner]** Differentiated BARCAP and TARCAP. TARCAP is now for hostile areas and will arrive before the package.
|
* **[Flight Planner]** Differentiated BARCAP and TARCAP. TARCAP is now for hostile areas and will arrive before the package.
|
||||||
|
* **[Modding]** Possible to setup liveries overrides for factions
|
||||||
|
|
||||||
# 2.2.1
|
# 2.2.1
|
||||||
|
|
||||||
|
|||||||
@ -105,6 +105,9 @@ class Faction:
|
|||||||
# List of available buildings for this faction
|
# List of available buildings for this faction
|
||||||
building_set: List[str] = field(default_factory=list)
|
building_set: List[str] = field(default_factory=list)
|
||||||
|
|
||||||
|
# List of default livery overrides
|
||||||
|
liveries_overrides: Dict[UnitType, List[str]] = field(default_factory=dict)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_json(cls: Type[Faction], json: Dict[str, Any]) -> Faction:
|
def from_json(cls: Type[Faction], json: Dict[str, Any]) -> Faction:
|
||||||
|
|
||||||
@ -183,6 +186,14 @@ class Faction:
|
|||||||
else:
|
else:
|
||||||
faction.building_set = DEFAULT_AVAILABLE_BUILDINGS
|
faction.building_set = DEFAULT_AVAILABLE_BUILDINGS
|
||||||
|
|
||||||
|
# Load liveries override
|
||||||
|
faction.liveries_overrides = {}
|
||||||
|
liveries_overrides = json.get("liveries_overrides", {})
|
||||||
|
for k, v in liveries_overrides.items():
|
||||||
|
k = load_aircraft(k)
|
||||||
|
if k is not None:
|
||||||
|
faction.liveries_overrides[k] = [s.lower() for s in v]
|
||||||
|
|
||||||
return faction
|
return faction
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@ -714,6 +714,17 @@ class AircraftConflictGenerator:
|
|||||||
for unit_instance in group.units:
|
for unit_instance in group.units:
|
||||||
unit_instance.livery_id = db.PLANE_LIVERY_OVERRIDES[unit_type]
|
unit_instance.livery_id = db.PLANE_LIVERY_OVERRIDES[unit_type]
|
||||||
|
|
||||||
|
# Override livery by faction file data
|
||||||
|
if flight.from_cp.captured:
|
||||||
|
faction = self.game.player_faction
|
||||||
|
else:
|
||||||
|
faction = self.game.enemy_faction
|
||||||
|
|
||||||
|
if unit_type in faction.liveries_overrides:
|
||||||
|
livery = random.choice(faction.liveries_overrides[unit_type])
|
||||||
|
for unit_instance in group.units:
|
||||||
|
unit_instance.livery_id = livery
|
||||||
|
|
||||||
for idx in range(0, min(len(group.units), flight.client_count)):
|
for idx in range(0, min(len(group.units), flight.client_count)):
|
||||||
unit = group.units[idx]
|
unit = group.units[idx]
|
||||||
if self.use_client:
|
if self.use_client:
|
||||||
|
|||||||
@ -61,5 +61,24 @@
|
|||||||
"OliverHazardPerryGroupGenerator"
|
"OliverHazardPerryGroupGenerator"
|
||||||
],
|
],
|
||||||
"has_jtac": true,
|
"has_jtac": true,
|
||||||
"jtac_unit": "MQ_9_Reaper"
|
"jtac_unit": "MQ_9_Reaper",
|
||||||
|
"liveries_overrides": {
|
||||||
|
"FA_18C_hornet": [
|
||||||
|
"NSAWC brown splinter",
|
||||||
|
"NAWDC black",
|
||||||
|
"VFC-12"
|
||||||
|
],
|
||||||
|
"F_15C": [
|
||||||
|
"65th Aggressor SQN (WA) MiG",
|
||||||
|
"65th Aggressor SQN (WA) MiG",
|
||||||
|
"65th Aggressor SQN (WA) SUPER_Flanker"
|
||||||
|
],
|
||||||
|
"F_16C_50": [
|
||||||
|
"usaf 64th aggressor sqn - shark",
|
||||||
|
"usaf 64th aggressor sqn-splinter",
|
||||||
|
"64th_aggressor_squadron_ghost"
|
||||||
|
], "F_14B": [
|
||||||
|
"vf-74 adversary"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -86,5 +86,25 @@
|
|||||||
"OliverHazardPerryGroupGenerator"
|
"OliverHazardPerryGroupGenerator"
|
||||||
],
|
],
|
||||||
"has_jtac": true,
|
"has_jtac": true,
|
||||||
"jtac_unit": "MQ_9_Reaper"
|
"jtac_unit": "MQ_9_Reaper",
|
||||||
|
"liveries_overrides": {
|
||||||
|
"FA_18C_hornet": [
|
||||||
|
"VFA-37",
|
||||||
|
"VFA-106",
|
||||||
|
"VFA-113",
|
||||||
|
"VFA-122",
|
||||||
|
"VFA-131",
|
||||||
|
"VFA-192",
|
||||||
|
"VFA-34",
|
||||||
|
"VFA-83",
|
||||||
|
"VFA-87",
|
||||||
|
"VFA-97",
|
||||||
|
"VMFA-122",
|
||||||
|
"VMFA-132",
|
||||||
|
"VMFA-251",
|
||||||
|
"VMFA-312",
|
||||||
|
"VMFA-314",
|
||||||
|
"VMFA-323"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -69,5 +69,19 @@
|
|||||||
"OliverHazardPerryGroupGenerator"
|
"OliverHazardPerryGroupGenerator"
|
||||||
],
|
],
|
||||||
"requirements": {},
|
"requirements": {},
|
||||||
"doctrine": "coldwar"
|
"doctrine": "coldwar",
|
||||||
|
"liveries_overrides": {
|
||||||
|
"FA_18C_hornet": [
|
||||||
|
"VFA-37",
|
||||||
|
"VFA-106",
|
||||||
|
"VFA-113",
|
||||||
|
"VFA-122",
|
||||||
|
"VFA-131",
|
||||||
|
"VFA-192",
|
||||||
|
"VFA-34",
|
||||||
|
"VFA-83",
|
||||||
|
"VFA-87",
|
||||||
|
"VFA-97"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user