Include control point name in ground object info.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/498
This commit is contained in:
Chris Seagraves 2021-06-26 13:24:12 -05:00 committed by GitHub
parent d2df795ba7
commit ffcae66f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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 :")

View File

@ -570,7 +570,7 @@ class TheaterGroundObject {
}
L.marker(this.tgo.position, { icon: this.icon() })
.bindTooltip(`${this.tgo.name}<br />${this.tgo.units.join("<br />")}`)
.bindTooltip(`${this.tgo.name} (${this.tgo.controlPointName})<br />${this.tgo.units.join("<br />")}`)
.on("click", () => this.tgo.showInfoDialog())
.on("contextmenu", () => this.tgo.showPackageDialog())
.addTo(this.layer());