Track airlift cargo kills.

https://github.com/Khopa/dcs_liberation/issues/825
This commit is contained in:
Dan Albert
2021-04-22 19:22:41 -07:00
parent e474748f4d
commit 29b70b3247
6 changed files with 120 additions and 8 deletions

View File

@@ -83,6 +83,17 @@ class QDebriefingWindow(QDialog):
except AttributeError:
logging.exception(f"Issue adding {unit_type} to debriefing information")
airlift_losses = self.debriefing.airlift_losses_by_type(player=True)
for unit_type, count in airlift_losses.items():
try:
lostUnitsLayout.addWidget(
QLabel(f"{db.unit_type_name(unit_type)} from airlift"), row, 0
)
lostUnitsLayout.addWidget(QLabel(str(count)), row, 1)
row += 1
except AttributeError:
logging.exception(f"Issue adding {unit_type} to debriefing information")
building_losses = self.debriefing.building_losses_by_type(player=True)
for building, count in building_losses.items():
try:
@@ -135,6 +146,17 @@ class QDebriefingWindow(QDialog):
except AttributeError:
logging.exception(f"Issue adding {unit_type} to debriefing information")
airlift_losses = self.debriefing.airlift_losses_by_type(player=False)
for unit_type, count in airlift_losses.items():
try:
lostUnitsLayout.addWidget(
QLabel(f"{db.unit_type_name(unit_type)} from airlift"), row, 0
)
lostUnitsLayout.addWidget(QLabel(str(count)), row, 1)
row += 1
except AttributeError:
logging.exception(f"Issue adding {unit_type} to debriefing information")
building_losses = self.debriefing.building_losses_by_type(player=False)
for building, count in building_losses.items():
try:

View File

@@ -151,16 +151,19 @@ class QWaitingForMissionResultWindow(QDialog):
updateLayout.addWidget(QLabel("<b>Convoy units destroyed</b>"), 2, 0)
updateLayout.addWidget(QLabel(str(len(list(debriefing.convoy_losses)))), 2, 1)
updateLayout.addWidget(QLabel("<b>Other ground units destroyed</b>"), 3, 0)
updateLayout.addWidget(QLabel("<b>Airlift cargo destroyed</b>"), 3, 0)
updateLayout.addWidget(QLabel(str(len(list(debriefing.airlift_losses)))), 3, 1)
updateLayout.addWidget(QLabel("<b>Other ground units destroyed</b>"), 4, 0)
updateLayout.addWidget(
QLabel(str(len(list(debriefing.ground_object_losses)))), 3, 1
QLabel(str(len(list(debriefing.ground_object_losses)))), 4, 1
)
updateLayout.addWidget(QLabel("<b>Buildings destroyed</b>"), 4, 0)
updateLayout.addWidget(QLabel(str(len(list(debriefing.building_losses)))), 4, 1)
updateLayout.addWidget(QLabel("<b>Buildings destroyed</b>"), 5, 0)
updateLayout.addWidget(QLabel(str(len(list(debriefing.building_losses)))), 5, 1)
updateLayout.addWidget(QLabel("<b>Base Capture Events</b>"), 5, 0)
updateLayout.addWidget(QLabel(str(len(debriefing.base_capture_events))), 5, 1)
updateLayout.addWidget(QLabel("<b>Base Capture Events</b>"), 6, 0)
updateLayout.addWidget(QLabel(str(len(debriefing.base_capture_events))), 6, 1)
# Clear previous content of the window
for i in reversed(range(self.gridLayout.count())):