diff --git a/changelog.md b/changelog.md index 03c9ad54..706ce07b 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ * **[Plugins]** Improvements to AI support for EW Script 2.0 * **[Config]** New preference setting to trigger the first-start window on every start (could help in scenarios multiple Retribution instances need to run concurrently) * **[Modding]** Update Grinelli Designs F-22A Mod to 2.0.0 (May 2025) +* **[Options]** New option to control EPLRS-task injection in mission generator ## Fixes * **[Flight Plans]** Fixed a bug when a package was created with only escort flights diff --git a/game/missiongenerator/aircraft/aircraftbehavior.py b/game/missiongenerator/aircraft/aircraftbehavior.py index 6329998d..e342b324 100644 --- a/game/missiongenerator/aircraft/aircraftbehavior.py +++ b/game/missiongenerator/aircraft/aircraftbehavior.py @@ -192,7 +192,8 @@ class AircraftBehavior: @staticmethod def configure_eplrs(group: FlyingGroup[Any], flight: Flight) -> None: - if flight.unit_type.eplrs_capable: + eplrs_enabled = flight.coalition.game.settings.eplrs_enabled + if eplrs_enabled and flight.unit_type.eplrs_capable: group.points[0].tasks.append(EPLRS(group.id)) def configure_cap(self, group: FlyingGroup[Any], flight: Flight) -> None: diff --git a/game/missiongenerator/tgogenerator.py b/game/missiongenerator/tgogenerator.py index c5750e1b..1ce0ee36 100644 --- a/game/missiongenerator/tgogenerator.py +++ b/game/missiongenerator/tgogenerator.py @@ -386,9 +386,9 @@ class GroundObjectGenerator: ) self._register_theater_unit(unit, static_group.units[0]) - @staticmethod - def enable_eplrs(group: VehicleGroup, unit_type: Type[VehicleType]) -> None: - if unit_type.eplrs: + def enable_eplrs(self, group: VehicleGroup, unit_type: Type[VehicleType]) -> None: + eplrs_enabled = self.game.settings.eplrs_enabled + if eplrs_enabled and unit_type.eplrs: group.points[0].tasks.append(EPLRS(group.id)) def set_alarm_state(self, group: MovingGroup[Any]) -> None: diff --git a/game/settings/settings.py b/game/settings/settings.py index cfc231e4..fa59a92c 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -816,6 +816,12 @@ class Settings: GAMEPLAY_SECTION, default=True, ) + eplrs_enabled: bool = boolean_option( + "Enable EPLRS", + MISSION_GENERATOR_PAGE, + GAMEPLAY_SECTION, + default=True, + ) generate_dark_kneeboard: bool = boolean_option( "Generate dark kneeboard", MISSION_GENERATOR_PAGE,