mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix : Not possible anymore to start a mission by clicking the PendingDelivery event icon.
This commit is contained in:
parent
d4577aa7a6
commit
17352bfcf7
@ -2,9 +2,8 @@ from PySide2.QtGui import QPen, Qt
|
|||||||
from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsSceneMouseEvent, QGraphicsSceneHoverEvent
|
from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsSceneMouseEvent, QGraphicsSceneHoverEvent
|
||||||
|
|
||||||
import qt_ui.uiconstants as CONST
|
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 qt_ui.windows.QBriefingWindow import QBriefingWindow
|
||||||
from theater import TheaterGroundObject, ControlPoint
|
|
||||||
|
|
||||||
|
|
||||||
class QMapEvent(QGraphicsRectItem):
|
class QMapEvent(QGraphicsRectItem):
|
||||||
@ -16,6 +15,7 @@ class QMapEvent(QGraphicsRectItem):
|
|||||||
self.setAcceptHoverEvents(True)
|
self.setAcceptHoverEvents(True)
|
||||||
self.setZValue(2)
|
self.setZValue(2)
|
||||||
self.setToolTip(str(self.gameEvent))
|
self.setToolTip(str(self.gameEvent))
|
||||||
|
self.playable = not isinstance(self.gameEvent, UnitsDeliveryEvent)
|
||||||
|
|
||||||
def paint(self, painter, option, widget=None):
|
def paint(self, painter, option, widget=None):
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ class QMapEvent(QGraphicsRectItem):
|
|||||||
painter.setPen(QPen(brush=CONST.COLORS["red"]))
|
painter.setPen(QPen(brush=CONST.COLORS["red"]))
|
||||||
painter.setBrush(CONST.COLORS["red"])
|
painter.setBrush(CONST.COLORS["red"])
|
||||||
|
|
||||||
if self.isUnderMouse():
|
if self.isUnderMouse() and self.playable:
|
||||||
painter.setBrush(CONST.COLORS["white"])
|
painter.setBrush(CONST.COLORS["white"])
|
||||||
|
|
||||||
painter.drawRect(option.rect)
|
painter.drawRect(option.rect)
|
||||||
@ -42,8 +42,10 @@ class QMapEvent(QGraphicsRectItem):
|
|||||||
|
|
||||||
def hoverEnterEvent(self, event: QGraphicsSceneHoverEvent):
|
def hoverEnterEvent(self, event: QGraphicsSceneHoverEvent):
|
||||||
self.update()
|
self.update()
|
||||||
self.setCursor(Qt.PointingHandCursor)
|
if self.playable:
|
||||||
|
self.setCursor(Qt.PointingHandCursor)
|
||||||
|
|
||||||
def openBriefing(self):
|
def openBriefing(self):
|
||||||
self.briefing = QBriefingWindow(self.gameEvent)
|
if self.playable:
|
||||||
self.briefing.show()
|
self.briefing = QBriefingWindow(self.gameEvent)
|
||||||
|
self.briefing.show()
|
||||||
Loading…
x
Reference in New Issue
Block a user