mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Show runway status on the new map.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1105
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user