mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Streamlining
This commit is contained in:
parent
1760532168
commit
ee3bdf9fd7
@ -28,7 +28,7 @@ class FlightMembers(IFlightRoster):
|
|||||||
def from_roster(flight: Flight, roster: FlightRoster) -> FlightMembers:
|
def from_roster(flight: Flight, roster: FlightRoster) -> FlightMembers:
|
||||||
members = FlightMembers(flight)
|
members = FlightMembers(flight)
|
||||||
loadout = Loadout.default_for(flight)
|
loadout = Loadout.default_for(flight)
|
||||||
if flight.squadron.aircraft.name == "F-15I Ra'am":
|
if flight.squadron.aircraft.variant_id == "F-15I Ra'am":
|
||||||
loadout.pylons[16] = Weapon.with_clsid("{IDF_MODS_PROJECT_F-15I_Raam_Dome}")
|
loadout.pylons[16] = Weapon.with_clsid("{IDF_MODS_PROJECT_F-15I_Raam_Dome}")
|
||||||
members.members = [FlightMember(p, loadout) for p in roster.pilots]
|
members.members = [FlightMember(p, loadout) for p in roster.pilots]
|
||||||
return members
|
return members
|
||||||
@ -64,7 +64,7 @@ class FlightMembers(IFlightRoster):
|
|||||||
loadout = self.members[0].loadout.clone()
|
loadout = self.members[0].loadout.clone()
|
||||||
else:
|
else:
|
||||||
loadout = Loadout.default_for(self.flight)
|
loadout = Loadout.default_for(self.flight)
|
||||||
if self.flight.squadron.aircraft.name == "F-15I Ra'am":
|
if self.flight.squadron.aircraft.variant_id == "F-15I Ra'am":
|
||||||
loadout.pylons[16] = Weapon.with_clsid("{IDF_MODS_PROJECT_F-15I_Raam_Dome}")
|
loadout.pylons[16] = Weapon.with_clsid("{IDF_MODS_PROJECT_F-15I_Raam_Dome}")
|
||||||
for _ in range(new_size - self.max_size):
|
for _ in range(new_size - self.max_size):
|
||||||
member = FlightMember(self.flight.squadron.claim_available_pilot(), loadout)
|
member = FlightMember(self.flight.squadron.claim_available_pilot(), loadout)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ from game.ato.flightplans.waypointbuilder import WaypointBuilder
|
|||||||
from game.flightplan import JoinZoneGeometry
|
from game.flightplan import JoinZoneGeometry
|
||||||
from game.flightplan.ipsolver import IpSolver
|
from game.flightplan.ipsolver import IpSolver
|
||||||
from game.flightplan.refuelzonegeometry import RefuelZoneGeometry
|
from game.flightplan.refuelzonegeometry import RefuelZoneGeometry
|
||||||
from game.persistence.paths import liberation_user_dir
|
from game.persistency import debug_dir
|
||||||
from game.utils import dcs_to_shapely_point
|
from game.utils import dcs_to_shapely_point
|
||||||
from game.utils import nautical_miles
|
from game.utils import nautical_miles
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class PackageWaypoints:
|
|||||||
) -> PackageWaypoints:
|
) -> PackageWaypoints:
|
||||||
origin = package.departure_closest_to_target()
|
origin = package.departure_closest_to_target()
|
||||||
|
|
||||||
waypoint_debug_directory = liberation_user_dir() / "Debug/Waypoints"
|
waypoint_debug_directory = debug_dir() / "Waypoints"
|
||||||
|
|
||||||
# Start by picking the best IP for the attack.
|
# Start by picking the best IP for the attack.
|
||||||
ip_solver = IpSolver(
|
ip_solver = IpSolver(
|
||||||
|
|||||||
@ -39,7 +39,6 @@ from game.radio.channels import (
|
|||||||
ViperChannelNamer,
|
ViperChannelNamer,
|
||||||
WarthogChannelNamer,
|
WarthogChannelNamer,
|
||||||
)
|
)
|
||||||
from game.savecompat import has_save_compat_for
|
|
||||||
from game.utils import (
|
from game.utils import (
|
||||||
Distance,
|
Distance,
|
||||||
ImperialUnits,
|
ImperialUnits,
|
||||||
@ -353,7 +352,6 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
|||||||
def task_priority(self, task: FlightType) -> int:
|
def task_priority(self, task: FlightType) -> int:
|
||||||
return self.task_priorities[task]
|
return self.task_priorities[task]
|
||||||
|
|
||||||
@has_save_compat_for(9)
|
|
||||||
def __setstate__(self, state: dict[str, Any]) -> None:
|
def __setstate__(self, state: dict[str, Any]) -> None:
|
||||||
# Save compat: the `name` field has been renamed `variant_id`.
|
# Save compat: the `name` field has been renamed `variant_id`.
|
||||||
if "name" in state:
|
if "name" in state:
|
||||||
|
|||||||
@ -12,7 +12,6 @@ from dcs.vehicles import vehicle_map
|
|||||||
|
|
||||||
from game.data.units import UnitClass
|
from game.data.units import UnitClass
|
||||||
from game.dcs.unittype import UnitType
|
from game.dcs.unittype import UnitType
|
||||||
from game.savecompat import has_save_compat_for
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -66,7 +65,6 @@ class GroundUnitType(UnitType[Type[VehicleType]]):
|
|||||||
dict[type[VehicleType], list[GroundUnitType]]
|
dict[type[VehicleType], list[GroundUnitType]]
|
||||||
] = defaultdict(list)
|
] = defaultdict(list)
|
||||||
|
|
||||||
@has_save_compat_for(9)
|
|
||||||
def __setstate__(self, state: dict[str, Any]) -> None:
|
def __setstate__(self, state: dict[str, Any]) -> None:
|
||||||
# Save compat: the `name` field has been renamed `variant_id`.
|
# Save compat: the `name` field has been renamed `variant_id`.
|
||||||
if "name" in state:
|
if "name" in state:
|
||||||
|
|||||||
@ -12,7 +12,6 @@ from dcs.unittype import ShipType
|
|||||||
|
|
||||||
from game.data.units import UnitClass
|
from game.data.units import UnitClass
|
||||||
from game.dcs.unittype import UnitType
|
from game.dcs.unittype import UnitType
|
||||||
from game.savecompat import has_save_compat_for
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
@ -22,7 +21,6 @@ class ShipUnitType(UnitType[Type[ShipType]]):
|
|||||||
list
|
list
|
||||||
)
|
)
|
||||||
|
|
||||||
@has_save_compat_for(9)
|
|
||||||
def __setstate__(self, state: dict[str, Any]) -> None:
|
def __setstate__(self, state: dict[str, Any]) -> None:
|
||||||
# Save compat: the `name` field has been renamed `variant_id`.
|
# Save compat: the `name` field has been renamed `variant_id`.
|
||||||
if "name" in state:
|
if "name" in state:
|
||||||
|
|||||||
@ -76,6 +76,10 @@ def base_path() -> Path:
|
|||||||
return Path(_dcs_saved_game_folder)
|
return Path(_dcs_saved_game_folder)
|
||||||
|
|
||||||
|
|
||||||
|
def debug_dir() -> Path:
|
||||||
|
return base_path() / "Retribution" / "Debug"
|
||||||
|
|
||||||
|
|
||||||
def settings_dir() -> Path:
|
def settings_dir() -> Path:
|
||||||
return base_path() / "Retribution" / "Settings"
|
return base_path() / "Retribution" / "Settings"
|
||||||
|
|
||||||
|
|||||||
@ -204,7 +204,7 @@ class SquadronDestinationComboBox(QComboBox):
|
|||||||
if overflow:
|
if overflow:
|
||||||
overflow_msg = ""
|
overflow_msg = ""
|
||||||
for s in overflow:
|
for s in overflow:
|
||||||
overflow_msg += f"{s.name} - {s.aircraft.name}<br/>"
|
overflow_msg += f"{s.name} - {s.aircraft.variant_id}<br/>"
|
||||||
QMessageBox.warning(
|
QMessageBox.warning(
|
||||||
None,
|
None,
|
||||||
"Insufficient parking space detected!",
|
"Insufficient parking space detected!",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user