mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
@@ -22,10 +22,15 @@ class Package:
|
||||
"""A mission package."""
|
||||
|
||||
def __init__(
|
||||
self, target: MissionTarget, db: Database[Flight], auto_asap: bool = False
|
||||
self,
|
||||
target: MissionTarget,
|
||||
db: Database[Flight],
|
||||
auto_asap: bool = False,
|
||||
custom_name: str | None = None,
|
||||
) -> None:
|
||||
self.target = target
|
||||
self._db = db
|
||||
self.custom_name = custom_name
|
||||
|
||||
# True if the package ToT should be reset to ASAP whenever the player makes a
|
||||
# change. This is really a UI property rather than a game property, but we want
|
||||
|
||||
@@ -17,6 +17,7 @@ class Migrator:
|
||||
def _migrate_game(self) -> None:
|
||||
self._update_doctrine()
|
||||
self._update_packagewaypoints()
|
||||
self._update_package_attributes()
|
||||
|
||||
def _update_doctrine(self) -> None:
|
||||
doctrines = [
|
||||
@@ -41,3 +42,9 @@ class Migrator:
|
||||
for p in c.ato.packages:
|
||||
if not hasattr(p.waypoints, "initial"):
|
||||
p.waypoints = PackageWaypoints.create(p, c)
|
||||
|
||||
def _update_package_attributes(self) -> None:
|
||||
for c in self.game.coalitions:
|
||||
for p in c.ato.packages:
|
||||
if not hasattr(p, "custom_name"):
|
||||
p.custom_name = None
|
||||
|
||||
Reference in New Issue
Block a user