mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Set up icons for TGOs.
These are just the old icons, but it's better than nothing.
This commit is contained in:
@@ -154,6 +154,8 @@ class GroundObjectJs(QObject):
|
||||
positionChanged = Signal()
|
||||
samThreatRangesChanged = Signal()
|
||||
samDetectionRangesChanged = Signal()
|
||||
categoryChanged = Signal()
|
||||
deadChanged = Signal()
|
||||
|
||||
def __init__(self, tgo: TheaterGroundObject, game: Game) -> None:
|
||||
super().__init__()
|
||||
@@ -189,6 +191,10 @@ class GroundObjectJs(QObject):
|
||||
def name(self) -> str:
|
||||
return self.tgo.name
|
||||
|
||||
@Property(str, notify=categoryChanged)
|
||||
def category(self) -> str:
|
||||
return self.tgo.category
|
||||
|
||||
def make_unit_name(self, unit: Unit, dead: bool) -> str:
|
||||
dead_label = " [DEAD]" if dead else ""
|
||||
unit_display_name = unit.type
|
||||
@@ -225,6 +231,12 @@ class GroundObjectJs(QObject):
|
||||
ll = self.theater.point_to_ll(self.tgo.position)
|
||||
return [ll.latitude, ll.longitude]
|
||||
|
||||
@Property(bool, notify=deadChanged)
|
||||
def dead(self) -> bool:
|
||||
if not self.tgo.groups:
|
||||
return all(b.is_dead for b in self.buildings)
|
||||
return not any(g.units for g in self.tgo.groups)
|
||||
|
||||
@Property(list, notify=samThreatRangesChanged)
|
||||
def samThreatRanges(self) -> List[float]:
|
||||
if not self.tgo.might_have_aa:
|
||||
|
||||
Reference in New Issue
Block a user