mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add support for running the build react map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
This commit is contained in:
parent
3c9acea31c
commit
8165d3bd8c
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@ -50,6 +50,11 @@ jobs:
|
|||||||
cd client
|
cd client
|
||||||
npm ci
|
npm ci
|
||||||
|
|
||||||
|
- name: Build client
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
npm run build
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
./venv/scripts/activate
|
./venv/scripts/activate
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"license": "LGPL-3.0-or-later",
|
"license": "LGPL-3.0-or-later",
|
||||||
|
"homepage": ".",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reduxjs/toolkit": "^1.7.2",
|
"@reduxjs/toolkit": "^1.7.2",
|
||||||
"@testing-library/jest-dom": "^5.16.2",
|
"@testing-library/jest-dom": "^5.16.2",
|
||||||
|
|||||||
@ -11,6 +11,7 @@ analysis = Analysis(
|
|||||||
('resources', 'resources'),
|
('resources', 'resources'),
|
||||||
('resources/caucasus.p', 'dcs/terrain/'),
|
('resources/caucasus.p', 'dcs/terrain/'),
|
||||||
('resources/nevada.p', 'dcs/terrain/'),
|
('resources/nevada.p', 'dcs/terrain/'),
|
||||||
|
('client/build', 'client/build'),
|
||||||
],
|
],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
|
|||||||
@ -152,7 +152,7 @@ def run_ui(game: Optional[Game], new_map: bool, dev: bool) -> None:
|
|||||||
GameUpdateSignal.get_instance().game_loaded.connect(on_game_load)
|
GameUpdateSignal.get_instance().game_loaded.connect(on_game_load)
|
||||||
|
|
||||||
# Start window
|
# Start window
|
||||||
window = QLiberationWindow(game, new_map)
|
window = QLiberationWindow(game, new_map, dev)
|
||||||
window.showMaximized()
|
window.showMaximized()
|
||||||
splash.finish(window)
|
splash.finish(window)
|
||||||
qt_execution_code = app.exec_()
|
qt_execution_code = app.exec_()
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class LoggingWebPage(QWebEnginePage):
|
|||||||
|
|
||||||
|
|
||||||
class QLiberationMap(QWebEngineView):
|
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)
|
super().__init__(parent)
|
||||||
self.game_model = game_model
|
self.game_model = game_model
|
||||||
self.setMinimumSize(800, 600)
|
self.setMinimumSize(800, 600)
|
||||||
@ -53,8 +53,10 @@ class QLiberationMap(QWebEngineView):
|
|||||||
)
|
)
|
||||||
self.page.setWebChannel(self.channel)
|
self.page.setWebChannel(self.channel)
|
||||||
|
|
||||||
if new_map:
|
if new_map and dev:
|
||||||
url = QUrl("http://localhost:3000")
|
url = QUrl("http://localhost:3000")
|
||||||
|
elif new_map:
|
||||||
|
url = QUrl.fromLocalFile(str(Path("client/build/index.html").resolve()))
|
||||||
else:
|
else:
|
||||||
url = QUrl.fromLocalFile(
|
url = QUrl.fromLocalFile(
|
||||||
str(Path("resources/ui/map/canvas.html").resolve())
|
str(Path("resources/ui/map/canvas.html").resolve())
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class QLiberationWindow(QMainWindow):
|
|||||||
tgo_info_signal = Signal(TheaterGroundObject)
|
tgo_info_signal = Signal(TheaterGroundObject)
|
||||||
control_point_info_signal = Signal(ControlPoint)
|
control_point_info_signal = Signal(ControlPoint)
|
||||||
|
|
||||||
def __init__(self, game: Optional[Game], new_map: bool) -> None:
|
def __init__(self, game: Optional[Game], new_map: bool, dev: bool) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self._uncaught_exception_handler = UncaughtExceptionHandler(self)
|
self._uncaught_exception_handler = UncaughtExceptionHandler(self)
|
||||||
@ -79,7 +79,7 @@ class QLiberationWindow(QMainWindow):
|
|||||||
Dialog.set_game(self.game_model)
|
Dialog.set_game(self.game_model)
|
||||||
self.ato_panel = QAirTaskingOrderPanel(self.game_model)
|
self.ato_panel = QAirTaskingOrderPanel(self.game_model)
|
||||||
self.info_panel = QInfoPanel(self.game)
|
self.info_panel = QInfoPanel(self.game)
|
||||||
self.liberation_map = QLiberationMap(self.game_model, new_map, self)
|
self.liberation_map = QLiberationMap(self.game_model, new_map, dev, self)
|
||||||
|
|
||||||
self.setGeometry(300, 100, 270, 100)
|
self.setGeometry(300, 100, 270, 100)
|
||||||
self.updateWindowTitle()
|
self.updateWindowTitle()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user