Export airfield data to yaml, switch to ID keys.

This exports all the old AIRFIELD_DATA to yaml files. It's easier for
users to send fixes if it's defined this way, and they can also fix it
in their install without having to wait for a new release.

This also switches the indexes from the unstable DCS airfield names to
airfield IDs, so this fixes another case of DCS updates occasionally
breaking Liberation.

I also ended up finding quite a few typos in airfield names, and
incorrect theater names in the process. Those have been fixed.
This commit is contained in:
Dan Albert
2022-02-11 01:35:03 -08:00
parent 079f19a66e
commit 011d8a4e12
181 changed files with 2673 additions and 1547 deletions

View File

@@ -71,7 +71,7 @@ class FlightGroupConfigurator:
divert = None
if self.flight.divert is not None:
divert = self.flight.divert.active_runway(
self.game.conditions, self.dynamic_runways
self.game.theater, self.game.conditions, self.dynamic_runways
)
mission_start_time, waypoints = WaypointGenerator(
@@ -93,10 +93,10 @@ class FlightGroupConfigurator:
friendly=self.flight.from_cp.captured,
departure_delay=mission_start_time,
departure=self.flight.departure.active_runway(
self.game.conditions, self.dynamic_runways
self.game.theater, self.game.conditions, self.dynamic_runways
),
arrival=self.flight.arrival.active_runway(
self.game.conditions, self.dynamic_runways
self.game.theater, self.game.conditions, self.dynamic_runways
),
divert=divert,
waypoints=waypoints,

View File

@@ -11,16 +11,16 @@ from dcs.coalition import Coalition
from dcs.countries import country_dict
from game import db
from game.radio.radios import RadioFrequency, RadioRegistry
from game.radio.tacan import TacanRegistry
from game.theater.bullseye import Bullseye
from game.theater import Airfield, FrontLine
from game.unitmap import UnitMap
from gen.airfields import AIRFIELD_DATA
from gen.naming import namegen
from game.missiongenerator.aircraft.aircraftgenerator import (
AircraftGenerator,
)
from game.radio.radios import RadioFrequency, RadioRegistry
from game.radio.tacan import TacanRegistry
from game.theater import Airfield, FrontLine
from game.theater.bullseye import Bullseye
from game.unitmap import UnitMap
from gen.airfields import AirfieldData
from gen.naming import namegen
from .aircraft.flightdata import FlightData
from .airsupport import AirSupport
from .airsupportgenerator import AirSupportGenerator
@@ -173,8 +173,8 @@ class MissionGenerator:
def initialize_radio_registry(
self, unique_map_frequencies: set[RadioFrequency]
) -> None:
for data in AIRFIELD_DATA.values():
if data.theater == self.game.theater.terrain.name and data.atc:
for data in AirfieldData.for_theater(self.game.theater):
if data.atc is not None:
unique_map_frequencies.add(data.atc.hf)
unique_map_frequencies.add(data.atc.vhf_fm)
unique_map_frequencies.add(data.atc.vhf_am)