mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Finish implementation of add/remove squadrons from AirWingConfigurationDialog
Users can now add and remove squadrons with specific buttons. this also allows new aircraft types to be added as well. - rebased existing PR to develop - reverted observable and changed to signals - changed the general concept so that changes only affect the ui data model and not the game directly. Game will only be updated on apply - removed unused code - adopt to review comments - allow user to choose a predefined squadron preset (also alow none value to use the random generator) - Reuse the squadron defs from the default assigner in the AirWing class - allow user to re-roll the squadron nickname (also added new ui icons for the button)
This commit is contained in:
@@ -10,13 +10,13 @@ from .squadrondef import SquadronDef
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game import Game
|
||||
from game.coalition import Coalition
|
||||
from ..factions.faction import Faction
|
||||
|
||||
|
||||
class SquadronDefLoader:
|
||||
def __init__(self, game: Game, coalition: Coalition) -> None:
|
||||
def __init__(self, game: Game, faction: Faction) -> None:
|
||||
self.game = game
|
||||
self.coalition = coalition
|
||||
self.faction = faction
|
||||
|
||||
@staticmethod
|
||||
def squadron_directories() -> Iterator[Path]:
|
||||
@@ -27,8 +27,8 @@ class SquadronDefLoader:
|
||||
|
||||
def load(self) -> dict[AircraftType, list[SquadronDef]]:
|
||||
squadrons: dict[AircraftType, list[SquadronDef]] = defaultdict(list)
|
||||
country = self.coalition.country_name
|
||||
faction = self.coalition.faction
|
||||
country = self.faction.country
|
||||
faction = self.faction
|
||||
any_country = country.startswith("Combined Joint Task Forces ")
|
||||
for directory in self.squadron_directories():
|
||||
for path, squadron_def in self.load_squadrons_from(directory):
|
||||
|
||||
Reference in New Issue
Block a user