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:
Dan Albert
2022-11-19 15:47:22 -08:00
committed by Raffson
parent 219b52fc12
commit cbc124eff6
4 changed files with 48 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ from game.profiling import logged_duration
from game.utils import meters
from qt_ui.models import GameModel
from qt_ui.simcontroller import SimController
from qt_ui.uiflags import UiFlags
from qt_ui.widgets.QBudgetBox import QBudgetBox
from qt_ui.widgets.QConditionsWidget import QConditionsWidget
from qt_ui.widgets.QFactionsInfos import QFactionsInfos
@@ -30,7 +31,9 @@ from qt_ui.windows.QWaitingForMissionResultWindow import QWaitingForMissionResul
class QTopPanel(QFrame):
def __init__(self, game_model: GameModel, sim_controller: SimController) -> None:
def __init__(
self, game_model: GameModel, sim_controller: SimController, ui_flags: UiFlags
) -> None:
super(QTopPanel, self).__init__()
self.game_model = game_model
self.sim_controller = sim_controller
@@ -82,7 +85,8 @@ class QTopPanel(QFrame):
self.proceedBox = QGroupBox("Proceed")
self.proceedBoxLayout = QHBoxLayout()
self.proceedBoxLayout.addLayout(self.simSpeedControls)
if ui_flags.show_sim_speed_controls:
self.proceedBoxLayout.addLayout(self.simSpeedControls)
self.proceedBoxLayout.addLayout(MaxPlayerCount(self.game_model.ato_model))
self.proceedBoxLayout.addWidget(self.passTurnButton)
self.proceedBoxLayout.addWidget(self.proceedButton)