Update the UI to show sim state.

https://github.com/dcs-liberation/dcs_liberation/issues/1704
This commit is contained in:
Dan Albert
2021-10-31 22:25:11 -07:00
parent 87bf3110c8
commit 03430a4df5
12 changed files with 188 additions and 39 deletions

View File

@@ -15,6 +15,7 @@ from PySide2.QtWebEngineWidgets import (
from game import Game
from qt_ui.models import GameModel
from qt_ui.simcontroller import SimController
from qt_ui.widgets.map.mapmodel import MapModel
@@ -35,11 +36,13 @@ class LoggingWebPage(QWebEnginePage):
class QLiberationMap(QWebEngineView):
def __init__(self, game_model: GameModel, parent) -> None:
def __init__(
self, game_model: GameModel, sim_controller: SimController, parent
) -> None:
super().__init__(parent)
self.game_model = game_model
self.setMinimumSize(800, 600)
self.map_model = MapModel(game_model)
self.map_model = MapModel(game_model, sim_controller)
self.channel = QWebChannel()
self.channel.registerObject("game", self.map_model)