Add support for running the build react map.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
This commit is contained in:
Dan Albert
2022-03-06 00:47:40 -08:00
parent 3c9acea31c
commit 8165d3bd8c
6 changed files with 14 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ class LoggingWebPage(QWebEnginePage):
class QLiberationMap(QWebEngineView):
def __init__(self, game_model: GameModel, new_map: bool, parent) -> None:
def __init__(self, game_model: GameModel, new_map: bool, dev: bool, parent) -> None:
super().__init__(parent)
self.game_model = game_model
self.setMinimumSize(800, 600)
@@ -53,8 +53,10 @@ class QLiberationMap(QWebEngineView):
)
self.page.setWebChannel(self.channel)
if new_map:
if new_map and dev:
url = QUrl("http://localhost:3000")
elif new_map:
url = QUrl.fromLocalFile(str(Path("client/build/index.html").resolve()))
else:
url = QUrl.fromLocalFile(
str(Path("resources/ui/map/canvas.html").resolve())