mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Revert "Use the actual Country type instead of the name."
This reverts commit bd2ec12e0f.
Country is both the data (name, ID, etc) and the container for groups
added to the miz, so it can't be used across multiple mission
generations. See https://github.com/pydcs/dcs/issues/314 for potential
follow up work that would let us do this.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2864.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import dcs.countries
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
from dcs.liveries.livery import Livery
|
||||
|
||||
@@ -21,7 +22,9 @@ class LiverySelector(QComboBox):
|
||||
self.clear()
|
||||
self.addItem("Default", None)
|
||||
for idx, livery in enumerate(
|
||||
squadron.aircraft.dcs_unit_type.iter_liveries_for_country(squadron.country)
|
||||
squadron.aircraft.dcs_unit_type.iter_liveries_for_country(
|
||||
dcs.countries.get_by_name(squadron.country)
|
||||
)
|
||||
):
|
||||
self.addItem(livery.name, livery)
|
||||
if squadron.livery == livery.id:
|
||||
|
||||
@@ -40,6 +40,7 @@ class QFlightCreator(QDialog):
|
||||
self.game = game
|
||||
self.package = package
|
||||
self.custom_name_text = None
|
||||
self.country = self.game.blue.country_name
|
||||
|
||||
# Make dialog modal to prevent background windows to close unexpectedly.
|
||||
self.setModal(True)
|
||||
@@ -182,6 +183,7 @@ class QFlightCreator(QDialog):
|
||||
|
||||
flight = Flight(
|
||||
self.package,
|
||||
self.country,
|
||||
squadron,
|
||||
# A bit of a hack to work around the old API. Not actually relevant because
|
||||
# the roster is passed explicitly. Needs a refactor.
|
||||
|
||||
Reference in New Issue
Block a user