Show runway status on the new map.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1105
This commit is contained in:
Dan Albert
2021-05-31 14:17:57 -07:00
parent 355e6e1d15
commit 284f2bc323
3 changed files with 67 additions and 15 deletions

View File

@@ -20,6 +20,7 @@ from game.theater import (
TheaterGroundObject,
FrontLine,
LatLon,
ControlPointStatus,
)
from game.threatzones import ThreatZones
from game.transfers import MultiGroupTransport, TransportMap
@@ -79,6 +80,7 @@ class ControlPointJs(QObject):
mobileChanged = Signal()
destinationChanged = Signal(list)
categoryChanged = Signal()
statusChanged = Signal()
def __init__(
self,
@@ -104,6 +106,17 @@ class ControlPointJs(QObject):
def category(self) -> str:
return self.control_point.category
@Property(str, notify=statusChanged)
def status(self) -> str:
status = self.control_point.status
if status is ControlPointStatus.Functional:
return "alive"
elif status is ControlPointStatus.Damaged:
return "damaged"
elif status is ControlPointStatus.Destroyed:
return "destroyed"
raise ValueError(f"Unhandled ControlPointStatus: {status.name}")
@Property(list, notify=positionChanged)
def position(self) -> LeafletLatLon:
ll = self.theater.point_to_ll(self.control_point.position)