Rename UnitType.name what it is: the variant ID.

This property affects safe compat because the ID is what gets preserved
in the save, but it's unfortunately also used as the display name, which
means changing the display name breaks save compat. It also prevents us
from changing display names without breaking faction definitions.

This is the first step in fixing that. The next is adding a separate
display_name property that can be updated without breaking either of
those.
This commit is contained in:
Dan Albert
2023-08-09 20:50:01 -07:00
committed by Raffson
parent 97ee6ba19f
commit 1760532168
20 changed files with 79 additions and 45 deletions

View File

@@ -88,11 +88,11 @@ class AircraftIntelLayout(IntelTableLayout):
continue
self.add_header(f"{control_point.name} ({base_total})")
for airframe in sorted(allocation.present, key=lambda k: k.name):
for airframe in sorted(allocation.present, key=lambda k: k.variant_id):
count = allocation.present[airframe]
if not count:
continue
self.add_row(f" {airframe.name}", count)
self.add_row(f" {airframe.variant_id}", count)
self.add_row("")
self.add_row("<b>Total</b>", total)
@@ -117,11 +117,11 @@ class ArmyIntelLayout(IntelTableLayout):
continue
self.add_header(f"{control_point.name} ({base.total_armor})")
for vehicle in sorted(base.armor, key=lambda k: k.name):
for vehicle in sorted(base.armor, key=lambda k: k.variant_id):
count = base.armor[vehicle]
if not count:
continue
self.add_row(f" {vehicle.name}", count)
self.add_row(f" {vehicle.variant_id}", count)
self.add_row("")
self.add_row("<b>Total</b>", total)