From a81b4ffd0598befa1f7b709b58d481e4c3ea2a4d Mon Sep 17 00:00:00 2001 From: Raffson Date: Sun, 25 Sep 2022 20:12:37 +0200 Subject: [PATCH] New performance option: disable convoys Co-Authored-By: MetalStormGhost <89945461+MetalStormGhost@users.noreply.github.com> --- changelog.md | 1 + game/missiongenerator/convoygenerator.py | 7 ++++--- game/settings/settings.py | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index c2fafc46..2722800c 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ * **[Modding]** Support for Su-30 mod version 2.01B * **[UI]** Add livery selector to Air Wing Configurator's squadrons. * **[Performance]** Added performance option: Maximum front-line unit supply per control point. +* **[Performance]** Added performance option: Disable convoys. # Liberation: diff --git a/game/missiongenerator/convoygenerator.py b/game/missiongenerator/convoygenerator.py index a1fe60b7..2f30586d 100644 --- a/game/missiongenerator/convoygenerator.py +++ b/game/missiongenerator/convoygenerator.py @@ -27,9 +27,10 @@ class ConvoyGenerator: def generate(self) -> None: # Reset the count to make generation deterministic. - for coalition in self.game.coalitions: - for convoy in coalition.transfers.convoys: - self.generate_convoy(convoy) + if not self.game.settings.perf_disable_convoys: + for coalition in self.game.coalitions: + for convoy in coalition.transfers.convoys: + self.generate_convoy(convoy) def generate_convoy(self, convoy: Convoy) -> VehicleGroup: group = self._create_mixed_unit_group( diff --git a/game/settings/settings.py b/game/settings/settings.py index cc6fab5f..eda484fd 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -443,18 +443,18 @@ class Settings: section=PERFORMANCE_SECTION, default=True, ) - # perf_disable_convoys: bool = boolean_option( - # "Disable convoys", - # page=MISSION_GENERATOR_PAGE, - # section=PERFORMANCE_SECTION, - # default=False, - # ) # perf_frontline_units_prefer_roads: bool = boolean_option( # "Front line troops prefer roads", # page=MISSION_GENERATOR_PAGE, # section=PERFORMANCE_SECTION, # default=False, # ) + perf_disable_convoys: bool = boolean_option( + "Disable convoys", + page=MISSION_GENERATOR_PAGE, + section=PERFORMANCE_SECTION, + default=False, + ) perf_frontline_units_max_supply: int = bounded_int_option( "Maximum frontline unit supply per control point", page=MISSION_GENERATOR_PAGE,