mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Hide sim speed controls behind a flag.
Flag is only controlled from the command-line because redoing Qt layout usually breaks things. Off by default in 6 since this feature is nowhere near done enough to even be used experimentally (most changes to the ATO made after the sim begins will break the game). Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2535.
This commit is contained in:
@@ -31,6 +31,7 @@ from qt_ui.dialogs import Dialog
|
||||
from qt_ui.models import GameModel
|
||||
from qt_ui.simcontroller import SimController
|
||||
from qt_ui.uiconstants import URLS
|
||||
from qt_ui.uiflags import UiFlags
|
||||
from qt_ui.uncaughtexceptionhandler import UncaughtExceptionHandler
|
||||
from qt_ui.widgets.QTopPanel import QTopPanel
|
||||
from qt_ui.widgets.ato import QAirTaskingOrderPanel
|
||||
@@ -55,7 +56,7 @@ class QLiberationWindow(QMainWindow):
|
||||
tgo_info_signal = Signal(TheaterGroundObject)
|
||||
control_point_info_signal = Signal(ControlPoint)
|
||||
|
||||
def __init__(self, game: Game | None, dev: bool) -> None:
|
||||
def __init__(self, game: Game | None, ui_flags: UiFlags) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._uncaught_exception_handler = UncaughtExceptionHandler(self)
|
||||
@@ -80,14 +81,16 @@ class QLiberationWindow(QMainWindow):
|
||||
Dialog.set_game(self.game_model)
|
||||
self.ato_panel = QAirTaskingOrderPanel(self.game_model)
|
||||
self.info_panel = QInfoPanel(self.game)
|
||||
self.liberation_map = QLiberationMap(self.game_model, dev, self)
|
||||
self.liberation_map = QLiberationMap(
|
||||
self.game_model, ui_flags.dev_ui_webserver, self
|
||||
)
|
||||
|
||||
self.setGeometry(300, 100, 270, 100)
|
||||
self.updateWindowTitle()
|
||||
self.setWindowIcon(QIcon("./resources/icon.png"))
|
||||
self.statusBar().showMessage("Ready")
|
||||
|
||||
self.initUi()
|
||||
self.initUi(ui_flags)
|
||||
self.initActions()
|
||||
self.initToolbar()
|
||||
self.initMenuBar()
|
||||
@@ -118,7 +121,7 @@ class QLiberationWindow(QMainWindow):
|
||||
else:
|
||||
self.onGameGenerated(self.game)
|
||||
|
||||
def initUi(self):
|
||||
def initUi(self, ui_flags: UiFlags) -> None:
|
||||
hbox = QSplitter(Qt.Horizontal)
|
||||
vbox = QSplitter(Qt.Vertical)
|
||||
hbox.addWidget(self.ato_panel)
|
||||
@@ -131,7 +134,7 @@ class QLiberationWindow(QMainWindow):
|
||||
hbox.setSizes([1, 10000000])
|
||||
vbox.setSizes([600, 100])
|
||||
|
||||
self.top_panel = QTopPanel(self.game_model, self.sim_controller)
|
||||
self.top_panel = QTopPanel(self.game_model, self.sim_controller, ui_flags)
|
||||
vbox = QVBoxLayout()
|
||||
vbox.setMargin(0)
|
||||
vbox.addWidget(self.top_panel)
|
||||
|
||||
Reference in New Issue
Block a user