Selectable aircraft type in AutoCreateDialog

Resolves #165
This commit is contained in:
Raffson
2024-02-25 00:38:17 +01:00
parent b737f4e00c
commit e36e213b76
5 changed files with 103 additions and 27 deletions

View File

@@ -3,6 +3,7 @@ from enum import Enum, auto
from typing import Optional
from game.ato.flighttype import FlightType
from game.dcs.aircrafttype import AircraftType
from game.theater import MissionTarget
@@ -33,6 +34,8 @@ class ProposedFlight:
#: field is None.
escort_type: Optional[EscortType] = field(default=None)
preferred_type: Optional[AircraftType] = field(default=None)
def __str__(self) -> str:
return f"{self.task} {self.num_aircraft} ship"

View File

@@ -49,7 +49,12 @@ class PackageBuilder:
pf = self.package.primary_flight
heli = pf.is_helo if pf else False
squadron = self.air_wing.best_squadron_for(
self.package.target, plan.task, plan.num_aircraft, heli, this_turn=True
self.package.target,
plan.task,
plan.num_aircraft,
heli,
this_turn=True,
preferred_type=plan.preferred_type,
)
if squadron is None:
return False