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:
zhexu14
2025-10-16 23:51:27 +11:00
committed by GitHub
parent 5676c40788
commit d09a15a7f3
10 changed files with 136 additions and 25 deletions

View File

@@ -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"

View File

@@ -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: