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

@@ -66,7 +66,7 @@ class QUnitInfoWindow(QDialog):
self.setModal(True)
self.game = game
self.unit_type = unit_type
self.name = unit_type.name
self.name = unit_type.variant_id
self.setWindowTitle(f"Unit Info: {self.name}")
self.setWindowIcon(QIcon("./resources/icon.png"))
self.setMinimumHeight(570)
@@ -93,7 +93,7 @@ class QUnitInfoWindow(QDialog):
self.details_grid_layout.setMargin(0)
self.name_box = QLabel(
f"<b>Name:</b> {unit_type.manufacturer} {unit_type.name}"
f"<b>Name:</b> {unit_type.manufacturer} {unit_type.variant_id}"
)
self.name_box.setProperty("style", "info-element")