mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Set up split/join points.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtWidgets import QFrame, QGroupBox, QHBoxLayout, QPushButton
|
||||
|
||||
import qt_ui.uiconstants as CONST
|
||||
@@ -74,7 +76,7 @@ class QTopPanel(QFrame):
|
||||
self.layout.setContentsMargins(0,0,0,0)
|
||||
self.setLayout(self.layout)
|
||||
|
||||
def setGame(self, game:Game):
|
||||
def setGame(self, game: Optional[Game]):
|
||||
self.game = game
|
||||
if game is not None:
|
||||
self.turnCounter.setCurrentTurn(self.game.turn, self.game.current_day)
|
||||
|
||||
@@ -123,7 +123,7 @@ class QFlightPanel(QGroupBox):
|
||||
return
|
||||
from qt_ui.dialogs import Dialog
|
||||
Dialog.open_edit_flight_dialog(
|
||||
self.package_model.flight_at_index(index)
|
||||
self.package_model, self.package_model.flight_at_index(index)
|
||||
)
|
||||
|
||||
def on_delete(self) -> None:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Dict, List, Tuple
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
from PySide2.QtCore import Qt
|
||||
from PySide2.QtGui import QBrush, QColor, QPen, QPixmap, QWheelEvent
|
||||
@@ -43,6 +43,7 @@ class QLiberationMap(QGraphicsView):
|
||||
super(QLiberationMap, self).__init__()
|
||||
QLiberationMap.instance = self
|
||||
self.game_model = game_model
|
||||
self.game: Optional[Game] = game_model.game
|
||||
|
||||
self.flight_path_items: List[QGraphicsItem] = []
|
||||
|
||||
@@ -71,7 +72,7 @@ class QLiberationMap(QGraphicsView):
|
||||
def connectSignals(self):
|
||||
GameUpdateSignal.get_instance().gameupdated.connect(self.setGame)
|
||||
|
||||
def setGame(self, game: Game):
|
||||
def setGame(self, game: Optional[Game]):
|
||||
self.game = game
|
||||
print("Reloading Map Canvas")
|
||||
if self.game is not None:
|
||||
|
||||
Reference in New Issue
Block a user