From 17352bfcf70b20b79bc9d68c570759d0caef4e46 Mon Sep 17 00:00:00 2001 From: Khopa Date: Sun, 6 Oct 2019 01:02:49 +0200 Subject: [PATCH] Fix : Not possible anymore to start a mission by clicking the PendingDelivery event icon. --- qt_ui/widgets/map/QMapEvent.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qt_ui/widgets/map/QMapEvent.py b/qt_ui/widgets/map/QMapEvent.py index e1663926..13570bdf 100644 --- a/qt_ui/widgets/map/QMapEvent.py +++ b/qt_ui/widgets/map/QMapEvent.py @@ -2,9 +2,8 @@ from PySide2.QtGui import QPen, Qt from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsSceneMouseEvent, QGraphicsSceneHoverEvent import qt_ui.uiconstants as CONST -from game.event import Event +from game.event import Event, UnitsDeliveryEvent from qt_ui.windows.QBriefingWindow import QBriefingWindow -from theater import TheaterGroundObject, ControlPoint class QMapEvent(QGraphicsRectItem): @@ -16,6 +15,7 @@ class QMapEvent(QGraphicsRectItem): self.setAcceptHoverEvents(True) self.setZValue(2) self.setToolTip(str(self.gameEvent)) + self.playable = not isinstance(self.gameEvent, UnitsDeliveryEvent) def paint(self, painter, option, widget=None): @@ -29,7 +29,7 @@ class QMapEvent(QGraphicsRectItem): painter.setPen(QPen(brush=CONST.COLORS["red"])) painter.setBrush(CONST.COLORS["red"]) - if self.isUnderMouse(): + if self.isUnderMouse() and self.playable: painter.setBrush(CONST.COLORS["white"]) painter.drawRect(option.rect) @@ -42,8 +42,10 @@ class QMapEvent(QGraphicsRectItem): def hoverEnterEvent(self, event: QGraphicsSceneHoverEvent): self.update() - self.setCursor(Qt.PointingHandCursor) + if self.playable: + self.setCursor(Qt.PointingHandCursor) def openBriefing(self): - self.briefing = QBriefingWindow(self.gameEvent) - self.briefing.show() \ No newline at end of file + if self.playable: + self.briefing = QBriefingWindow(self.gameEvent) + self.briefing.show() \ No newline at end of file