Add Load/Save for AirWingConfig #167

This commit is contained in:
Raffson
2023-12-29 17:41:07 +01:00
parent 96c7e20488
commit d0dec86a6d
3 changed files with 113 additions and 3 deletions

View File

@@ -140,6 +140,7 @@ class Migrator:
"Netherlands": "The Netherlands",
"CHN": "China",
}
# Squadrons
for cp in self.game.theater.controlpoints:
for s in cp.squadrons:
preferred_task = max(
@@ -165,6 +166,11 @@ class Migrator:
if self.is_liberation:
s.set_auto_assignable_mission_types(s.auto_assignable_mission_types)
# SquadronDefs
for coa in self.game.coalitions:
for ac, sdefs in coa.air_wing.squadron_defs.items():
for sdef in sdefs:
try_set_attr(sdef, "radio_presets", {})
@typing.no_type_check
def _update_factions(self) -> None:

View File

@@ -91,6 +91,10 @@ def settings_dir() -> Path:
return base_path() / "Retribution" / "Settings"
def airwing_dir() -> Path:
return base_path() / "Retribution" / "AirWing"
def payloads_dir(backup: bool = False) -> Path:
payloads = base_path() / "MissionEditor" / "UnitPayloads"
if backup: