Debriefing and info on AA site and buildings destroyed. KC130 replace S3B

This commit is contained in:
Khopa
2020-06-06 04:10:22 +02:00
parent aa4b07d024
commit fcd81850cb
28 changed files with 195 additions and 83 deletions

View File

@@ -9,13 +9,14 @@ from theater import TheaterGroundObject, ControlPoint
class QMapGroundObject(QGraphicsRectItem):
def __init__(self, parent, x: float, y: float, w: float, h: float, cp: ControlPoint, model: TheaterGroundObject):
def __init__(self, parent, x: float, y: float, w: float, h: float, cp: ControlPoint, model: TheaterGroundObject, buildings=[]):
super(QMapGroundObject, self).__init__(x, y, w, h)
self.model = model
self.cp = cp
self.parent = parent
self.setAcceptHoverEvents(True)
self.setZValue(2)
self.buildings = buildings
#self.setFlag(QGraphicsItem.ItemIgnoresTransformations, True)
if len(self.model.groups) > 0:
@@ -32,7 +33,11 @@ class QMapGroundObject(QGraphicsRectItem):
tooltip = tooltip + str(unit) + "x" + str(units[unit]) + "\n"
self.setToolTip(tooltip[:-1])
else:
self.setToolTip("[" + self.model.obj_name + "] : " + self.model.category)
tooltip = "[" + self.model.obj_name + "]" + "\n"
for building in buildings:
if not building.is_dead:
tooltip = tooltip + str(building.dcs_identifier) + "\n"
self.setToolTip(tooltip[:-1])
def paint(self, painter, option, widget=None):