mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Change squadrons to operate out of a single base.
https://github.com/dcs-liberation/dcs_liberation/issues/1145 Currently this is fixed at the start of the campaign. The squadron locations are defined by the campaign file. Follow up work: * Track aircraft ownership per-squadron rather than per-airbase. * UI for relocating squadrons. * Ferry missions for squadrons that are relocating. * Auto-relocation (probably only for retreat handling). Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1138
This commit is contained in:
@@ -10,7 +10,6 @@ from typing import Tuple, Dict, Any
|
||||
from packaging.version import Version
|
||||
import yaml
|
||||
|
||||
from game.campaignloader.mizcampaignloader import MizCampaignLoader
|
||||
from game.profiling import logged_duration
|
||||
from game.theater import (
|
||||
ConflictTheater,
|
||||
@@ -23,6 +22,8 @@ from game.theater import (
|
||||
MarianaIslandsTheater,
|
||||
)
|
||||
from game.version import CAMPAIGN_FORMAT_VERSION
|
||||
from .campaignairwingconfig import CampaignAirWingConfig
|
||||
from .mizcampaignloader import MizCampaignLoader
|
||||
|
||||
|
||||
PERF_FRIENDLY = 0
|
||||
@@ -103,6 +104,14 @@ class Campaign:
|
||||
MizCampaignLoader(self.path.parent / miz, t).populate_theater()
|
||||
return t
|
||||
|
||||
def load_air_wing_config(self, theater: ConflictTheater) -> CampaignAirWingConfig:
|
||||
try:
|
||||
squadron_data = self.data["squadrons"]
|
||||
except KeyError:
|
||||
logging.warning(f"Campaign {self.name} does not define any squadrons")
|
||||
return CampaignAirWingConfig({})
|
||||
return CampaignAirWingConfig.from_campaign_data(squadron_data, theater)
|
||||
|
||||
@property
|
||||
def is_out_of_date(self) -> bool:
|
||||
"""Returns True if this campaign is not up to date with the latest format.
|
||||
|
||||
Reference in New Issue
Block a user