Add cheat option to capture bases.

Capturing bases is sometimes really annoying because of the DCS unit
AI and our non-optimal ground victory heuristics. Add a cheat option
to allow the player to move on without the tedium.
This commit is contained in:
Dan Albert
2020-10-24 13:06:37 -07:00
parent dd2b61edf3
commit bfc602f22f
6 changed files with 76 additions and 21 deletions

View File

@@ -37,6 +37,9 @@ class QMapObject(QGraphicsRectItem):
if event.button() == Qt.LeftButton:
self.on_click()
def add_context_menu_actions(self, menu: QMenu) -> None:
pass
def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent) -> None:
menu = QMenu("Menu", self.parent)
@@ -48,6 +51,8 @@ class QMapObject(QGraphicsRectItem):
new_package_action.triggered.connect(self.open_new_package_dialog)
menu.addAction(new_package_action)
self.add_context_menu_actions(menu)
menu.exec_(event.screenPos())
@property