mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
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
28 lines
869 B
Python
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)
|