From ffcae66f59d41bd9672fce639fab3eea1781313c Mon Sep 17 00:00:00 2001 From: Chris Seagraves <47610393+nosv1@users.noreply.github.com> Date: Sat, 26 Jun 2021 13:24:12 -0500 Subject: [PATCH] Include control point name in ground object info. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/498 --- qt_ui/widgets/map/mapmodel.py | 5 +++++ qt_ui/windows/groundobject/QGroundObjectMenu.py | 4 +++- resources/ui/map/map.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qt_ui/widgets/map/mapmodel.py b/qt_ui/widgets/map/mapmodel.py index 969726fc..3d56b5d8 100644 --- a/qt_ui/widgets/map/mapmodel.py +++ b/qt_ui/widgets/map/mapmodel.py @@ -178,6 +178,7 @@ class ControlPointJs(QObject): class GroundObjectJs(QObject): nameChanged = Signal() + controlPointNameChanged = Signal() unitsChanged = Signal() blueChanged = Signal() positionChanged = Signal() @@ -214,6 +215,10 @@ class GroundObjectJs(QObject): def name(self) -> str: return self.tgo.name + @Property(str, notify=controlPointNameChanged) + def controlPointName(self) -> str: + return self.tgo.control_point.name + @Property(str, notify=categoryChanged) def category(self) -> str: return self.tgo.category diff --git a/qt_ui/windows/groundobject/QGroundObjectMenu.py b/qt_ui/windows/groundobject/QGroundObjectMenu.py index b04750ee..96debe14 100644 --- a/qt_ui/windows/groundobject/QGroundObjectMenu.py +++ b/qt_ui/windows/groundobject/QGroundObjectMenu.py @@ -56,7 +56,9 @@ class QGroundObjectMenu(QDialog): self.buildings = buildings self.cp = cp self.game = game - self.setWindowTitle("Location " + self.ground_object.obj_name) + self.setWindowTitle( + f"Location - {self.ground_object.obj_name} ({self.cp.name})" + ) self.setWindowIcon(EVENT_ICONS["capture"]) self.intelBox = QGroupBox("Units :") self.buildingBox = QGroupBox("Buildings :") diff --git a/resources/ui/map/map.js b/resources/ui/map/map.js index 9999231a..141fe2ef 100644 --- a/resources/ui/map/map.js +++ b/resources/ui/map/map.js @@ -570,7 +570,7 @@ class TheaterGroundObject { } L.marker(this.tgo.position, { icon: this.icon() }) - .bindTooltip(`${this.tgo.name}
${this.tgo.units.join("
")}`) + .bindTooltip(`${this.tgo.name} (${this.tgo.controlPointName})
${this.tgo.units.join("
")}`) .on("click", () => this.tgo.showInfoDialog()) .on("contextmenu", () => this.tgo.showPackageDialog()) .addTo(this.layer());