Using a singleton QObject to propagate game model update across whole app

This commit is contained in:
Khopa
2019-07-05 21:43:14 +02:00
parent 8246c8e94b
commit 9a73c78705
8 changed files with 52 additions and 16 deletions

View File

@@ -48,11 +48,13 @@ class QMapControlPoint(QGraphicsRectItem):
self.update()
def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent):
# TODO : improve this and add contextual actions (just a placholder for now)
menu = QMenu("Menu", self.parent)
menu.addAction("Plan a strike on " + self.model.name + " airbase")
menu.addAction("See available intel")
menu.exec_(event.screenPos())
@property
def brush_color(self)->QColor:
if self.parent.game.player_country == "USA":