mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add warnings for invalid fast-forward settings.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2739.
This commit is contained in:
parent
2a29dd4886
commit
5b935db923
@ -6,6 +6,7 @@ Saves from 8.x are not compatible with 9.0.0.
|
|||||||
|
|
||||||
* **[Flight Planning]** Improved IP selection for targets that are near the center of a threat zone.
|
* **[Flight Planning]** Improved IP selection for targets that are near the center of a threat zone.
|
||||||
* **[Modding]** Factions can now specify the ship type to be used for cargo shipping. The Handy Wind will be used by default, but WW2 factions can pick something more appropriate.
|
* **[Modding]** Factions can now specify the ship type to be used for cargo shipping. The Handy Wind will be used by default, but WW2 factions can pick something more appropriate.
|
||||||
|
* **[UI]** An error will be displayed when invalid fast-forward options are selected rather than beginning a never ending simulation.
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
|
|||||||
@ -397,10 +397,12 @@ class Settings:
|
|||||||
section=GAMEPLAY_SECTION,
|
section=GAMEPLAY_SECTION,
|
||||||
default=False,
|
default=False,
|
||||||
detail=(
|
detail=(
|
||||||
"If enabled, aircraft entering combat during fast forward will have their "
|
'Requires a "Player missions interrupt fast forward" setting other than '
|
||||||
"combat auto-resolved after a period of time. This allows the simulation "
|
'"Never" If enabled, aircraft entering combat during fast forward will have'
|
||||||
"to advance further into the mission before requiring mission generation, "
|
"their combat auto-resolved after a period of time. This allows the "
|
||||||
"but simulation is currently very rudimentary so may result in huge losses."
|
"simulation to advance further into the mission before requiring mission "
|
||||||
|
"generation, but simulation is currently very rudimentary so may result in "
|
||||||
|
"huge losses."
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
supercarrier: bool = boolean_option(
|
supercarrier: bool = boolean_option(
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import textwrap
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import List, Optional, Callable
|
from typing import List, Optional, Callable
|
||||||
|
|
||||||
@ -246,6 +247,50 @@ class QTopPanel(QFrame):
|
|||||||
mbox.exec_()
|
mbox.exec_()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def check_valid_autoresolve_settings(self) -> bool:
|
||||||
|
if not self.game.settings.fast_forward_to_first_contact:
|
||||||
|
return True
|
||||||
|
|
||||||
|
if not self.game.settings.auto_resolve_combat:
|
||||||
|
return True
|
||||||
|
|
||||||
|
has_clients = self.ato_has_clients()
|
||||||
|
if (
|
||||||
|
has_clients
|
||||||
|
and self.game.settings.player_mission_interrupts_sim_at is not None
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
|
||||||
|
if has_clients:
|
||||||
|
message = textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
You have enabled settings to fast forward and to auto-resolve combat,
|
||||||
|
but have not selected any interrupt condition. Fast forward will never
|
||||||
|
stop with your current settings. To use auto- resolve, you must choose a
|
||||||
|
"Player missions interrupt fast forward" setting other than "Never".
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
message = textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
You have enabled settings to fast forward and to auto-resolve combat,
|
||||||
|
but have no players. Fast forward will never stop with your current
|
||||||
|
settings. Auto-resolve and fast forward cannot be used without player
|
||||||
|
flights and a "Player missions interrupt fast forward" setting other
|
||||||
|
than "Never".
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
mbox = QMessageBox(
|
||||||
|
QMessageBox.Icon.Critical,
|
||||||
|
"Incompatible fast-forward settings",
|
||||||
|
message,
|
||||||
|
parent=self,
|
||||||
|
)
|
||||||
|
mbox.setEscapeButton(mbox.addButton(QMessageBox.StandardButton.Close))
|
||||||
|
mbox.exec()
|
||||||
|
return False
|
||||||
|
|
||||||
def launch_mission(self):
|
def launch_mission(self):
|
||||||
"""Finishes planning and waits for mission completion."""
|
"""Finishes planning and waits for mission completion."""
|
||||||
if not self.ato_has_clients() and not self.confirm_no_client_launch():
|
if not self.ato_has_clients() and not self.confirm_no_client_launch():
|
||||||
@ -261,6 +306,9 @@ class QTopPanel(QFrame):
|
|||||||
if not self.confirm_negative_start_time(negative_starts):
|
if not self.confirm_negative_start_time(negative_starts):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not self.check_valid_autoresolve_settings():
|
||||||
|
return
|
||||||
|
|
||||||
if self.game.settings.fast_forward_to_first_contact:
|
if self.game.settings.fast_forward_to_first_contact:
|
||||||
with logged_duration("Simulating to first contact"):
|
with logged_duration("Simulating to first contact"):
|
||||||
self.sim_controller.run_to_first_contact()
|
self.sim_controller.run_to_first_contact()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user