From 0bfd766a0b456ad8741dfffcecf79bce0616cacb Mon Sep 17 00:00:00 2001 From: Simon Clark Date: Thu, 7 Jan 2021 23:04:33 +0000 Subject: [PATCH] Make the base capture cheat also toggleable. Also changelog. --- changelog.md | 3 ++- game/settings.py | 1 + qt_ui/widgets/map/QMapControlPoint.py | 2 +- qt_ui/windows/settings/QSettingsWindow.py | 15 +++++++++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 215d0746..f92a6df2 100644 --- a/changelog.md +++ b/changelog.md @@ -12,7 +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]** 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. -* **[Cheat Menu]** Added ability to toggle frontline advance/retreat cheats. +* **[Cheat Menu]** Added ability to toggle base capture and frontline advance/retreat cheats. * **[Skynet]** Updated to 2.0.1. * **[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. @@ -34,6 +34,7 @@ Saves from 2.3 are not compatible with 2.4. * **[Economy]** Pending unit orders at captured bases will be refunded. * **[UI]** Carrier group SAM threat rings now move with the carrier. +* **[UI]** Base intel menu no longer compresses text, and is now scrollable. * **[Units]** J-11A is no longer spawned with empty loadout. * **[Units]** F-14B is no longer spawned with empty loadout for fighter sweep tasks. * **[Units]** Pyotr Velikiy cruiser has been removed for now as it's nearly unkillable. diff --git a/game/settings.py b/game/settings.py index 565eae80..a7253f25 100644 --- a/game/settings.py +++ b/game/settings.py @@ -50,6 +50,7 @@ class Settings: # Cheating show_red_ato: bool = False enable_frontline_cheats: bool = False + enable_base_capture_cheat: bool = False never_delay_player_flights: bool = False diff --git a/qt_ui/widgets/map/QMapControlPoint.py b/qt_ui/widgets/map/QMapControlPoint.py index e8607ff3..035db95e 100644 --- a/qt_ui/widgets/map/QMapControlPoint.py +++ b/qt_ui/widgets/map/QMapControlPoint.py @@ -89,7 +89,7 @@ class QMapControlPoint(QMapObject): return for connected in self.control_point.connected_points: - if connected.captured: + if connected.captured and self.game_model.game.settings.enable_base_capture_cheat: menu.addAction(self.capture_action) break diff --git a/qt_ui/windows/settings/QSettingsWindow.py b/qt_ui/windows/settings/QSettingsWindow.py index 4cf426a3..d372214b 100644 --- a/qt_ui/windows/settings/QSettingsWindow.py +++ b/qt_ui/windows/settings/QSettingsWindow.py @@ -44,10 +44,16 @@ class CheatSettingsBox(QGroupBox): self.frontline_cheat_checkbox.setChecked(game.settings.enable_frontline_cheats) self.frontline_cheat_checkbox.toggled.connect(apply_settings) + self.base_capture_cheat_checkbox = QCheckBox() + self.base_capture_cheat_checkbox.setChecked(game.settings.enable_base_capture_cheat) + self.base_capture_cheat_checkbox.toggled.connect(apply_settings) + 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) + self.main_layout.addLayout(self.frontline_cheat) + self.base_capture_cheat = QLabeledWidget("Enable Base Capture Cheat:", self.base_capture_cheat_checkbox) + self.main_layout.addLayout(self.base_capture_cheat) @property def show_red_ato(self) -> bool: @@ -57,6 +63,10 @@ class CheatSettingsBox(QGroupBox): def show_frontline_cheat(self) -> bool: return self.frontline_cheat_checkbox.isChecked() + @property + def show_base_capture_cheat(self) -> bool: + return self.base_capture_cheat_checkbox.isChecked() + class QSettingsWindow(QDialog): @@ -503,6 +513,7 @@ class QSettingsWindow(QDialog): 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.settings.enable_base_capture_cheat = self.cheat_options.show_base_capture_cheat self.game.compute_conflicts_position() GameUpdateSignal.get_instance().updateGame(self.game)