mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add setting to fast forward until player is at IP (#3530)
This commit is contained in:
parent
545990b16d
commit
2591a2b9a8
@ -7,6 +7,7 @@ Saves from 13.x are not compatible with 14.0.0.
|
||||
* **[Engine]** Support for DCS 2.9.20 including MiG-29 Fulcrum (full fidelity version).
|
||||
* **[Mods]** A4EC mod version updated to 2.3.
|
||||
* **[UI]** Allow saving after fast forwarding manually with sim speed controls (--show-sim-speed-controls option).
|
||||
* **[UI]** Add new option to fast forward until player is at the IP.
|
||||
|
||||
## Fixes
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
from abc import ABC, abstractmethod
|
||||
from collections import deque
|
||||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dcs import Point
|
||||
@ -13,6 +14,7 @@ from game.ato.flightstate.flightstate import FlightState
|
||||
from game.ato.flightwaypoint import FlightWaypoint
|
||||
from game.ato.flightwaypointtype import FlightWaypointType
|
||||
from game.ato.starttype import StartType
|
||||
from game.settings.settings import FastForwardStopCondition
|
||||
from game.utils import Distance, LBS_TO_KG, Speed, pairwise
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@ -164,3 +166,17 @@ class InFlight(FlightState, ABC):
|
||||
@property
|
||||
def spawn_type(self) -> StartType:
|
||||
return StartType.IN_FLIGHT
|
||||
|
||||
def should_halt_sim(self) -> bool:
|
||||
if (
|
||||
self.flight.client_count > 0
|
||||
and self.settings.fast_forward_stop_condition
|
||||
== FastForwardStopCondition.PLAYER_AT_IP
|
||||
and self.is_at_ip
|
||||
):
|
||||
logging.info(
|
||||
f"Interrupting simulation because {self.flight} has players and has "
|
||||
"reached IP"
|
||||
)
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -35,6 +35,7 @@ class FastForwardStopCondition(Enum):
|
||||
PLAYER_TAKEOFF = "Player takeoff time"
|
||||
PLAYER_TAXI = "Player taxi time"
|
||||
PLAYER_STARTUP = "Player startup time"
|
||||
PLAYER_AT_IP = "Player at IP"
|
||||
MANUAL = "Manual fast forward control"
|
||||
|
||||
|
||||
@ -375,6 +376,7 @@ class Settings:
|
||||
"Player startup time": FastForwardStopCondition.PLAYER_STARTUP,
|
||||
"Player taxi time": FastForwardStopCondition.PLAYER_TAXI,
|
||||
"Player takeoff time": FastForwardStopCondition.PLAYER_TAKEOFF,
|
||||
"Player at IP": FastForwardStopCondition.PLAYER_AT_IP,
|
||||
"First contact": FastForwardStopCondition.FIRST_CONTACT,
|
||||
"Manual": FastForwardStopCondition.MANUAL,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user