mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Added option for only night missions.
- Moved the night mission setting back from the Mission restrictions section to the Mission difficulty section. - Changed the Night/day mission option into a dropdown menu. Resolves #1786
This commit is contained in:
parent
475cb4851a
commit
d2eb98bcc5
@ -7,6 +7,7 @@ Saves from 5.0.0 are compatible with 5.1.0
|
||||
* **[Engine]** Support for DCS 2.7.9.17830 and newer, including the HTS and ECM pod.
|
||||
* **[Campaign]** Add option to manually add and remove squadrons and different aircraft type in the new game wizard / air wing configuration dialog.
|
||||
* **[Mission Generation]** Add Option to enforce the Easy Communication setting for the mission
|
||||
* **[Mission Generation]** Add Option to select between only night missions, day missions or any time (default).
|
||||
* **[Modding]** Add F-104 mod support
|
||||
|
||||
## Fixes
|
||||
|
||||
@ -23,6 +23,12 @@ class AutoAtoBehavior(Enum):
|
||||
Prefer = "Prefer player pilots"
|
||||
|
||||
|
||||
class NightMissions(Enum):
|
||||
DayAndNight = "nightmissions_nightandday"
|
||||
OnlyDay = "nightmissions_onlyday"
|
||||
OnlyNight = "nightmissions_onlynight"
|
||||
|
||||
|
||||
DIFFICULTY_PAGE = "Difficulty"
|
||||
|
||||
AI_DIFFICULTY_SECTION = "AI Difficulty"
|
||||
@ -104,11 +110,16 @@ class Settings:
|
||||
section=MISSION_DIFFICULTY_SECTION,
|
||||
default=True,
|
||||
)
|
||||
night_disabled: bool = boolean_option(
|
||||
"No night missions",
|
||||
night_day_missions: NightMissions = choices_option(
|
||||
"Night/day mission options",
|
||||
page=DIFFICULTY_PAGE,
|
||||
section=MISSION_DIFFICULTY_SECTION,
|
||||
default=False,
|
||||
choices={
|
||||
"Generate night and day missions": NightMissions.DayAndNight,
|
||||
"Only generate day missions": NightMissions.OnlyDay,
|
||||
"Only generate night missions": NightMissions.OnlyNight,
|
||||
},
|
||||
default=NightMissions.DayAndNight,
|
||||
)
|
||||
# Mission Restrictions
|
||||
labels: str = choices_option(
|
||||
|
||||
@ -10,7 +10,7 @@ from typing import Optional, TYPE_CHECKING, Any
|
||||
from dcs.cloud_presets import Clouds as PydcsClouds
|
||||
from dcs.weather import CloudPreset, Weather as PydcsWeather, Wind
|
||||
|
||||
from game.settings import Settings
|
||||
from game.settings.settings import Settings, NightMissions
|
||||
from game.utils import Distance, Heading, meters, interpolate, Pressure, inches_hg
|
||||
|
||||
from game.theater.seasonalconditions import determine_season
|
||||
@ -301,7 +301,10 @@ class Conditions:
|
||||
settings: Settings,
|
||||
) -> Conditions:
|
||||
_start_time = cls.generate_start_time(
|
||||
theater, day, time_of_day, settings.night_disabled
|
||||
theater,
|
||||
day,
|
||||
time_of_day,
|
||||
settings.night_day_missions,
|
||||
)
|
||||
return cls(
|
||||
time_of_day=time_of_day,
|
||||
@ -315,9 +318,9 @@ class Conditions:
|
||||
theater: ConflictTheater,
|
||||
day: datetime.date,
|
||||
time_of_day: TimeOfDay,
|
||||
night_disabled: bool,
|
||||
night_day_missions: NightMissions,
|
||||
) -> datetime.datetime:
|
||||
if night_disabled:
|
||||
if night_day_missions == NightMissions.OnlyDay:
|
||||
logging.info("Skip Night mission due to user settings")
|
||||
time_range = {
|
||||
TimeOfDay.Dawn: (8, 9),
|
||||
@ -325,6 +328,14 @@ class Conditions:
|
||||
TimeOfDay.Dusk: (12, 14),
|
||||
TimeOfDay.Night: (14, 17),
|
||||
}[time_of_day]
|
||||
elif night_day_missions == NightMissions.OnlyNight:
|
||||
logging.info("Skip Day mission due to user settings")
|
||||
time_range = {
|
||||
TimeOfDay.Dawn: (0, 3),
|
||||
TimeOfDay.Day: (3, 6),
|
||||
TimeOfDay.Dusk: (21, 22),
|
||||
TimeOfDay.Night: (22, 23),
|
||||
}[time_of_day]
|
||||
else:
|
||||
time_range = theater.daytime_map[time_of_day.value]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user