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.
|
* **[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.
|
* **[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 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
|
* **[Modding]** Add F-104 mod support
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|||||||
@ -23,6 +23,12 @@ class AutoAtoBehavior(Enum):
|
|||||||
Prefer = "Prefer player pilots"
|
Prefer = "Prefer player pilots"
|
||||||
|
|
||||||
|
|
||||||
|
class NightMissions(Enum):
|
||||||
|
DayAndNight = "nightmissions_nightandday"
|
||||||
|
OnlyDay = "nightmissions_onlyday"
|
||||||
|
OnlyNight = "nightmissions_onlynight"
|
||||||
|
|
||||||
|
|
||||||
DIFFICULTY_PAGE = "Difficulty"
|
DIFFICULTY_PAGE = "Difficulty"
|
||||||
|
|
||||||
AI_DIFFICULTY_SECTION = "AI Difficulty"
|
AI_DIFFICULTY_SECTION = "AI Difficulty"
|
||||||
@ -104,11 +110,16 @@ class Settings:
|
|||||||
section=MISSION_DIFFICULTY_SECTION,
|
section=MISSION_DIFFICULTY_SECTION,
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
night_disabled: bool = boolean_option(
|
night_day_missions: NightMissions = choices_option(
|
||||||
"No night missions",
|
"Night/day mission options",
|
||||||
page=DIFFICULTY_PAGE,
|
page=DIFFICULTY_PAGE,
|
||||||
section=MISSION_DIFFICULTY_SECTION,
|
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
|
# Mission Restrictions
|
||||||
labels: str = choices_option(
|
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.cloud_presets import Clouds as PydcsClouds
|
||||||
from dcs.weather import CloudPreset, Weather as PydcsWeather, Wind
|
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.utils import Distance, Heading, meters, interpolate, Pressure, inches_hg
|
||||||
|
|
||||||
from game.theater.seasonalconditions import determine_season
|
from game.theater.seasonalconditions import determine_season
|
||||||
@ -301,7 +301,10 @@ class Conditions:
|
|||||||
settings: Settings,
|
settings: Settings,
|
||||||
) -> Conditions:
|
) -> Conditions:
|
||||||
_start_time = cls.generate_start_time(
|
_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(
|
return cls(
|
||||||
time_of_day=time_of_day,
|
time_of_day=time_of_day,
|
||||||
@ -315,9 +318,9 @@ class Conditions:
|
|||||||
theater: ConflictTheater,
|
theater: ConflictTheater,
|
||||||
day: datetime.date,
|
day: datetime.date,
|
||||||
time_of_day: TimeOfDay,
|
time_of_day: TimeOfDay,
|
||||||
night_disabled: bool,
|
night_day_missions: NightMissions,
|
||||||
) -> datetime.datetime:
|
) -> datetime.datetime:
|
||||||
if night_disabled:
|
if night_day_missions == NightMissions.OnlyDay:
|
||||||
logging.info("Skip Night mission due to user settings")
|
logging.info("Skip Night mission due to user settings")
|
||||||
time_range = {
|
time_range = {
|
||||||
TimeOfDay.Dawn: (8, 9),
|
TimeOfDay.Dawn: (8, 9),
|
||||||
@ -325,6 +328,14 @@ class Conditions:
|
|||||||
TimeOfDay.Dusk: (12, 14),
|
TimeOfDay.Dusk: (12, 14),
|
||||||
TimeOfDay.Night: (14, 17),
|
TimeOfDay.Night: (14, 17),
|
||||||
}[time_of_day]
|
}[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:
|
else:
|
||||||
time_range = theater.daytime_map[time_of_day.value]
|
time_range = theater.daytime_map[time_of_day.value]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user