mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Support for auto-fog
implemented as a setting...
This commit is contained in:
parent
3ef6ae20c7
commit
d1b484f560
@ -12,11 +12,12 @@ from game.weather.wind import WindConditions
|
|||||||
|
|
||||||
class EnvironmentGenerator:
|
class EnvironmentGenerator:
|
||||||
def __init__(
|
def __init__(
|
||||||
self, mission: Mission, conditions: Conditions, time: datetime
|
self, mission: Mission, conditions: Conditions, time: datetime, auto_fog: bool
|
||||||
) -> None:
|
) -> None:
|
||||||
self.mission = mission
|
self.mission = mission
|
||||||
self.conditions = conditions
|
self.conditions = conditions
|
||||||
self.time = time
|
self.time = time
|
||||||
|
self.auto_fog = auto_fog
|
||||||
|
|
||||||
def set_atmospheric(self, atmospheric: AtmosphericConditions) -> None:
|
def set_atmospheric(self, atmospheric: AtmosphericConditions) -> None:
|
||||||
self.mission.weather.qnh = atmospheric.qnh.mm_hg
|
self.mission.weather.qnh = atmospheric.qnh.mm_hg
|
||||||
@ -33,6 +34,7 @@ class EnvironmentGenerator:
|
|||||||
self.mission.weather.clouds_preset = clouds.preset
|
self.mission.weather.clouds_preset = clouds.preset
|
||||||
|
|
||||||
def set_fog(self, fog: Optional[Fog]) -> None:
|
def set_fog(self, fog: Optional[Fog]) -> None:
|
||||||
|
self.mission.weather.auto_fog = self.auto_fog
|
||||||
if fog is None:
|
if fog is None:
|
||||||
return
|
return
|
||||||
self.mission.weather.fog_visibility = int(fog.visibility.meters)
|
self.mission.weather.fog_visibility = int(fog.visibility.meters)
|
||||||
|
|||||||
@ -86,7 +86,10 @@ class MissionGenerator:
|
|||||||
self.add_airfields_to_unit_map()
|
self.add_airfields_to_unit_map()
|
||||||
self.initialize_registries()
|
self.initialize_registries()
|
||||||
|
|
||||||
EnvironmentGenerator(self.mission, self.game.conditions, self.time).generate()
|
auto_fog = self.game.settings.use_auto_fog
|
||||||
|
EnvironmentGenerator(
|
||||||
|
self.mission, self.game.conditions, self.time, auto_fog
|
||||||
|
).generate()
|
||||||
|
|
||||||
tgo_generator = TgoGenerator(
|
tgo_generator = TgoGenerator(
|
||||||
self.mission,
|
self.mission,
|
||||||
|
|||||||
@ -83,7 +83,10 @@ class PretenseMissionGenerator(MissionGenerator):
|
|||||||
self.add_airfields_to_unit_map()
|
self.add_airfields_to_unit_map()
|
||||||
self.initialize_registries()
|
self.initialize_registries()
|
||||||
|
|
||||||
EnvironmentGenerator(self.mission, self.game.conditions, self.time).generate()
|
auto_fog = self.game.settings.use_auto_fog
|
||||||
|
EnvironmentGenerator(
|
||||||
|
self.mission, self.game.conditions, self.time, auto_fog
|
||||||
|
).generate()
|
||||||
|
|
||||||
tgo_generator = PretenseTgoGenerator(
|
tgo_generator = PretenseTgoGenerator(
|
||||||
self.mission,
|
self.mission,
|
||||||
|
|||||||
@ -1073,6 +1073,12 @@ class Settings:
|
|||||||
GAMEPLAY_SECTION,
|
GAMEPLAY_SECTION,
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
|
use_auto_fog: bool = boolean_option(
|
||||||
|
"Use DCS' automatic fog setting",
|
||||||
|
MISSION_GENERATOR_PAGE,
|
||||||
|
GAMEPLAY_SECTION,
|
||||||
|
default=True,
|
||||||
|
)
|
||||||
|
|
||||||
# Performance
|
# Performance
|
||||||
perf_smoke_gen: bool = boolean_option(
|
perf_smoke_gen: bool = boolean_option(
|
||||||
|
|||||||
@ -33,7 +33,7 @@ pluggy==1.5.0
|
|||||||
pre-commit==3.7.1
|
pre-commit==3.7.1
|
||||||
pydantic==2.7.4
|
pydantic==2.7.4
|
||||||
pydantic-settings==2.3.3
|
pydantic-settings==2.3.3
|
||||||
pydcs @ git+https://github.com/dcs-retribution/pydcs@d227a6a81e159f0df8a31d12e8bc10ee12673c73
|
pydcs @ git+https://github.com/dcs-retribution/pydcs@d4f141fb8bfa75a4e3b8280012ab46723a6b05ef
|
||||||
pyinstaller==5.13.2
|
pyinstaller==5.13.2
|
||||||
pyinstaller-hooks-contrib==2024.0
|
pyinstaller-hooks-contrib==2024.0
|
||||||
pyparsing==3.1.2
|
pyparsing==3.1.2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user