mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Show active and available pilots in air wing view.
https://github.com/dcs-liberation/dcs_liberation/issues/276
This commit is contained in:
parent
57a2457050
commit
5277beede3
@ -84,9 +84,13 @@ class Squadron:
|
||||
def faker(self) -> Faker:
|
||||
return self.game.faker_for(self.player)
|
||||
|
||||
@property
|
||||
def active_pilots(self) -> list[Pilot]:
|
||||
return [p for p in self.pilots if p.alive]
|
||||
|
||||
@property
|
||||
def size(self) -> int:
|
||||
return len(self.pilots)
|
||||
return len(self.active_pilots)
|
||||
|
||||
def pilot_at_index(self, index: int) -> Pilot:
|
||||
return self.pilots[index]
|
||||
|
||||
@ -39,6 +39,10 @@ class SquadronDelegate(TwoColumnRowDelegate):
|
||||
)
|
||||
elif (row, column) == (1, 0):
|
||||
return self.squadron(index).nickname
|
||||
elif (row, column) == (1, 1):
|
||||
squadron = self.squadron(index)
|
||||
available = len(squadron.available_pilots)
|
||||
return f"{squadron.size} active pilots, {available} available"
|
||||
return ""
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user