mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Show player/AI status for pilots.
https://github.com/dcs-liberation/dcs_liberation/issues/276
This commit is contained in:
parent
e480519855
commit
b38d271f10
@ -25,14 +25,17 @@ class PilotDelegate(TwoColumnRowDelegate):
|
|||||||
return index.data(SquadronModel.PilotRole)
|
return index.data(SquadronModel.PilotRole)
|
||||||
|
|
||||||
def text_for(self, index: QModelIndex, row: int, column: int) -> str:
|
def text_for(self, index: QModelIndex, row: int, column: int) -> str:
|
||||||
|
pilot = self.pilot(index)
|
||||||
if (row, column) == (0, 0):
|
if (row, column) == (0, 0):
|
||||||
return self.squadron_model.data(index, Qt.DisplayRole)
|
return self.squadron_model.data(index, Qt.DisplayRole)
|
||||||
elif (row, column) == (0, 1):
|
elif (row, column) == (0, 1):
|
||||||
flown = self.pilot(index).record.missions_flown
|
flown = pilot.record.missions_flown
|
||||||
missions = "missions" if flown != 1 else "mission"
|
missions = "missions" if flown != 1 else "mission"
|
||||||
return f"{flown} {missions} flown"
|
return f"{flown} {missions} flown"
|
||||||
elif (row, column) == (1, 0):
|
elif (row, column) == (1, 0):
|
||||||
return "Alive" if self.pilot(index).alive else "Dead"
|
return "Player" if pilot.player else "AI"
|
||||||
|
elif (row, column) == (1, 1):
|
||||||
|
return "Alive" if pilot.alive else "Dead"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user