Add custom name for packages in ATO overview

Resolves #55
This commit is contained in:
Raffson
2023-01-02 02:26:00 +01:00
parent f4d75a2c6f
commit 2aed461b3a
4 changed files with 32 additions and 2 deletions

View File

@@ -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