Display damaged runways.

This commit is contained in:
Dan Albert 2020-11-25 14:53:01 -08:00
parent 7dfb0c67e5
commit ee768b9147
3 changed files with 7 additions and 8 deletions

View File

@ -404,7 +404,7 @@ class Airfield(ControlPoint):
return self.airport.runways[0].heading
def has_runway(self) -> bool:
return True
return not self.damaged
def active_runway(self, conditions: Conditions,
dynamic_runways: Dict[str, RunwayData]) -> RunwayData:

View File

@ -33,13 +33,12 @@ class QMapControlPoint(QMapObject):
painter.setBrush(self.brush_color)
painter.setPen(self.pen_color)
if self.control_point.has_runway():
if self.isUnderMouse():
painter.setBrush(const.COLORS["white"])
painter.setPen(self.pen_color)
if not self.control_point.has_runway():
painter.setBrush(const.COLORS["black"])
painter.setPen(self.brush_color)
r = option.rect
painter.drawEllipse(r.x(), r.y(), r.width(), r.height())
r = option.rect
painter.drawEllipse(r.x(), r.y(), r.width(), r.height())
# TODO: Draw sunk carriers differently.
# Either don't draw them at all, or perhaps use a sunk ship icon.
painter.restore()

View File

@ -61,7 +61,7 @@ class QBaseMenu2(QDialog):
title.setProperty("style", "base-title")
aircraft = self.cp.base.total_aircraft
armor = self.cp.base.total_armor
runway_status = "operational" if self.cp.has_runway() else "inoperative"
runway_status = "operational" if self.cp.has_runway() else "damaged"
intel_summary = QLabel("\n".join([
f"{aircraft} aircraft",
f"{armor} ground units",