mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Move livery overrides to unit yaml.
This commit is contained in:
parent
c1cb32de21
commit
52ed6f3f94
17
game/db.py
17
game/db.py
@ -11,8 +11,6 @@ from dcs.helicopters import (
|
|||||||
# mypy can't resolve these if they're wildcard imports for some reason.
|
# mypy can't resolve these if they're wildcard imports for some reason.
|
||||||
from dcs.planes import (
|
from dcs.planes import (
|
||||||
B_17G,
|
B_17G,
|
||||||
FA_18C_hornet,
|
|
||||||
F_14A,
|
|
||||||
F_16C_50,
|
F_16C_50,
|
||||||
Ju_88A4,
|
Ju_88A4,
|
||||||
P_51D_30_NA,
|
P_51D_30_NA,
|
||||||
@ -28,7 +26,7 @@ from dcs.ships import (
|
|||||||
Stennis,
|
Stennis,
|
||||||
ship_map,
|
ship_map,
|
||||||
)
|
)
|
||||||
from dcs.unittype import FlyingType, ShipType, UnitType, VehicleType
|
from dcs.unittype import ShipType, UnitType, VehicleType
|
||||||
from dcs.vehicles import (
|
from dcs.vehicles import (
|
||||||
vehicle_map,
|
vehicle_map,
|
||||||
)
|
)
|
||||||
@ -68,19 +66,6 @@ country : DCS Country name
|
|||||||
"""
|
"""
|
||||||
FACTIONS = FactionLoader()
|
FACTIONS = FactionLoader()
|
||||||
|
|
||||||
"""
|
|
||||||
Aircraft livery overrides. Syntax as follows:
|
|
||||||
|
|
||||||
`Identifier`: "LiveryName",
|
|
||||||
|
|
||||||
`Identifier` is aircraft identifier (as used troughout the file) and "LiveryName" (with double quotes)
|
|
||||||
is livery name as found in mission editor.
|
|
||||||
"""
|
|
||||||
PLANE_LIVERY_OVERRIDES: dict[Type[FlyingType], str] = {
|
|
||||||
FA_18C_hornet: "VFA-34", # default livery for the hornet is blue angels one
|
|
||||||
F_14A: "vf-142 `ghost riders`", # default livery for the AI F-14A is the black demo scheme
|
|
||||||
}
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Possible time periods for new games
|
Possible time periods for new games
|
||||||
|
|
||||||
|
|||||||
@ -32,10 +32,10 @@ from game.radio.channels import (
|
|||||||
)
|
)
|
||||||
from game.utils import (
|
from game.utils import (
|
||||||
Distance,
|
Distance,
|
||||||
SPEED_OF_SOUND_AT_SEA_LEVEL,
|
|
||||||
ImperialUnits,
|
ImperialUnits,
|
||||||
MetricUnits,
|
MetricUnits,
|
||||||
NauticalUnits,
|
NauticalUnits,
|
||||||
|
SPEED_OF_SOUND_AT_SEA_LEVEL,
|
||||||
Speed,
|
Speed,
|
||||||
UnitSystem,
|
UnitSystem,
|
||||||
feet,
|
feet,
|
||||||
@ -174,6 +174,8 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
|||||||
|
|
||||||
fuel_consumption: Optional[FuelConsumption]
|
fuel_consumption: Optional[FuelConsumption]
|
||||||
|
|
||||||
|
default_livery: Optional[str]
|
||||||
|
|
||||||
intra_flight_radio: Optional[Radio]
|
intra_flight_radio: Optional[Radio]
|
||||||
channel_allocator: Optional[RadioChannelAllocator]
|
channel_allocator: Optional[RadioChannelAllocator]
|
||||||
channel_namer: Type[ChannelNamer]
|
channel_namer: Type[ChannelNamer]
|
||||||
@ -409,6 +411,7 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
|||||||
patrol_speed=patrol_config.speed,
|
patrol_speed=patrol_config.speed,
|
||||||
max_mission_range=mission_range,
|
max_mission_range=mission_range,
|
||||||
fuel_consumption=fuel_consumption,
|
fuel_consumption=fuel_consumption,
|
||||||
|
default_livery=data.get("default_livery"),
|
||||||
intra_flight_radio=radio_config.intra_flight,
|
intra_flight_radio=radio_config.intra_flight,
|
||||||
channel_allocator=radio_config.channel_allocator,
|
channel_allocator=radio_config.channel_allocator,
|
||||||
channel_namer=radio_config.channel_namer,
|
channel_namer=radio_config.channel_namer,
|
||||||
|
|||||||
@ -5,7 +5,6 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from dcs.unitgroup import FlyingGroup
|
from dcs.unitgroup import FlyingGroup
|
||||||
|
|
||||||
from game import db
|
|
||||||
from game.ato import Flight
|
from game.ato import Flight
|
||||||
|
|
||||||
|
|
||||||
@ -14,8 +13,8 @@ class AircraftPainter:
|
|||||||
self.flight = flight
|
self.flight = flight
|
||||||
self.group = group
|
self.group = group
|
||||||
|
|
||||||
def livery_from_db(self) -> Optional[str]:
|
def livery_from_unit_type(self) -> Optional[str]:
|
||||||
return db.PLANE_LIVERY_OVERRIDES.get(self.flight.unit_type.dcs_unit_type)
|
return self.flight.unit_type.default_livery
|
||||||
|
|
||||||
def livery_from_faction(self) -> Optional[str]:
|
def livery_from_faction(self) -> Optional[str]:
|
||||||
faction = self.flight.squadron.coalition.faction
|
faction = self.flight.squadron.coalition.faction
|
||||||
@ -33,7 +32,7 @@ class AircraftPainter:
|
|||||||
return livery
|
return livery
|
||||||
if (livery := self.livery_from_faction()) is not None:
|
if (livery := self.livery_from_faction()) is not None:
|
||||||
return livery
|
return livery
|
||||||
if (livery := self.livery_from_db()) is not None:
|
if (livery := self.livery_from_unit_type()) is not None:
|
||||||
return livery
|
return livery
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@ -21,5 +21,7 @@ origin: USA
|
|||||||
price: 20
|
price: 20
|
||||||
role: Carrier-based Air-Superiority Fighter/Fighter Bomber
|
role: Carrier-based Air-Superiority Fighter/Fighter Bomber
|
||||||
max_range: 350
|
max_range: 350
|
||||||
|
# DCS default livery for the AI F-14A is the black demo scheme.
|
||||||
|
default_livery: vf-142 `ghost riders`
|
||||||
variants:
|
variants:
|
||||||
F-14A Tomcat (AI): {}
|
F-14A Tomcat (AI): {}
|
||||||
@ -21,6 +21,8 @@ manufacturer: McDonnell Douglas
|
|||||||
origin: USA
|
origin: USA
|
||||||
price: 24
|
price: 24
|
||||||
role: Carrier-based Multirole Fighter
|
role: Carrier-based Multirole Fighter
|
||||||
|
# DCS default livery for the Hornet is the Blue Angels.
|
||||||
|
default_livery: "VFA-34"
|
||||||
fuel:
|
fuel:
|
||||||
# Parking A1 to RWY 32 at Akrotiri.
|
# Parking A1 to RWY 32 at Akrotiri.
|
||||||
taxi: 170
|
taxi: 170
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user