Make frontline advance/retreat cheats optional.

This can now be toggled on and off in the cheats menu.
This commit is contained in:
Simon Clark 2021-01-07 17:46:06 +00:00
parent fdb4a7b055
commit 591c62b6d5
4 changed files with 23 additions and 8 deletions

View File

@ -12,6 +12,7 @@ Saves from 2.3 are not compatible with 2.4.
* **[Campaign AI]** Reserve aircraft will be ordered if needed to prioritize next turn's CAP/CAS over offensive missions. * **[Campaign AI]** Reserve aircraft will be ordered if needed to prioritize next turn's CAP/CAS over offensive missions.
* **[Campaign AI]** Multiple rounds of CAP will be planned (roughly 90 minutes of coverage). Default starting budget has increased to account for the increased need for aircraft. * **[Campaign AI]** Multiple rounds of CAP will be planned (roughly 90 minutes of coverage). Default starting budget has increased to account for the increased need for aircraft.
* **[Mission Generator]** Multiple groups are created for complex SAM sites (SAMs with additional point defense or SHORADS), improving Skynet behavior. * **[Mission Generator]** Multiple groups are created for complex SAM sites (SAMs with additional point defense or SHORADS), improving Skynet behavior.
* **[Cheat Menu]** Added ability to toggle frontline advance/retreat cheats.
* **[Skynet]** Updated to 2.0.1. * **[Skynet]** Updated to 2.0.1.
* **[Skynet]** Point defenses are now configured to remain on to protect the site they accompany. * **[Skynet]** Point defenses are now configured to remain on to protect the site they accompany.
* **[Balance]** Opfor now gains income using the same rules as the player, significantly increasing their income relative to the player for most campaigns. * **[Balance]** Opfor now gains income using the same rules as the player, significantly increasing their income relative to the player for most campaigns.

View File

@ -49,6 +49,7 @@ class Settings:
# Cheating # Cheating
show_red_ato: bool = False show_red_ato: bool = False
enable_frontline_cheats: bool = False
never_delay_player_flights: bool = False never_delay_player_flights: bool = False

View File

@ -58,13 +58,14 @@ class QFrontLine(QGraphicsLineItem):
new_package_action.triggered.connect(self.open_new_package_dialog) new_package_action.triggered.connect(self.open_new_package_dialog)
menu.addAction(new_package_action) menu.addAction(new_package_action)
cheat_forward = QAction(f"CHEAT: Advance Frontline") if self.game_model.game.settings.enable_frontline_cheats:
cheat_forward.triggered.connect(self.cheat_forward) cheat_forward = QAction(f"CHEAT: Advance Frontline")
menu.addAction(cheat_forward) cheat_forward.triggered.connect(self.cheat_forward)
menu.addAction(cheat_forward)
cheat_backward = QAction(f"CHEAT: Retreat Frontline") cheat_backward = QAction(f"CHEAT: Retreat Frontline")
cheat_backward.triggered.connect(self.cheat_backward) cheat_backward.triggered.connect(self.cheat_backward)
menu.addAction(cheat_backward) menu.addAction(cheat_backward)
menu.exec_(event.screenPos()) menu.exec_(event.screenPos())

View File

@ -39,13 +39,24 @@ class CheatSettingsBox(QGroupBox):
self.red_ato_checkbox = QCheckBox() self.red_ato_checkbox = QCheckBox()
self.red_ato_checkbox.setChecked(game.settings.show_red_ato) self.red_ato_checkbox.setChecked(game.settings.show_red_ato)
self.red_ato_checkbox.toggled.connect(apply_settings) self.red_ato_checkbox.toggled.connect(apply_settings)
self.frontline_cheat_checkbox = QCheckBox()
self.frontline_cheat_checkbox.setChecked(game.settings.enable_frontline_cheats)
self.frontline_cheat_checkbox.toggled.connect(apply_settings)
self.red_ato = QLabeledWidget("Show Red ATO:", self.red_ato_checkbox) self.red_ato = QLabeledWidget("Show Red ATO:", self.red_ato_checkbox)
self.main_layout.addLayout(self.red_ato) self.main_layout.addLayout(self.red_ato)
self.frontline_cheat = QLabeledWidget("Enable Frontline Cheats:", self.frontline_cheat_checkbox)
self.main_layout.addLayout(self.frontline_cheat)
@property @property
def show_red_ato(self) -> bool: def show_red_ato(self) -> bool:
return self.red_ato_checkbox.isChecked() return self.red_ato_checkbox.isChecked()
@property
def show_frontline_cheat(self) -> bool:
return self.frontline_cheat_checkbox.isChecked()
class QSettingsWindow(QDialog): class QSettingsWindow(QDialog):
@ -447,7 +458,7 @@ class QSettingsWindow(QDialog):
btn = QPushButton("Cheat " + str(amount) + "M") btn = QPushButton("Cheat " + str(amount) + "M")
btn.setProperty("style", "btn-danger") btn.setProperty("style", "btn-danger")
btn.clicked.connect(self.cheatLambda(amount)) btn.clicked.connect(self.cheatLambda(amount))
self.moneyCheatBoxLayout.addWidget(btn, i/2, i%2) self.moneyCheatBoxLayout.addWidget(btn, i/2, i%2)
self.cheatLayout.addWidget(self.moneyCheatBox, stretch=1) self.cheatLayout.addWidget(self.moneyCheatBox, stretch=1)
def cheatLambda(self, amount): def cheatLambda(self, amount):
@ -491,6 +502,7 @@ class QSettingsWindow(QDialog):
self.game.settings.perf_do_not_cull_carrier = self.culling_do_not_cull_carrier.isChecked() self.game.settings.perf_do_not_cull_carrier = self.culling_do_not_cull_carrier.isChecked()
self.game.settings.show_red_ato = self.cheat_options.show_red_ato self.game.settings.show_red_ato = self.cheat_options.show_red_ato
self.game.settings.enable_frontline_cheats = self.cheat_options.show_frontline_cheat
self.game.compute_conflicts_position() self.game.compute_conflicts_position()
GameUpdateSignal.get_instance().updateGame(self.game) GameUpdateSignal.get_instance().updateGame(self.game)