mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Allow player to continue playing after the end of a turn. (#3526)
This PR: Keeps track of time spent in mission Introduces a new "turnless mode" setting, which activates the following: - At the end of a mission, fast forwards through the time spent in the mission, skipping any combat (which has already been tracked through state.json) - Removes killed flights from the ATO - Does not start a new turn, instead allows the player to continue the current turn.
This commit is contained in:
@@ -50,10 +50,7 @@ class QTopPanel(QFrame):
|
||||
self.conditionsWidget = QConditionsWidget(sim_controller)
|
||||
self.budgetBox = QBudgetBox(self.game)
|
||||
|
||||
pass_turn_text = "Pass Turn"
|
||||
if not self.game or self.game.turn == 0:
|
||||
pass_turn_text = "Begin Campaign"
|
||||
self.passTurnButton = QPushButton(pass_turn_text)
|
||||
self.passTurnButton = QPushButton(self._pass_turn_button_text(self.game))
|
||||
self.passTurnButton.setIcon(CONST.ICONS["PassTurn"])
|
||||
self.passTurnButton.setProperty("style", "btn-primary")
|
||||
self.passTurnButton.clicked.connect(self.passTurn)
|
||||
@@ -120,11 +117,9 @@ class QTopPanel(QFrame):
|
||||
self.factionsInfos.setGame(game)
|
||||
|
||||
self.passTurnButton.setEnabled(True)
|
||||
if game and game.turn > 0:
|
||||
self.passTurnButton.setText("Pass Turn")
|
||||
self.passTurnButton.setText(self._pass_turn_button_text(game))
|
||||
|
||||
if game and game.turn == 0:
|
||||
self.passTurnButton.setText("Begin Campaign")
|
||||
self.proceedButton.setEnabled(False)
|
||||
else:
|
||||
self.proceedButton.setEnabled(True)
|
||||
@@ -283,3 +278,11 @@ class QTopPanel(QFrame):
|
||||
|
||||
def budget_update(self, game: Game):
|
||||
self.budgetBox.setGame(game)
|
||||
|
||||
def _pass_turn_button_text(self, game: Game) -> None:
|
||||
if game and game.turn > 0:
|
||||
if game.settings.turnless_mode:
|
||||
return "End Turn"
|
||||
else:
|
||||
return "Pass Turn"
|
||||
return "Begin campaign"
|
||||
|
||||
@@ -571,7 +571,8 @@ class QLiberationWindow(QMainWindow):
|
||||
if state is not TurnState.CONTINUE:
|
||||
GameOverDialog(won=state is TurnState.WIN, parent=self).exec()
|
||||
else:
|
||||
self.game.pass_turn()
|
||||
if not self.game.settings.turnless_mode:
|
||||
self.game.pass_turn()
|
||||
GameUpdateSignal.get_instance().updateGame(self.game)
|
||||
|
||||
def open_tgo_info_dialog(self, tgo: TheaterGroundObject) -> None:
|
||||
|
||||
Reference in New Issue
Block a user