Dan Albert 515efd0598 Draw frozen combat on the map.
Very basic display. Draws the engagement footprint for air-to-air
combat, a line from the flight to the target for IP, and lines from SAMs
to their target for air defense.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-21 14:56:25 -08:00

28 lines
869 B
Python

from PySide2.QtCore import Property, QObject, Signal
from game.sim.combat.aircombat import AirCombat
from game.theater import ConflictTheater
from .leaflet import LeafletPoly
from .shapelyutil import ShapelyUtil
class AirCombatJs(QObject):
footprintChanged = Signal()
def __init__(self, combat: AirCombat, theater: ConflictTheater) -> None:
super().__init__()
self.combat = combat
self.theater = theater
self._footprint = self._make_footprint()
@Property(type=list, notify=footprintChanged)
def footprint(self) -> list[LeafletPoly]:
return self._footprint
def refresh(self) -> None:
self._footprint = self._make_footprint()
self.footprintChanged.emit()
def _make_footprint(self) -> list[LeafletPoly]:
return ShapelyUtil.polys_to_leaflet(self.combat.footprint, self.theater)