mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Made it possible to setup custom liveries in faction files.
This commit is contained in:
parent
8d57bbc777
commit
e6e4cca076
@ -105,6 +105,9 @@ class Faction:
|
||||
# List of available buildings for this faction
|
||||
building_set: List[str] = field(default_factory=list)
|
||||
|
||||
# List of default livery overrides
|
||||
liveries_overrides: Dict[UnitType, List[str]] = field(default_factory=dict)
|
||||
|
||||
@classmethod
|
||||
def from_json(cls: Type[Faction], json: Dict[str, Any]) -> Faction:
|
||||
|
||||
@ -183,6 +186,14 @@ class Faction:
|
||||
else:
|
||||
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
|
||||
|
||||
@property
|
||||
|
||||
@ -713,6 +713,17 @@ class AircraftConflictGenerator:
|
||||
for unit_instance in group.units:
|
||||
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)):
|
||||
unit = group.units[idx]
|
||||
if self.use_client:
|
||||
|
||||
@ -61,5 +61,24 @@
|
||||
"OliverHazardPerryGroupGenerator"
|
||||
],
|
||||
"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"
|
||||
],
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -70,5 +70,19 @@
|
||||
"OliverHazardPerryGroupGenerator"
|
||||
],
|
||||
"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