mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Migrate air icons to milsymbol.
All NATO icons are now generated by the milsymbol library based on their SIDC.
This commit is contained in:
@@ -11,6 +11,14 @@ from game.savecompat import has_save_compat_for
|
||||
from .flightroster import FlightRoster
|
||||
from .flightstate import FlightState, Uninitialized
|
||||
from .loadouts import Loadout
|
||||
from ..sidc import (
|
||||
AirEntity,
|
||||
Entity,
|
||||
SidcDescribable,
|
||||
StandardIdentity,
|
||||
Status,
|
||||
SymbolSet,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
@@ -25,7 +33,7 @@ if TYPE_CHECKING:
|
||||
from .starttype import StartType
|
||||
|
||||
|
||||
class Flight:
|
||||
class Flight(SidcDescribable):
|
||||
def __init__(
|
||||
self,
|
||||
package: Package,
|
||||
@@ -103,6 +111,18 @@ class Flight:
|
||||
def blue(self) -> bool:
|
||||
return self.squadron.player
|
||||
|
||||
@property
|
||||
def standard_identity(self) -> StandardIdentity:
|
||||
return StandardIdentity.FRIEND if self.blue else StandardIdentity.HOSTILE_FAKER
|
||||
|
||||
@property
|
||||
def sidc_status(self) -> Status:
|
||||
return Status.PRESENT
|
||||
|
||||
@property
|
||||
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||
return SymbolSet.AIR, AirEntity.UNSPECIFIED
|
||||
|
||||
@property
|
||||
def departure(self) -> ControlPoint:
|
||||
return self.squadron.location
|
||||
|
||||
@@ -13,6 +13,7 @@ class FlightJs(BaseModel):
|
||||
id: UUID
|
||||
blue: bool
|
||||
position: LeafletPoint | None
|
||||
sidc: str
|
||||
|
||||
@staticmethod
|
||||
def for_flight(flight: Flight) -> FlightJs:
|
||||
@@ -23,4 +24,6 @@ class FlightJs(BaseModel):
|
||||
position = None
|
||||
if isinstance(flight.state, InFlight):
|
||||
position = flight.position().latlng()
|
||||
return FlightJs(id=flight.id, blue=flight.blue, position=position)
|
||||
return FlightJs(
|
||||
id=flight.id, blue=flight.blue, position=position, sidc=str(flight.sidc())
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user