mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add a basic React implementation of the map.
See client/README.md for instructions.
This commit is contained in:
@@ -36,7 +36,7 @@ class LoggingWebPage(QWebEnginePage):
|
||||
|
||||
|
||||
class QLiberationMap(QWebEngineView):
|
||||
def __init__(self, game_model: GameModel, parent) -> None:
|
||||
def __init__(self, game_model: GameModel, new_map: bool, parent) -> None:
|
||||
super().__init__(parent)
|
||||
self.game_model = game_model
|
||||
self.setMinimumSize(800, 600)
|
||||
@@ -52,9 +52,14 @@ class QLiberationMap(QWebEngineView):
|
||||
QWebEngineSettings.LocalContentCanAccessRemoteUrls, True
|
||||
)
|
||||
self.page.setWebChannel(self.channel)
|
||||
self.page.load(
|
||||
QUrl.fromLocalFile(str(Path("resources/ui/map/canvas.html").resolve()))
|
||||
)
|
||||
|
||||
if new_map:
|
||||
url = QUrl("http://localhost:3000")
|
||||
else:
|
||||
url = QUrl.fromLocalFile(
|
||||
str(Path("resources/ui/map/canvas.html").resolve())
|
||||
)
|
||||
self.page.load(url)
|
||||
self.setPage(self.page)
|
||||
|
||||
def set_game(self, game: Optional[Game]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user