mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Improve Layout System and adopt to review
- adopted to review comments - removed the role from layouts - reworked the Groups within the layouts - added more documentation - rebased to latest changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from .faction import Faction
|
||||
from .faction_loader import FactionLoader
|
||||
from .factionloader import FactionLoader
|
||||
|
||||
FACTIONS = FactionLoader()
|
||||
|
||||
@@ -150,7 +150,7 @@ class Faction:
|
||||
for unit in preset_group.units
|
||||
),
|
||||
)
|
||||
return list(all_units)
|
||||
return list(set(all_units))
|
||||
|
||||
@property
|
||||
def air_defenses(self) -> list[str]:
|
||||
@@ -158,7 +158,11 @@ class Faction:
|
||||
# This is used for the faction overview in NewGameWizard
|
||||
air_defenses = [a.name for a in self.air_defense_units]
|
||||
air_defenses.extend(
|
||||
[pg.name for pg in self.preset_groups if pg.role == GroupRole.AIR_DEFENSE]
|
||||
[
|
||||
pg.name
|
||||
for pg in self.preset_groups
|
||||
if any(task.role == GroupRole.AIR_DEFENSE for task in pg.tasks)
|
||||
]
|
||||
)
|
||||
return sorted(air_defenses)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user