mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Identify aircraft types based on their mission.
It would probably be more accurate to have the icon based on the
aircraft type and use the modifier to indicate the mission, but this
will do for now (I also might have that backwards, I can't find the
guidance because it's in STANAG 1241 which isn't free).
I also increased the icon size a bit in the UI because the longest icon
text ("SEAD") was hard to read.
This commit is contained in:
parent
73a8ec02b2
commit
e36c62b30e
@ -5,7 +5,7 @@ import { Marker } from "react-leaflet";
|
||||
|
||||
function iconForFlight(flight: Flight) {
|
||||
const symbol = new Symbol(flight.sidc, {
|
||||
size: 16,
|
||||
size: 20,
|
||||
});
|
||||
|
||||
return new Icon({
|
||||
|
||||
@ -13,7 +13,6 @@ from .flightstate import FlightState, Uninitialized
|
||||
from .flightstate.killed import Killed
|
||||
from .loadouts import Loadout
|
||||
from ..sidc import (
|
||||
AirEntity,
|
||||
Entity,
|
||||
SidcDescribable,
|
||||
StandardIdentity,
|
||||
@ -122,7 +121,7 @@ class Flight(SidcDescribable):
|
||||
|
||||
@property
|
||||
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||
return SymbolSet.AIR, AirEntity.UNSPECIFIED
|
||||
return SymbolSet.AIR, self.flight_type.entity_type
|
||||
|
||||
@property
|
||||
def departure(self) -> ControlPoint:
|
||||
|
||||
@ -2,6 +2,8 @@ from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from game.sidc import AirEntity
|
||||
|
||||
|
||||
class FlightType(Enum):
|
||||
"""Enumeration of mission types.
|
||||
@ -88,3 +90,26 @@ class FlightType(Enum):
|
||||
FlightType.OCA_AIRCRAFT,
|
||||
FlightType.SEAD_ESCORT,
|
||||
}
|
||||
|
||||
@property
|
||||
def entity_type(self) -> AirEntity:
|
||||
return {
|
||||
FlightType.AEWC: AirEntity.AIRBORNE_EARLY_WARNING,
|
||||
FlightType.ANTISHIP: AirEntity.ANTISURFACE_WARFARE,
|
||||
FlightType.BAI: AirEntity.ATTACK_STRIKE,
|
||||
FlightType.BARCAP: AirEntity.FIGHTER,
|
||||
FlightType.CAS: AirEntity.ATTACK_STRIKE,
|
||||
FlightType.DEAD: AirEntity.ATTACK_STRIKE,
|
||||
FlightType.ESCORT: AirEntity.ESCORT,
|
||||
FlightType.FERRY: AirEntity.UNSPECIFIED,
|
||||
FlightType.INTERCEPTION: AirEntity.FIGHTER,
|
||||
FlightType.OCA_AIRCRAFT: AirEntity.ATTACK_STRIKE,
|
||||
FlightType.OCA_RUNWAY: AirEntity.ATTACK_STRIKE,
|
||||
FlightType.REFUELING: AirEntity.TANKER,
|
||||
FlightType.SEAD: AirEntity.SUPPRESSION_OF_ENEMY_AIR_DEFENCE,
|
||||
FlightType.SEAD_ESCORT: AirEntity.SUPPRESSION_OF_ENEMY_AIR_DEFENCE,
|
||||
FlightType.STRIKE: AirEntity.ATTACK_STRIKE,
|
||||
FlightType.SWEEP: AirEntity.FIGHTER,
|
||||
FlightType.TARCAP: AirEntity.FIGHTER,
|
||||
FlightType.TRANSPORT: AirEntity.UTILITY,
|
||||
}.get(self, AirEntity.UNSPECIFIED)
|
||||
|
||||
19
game/sidc.py
19
game/sidc.py
@ -207,6 +207,25 @@ class AirEntity(Entity):
|
||||
"""Air Entity/Entity Type/Entity Subtype defined by table A-10."""
|
||||
|
||||
UNSPECIFIED = 0
|
||||
ATTACK_STRIKE = 110102
|
||||
BOMBER = 110103
|
||||
FIGHTER = 110104
|
||||
FIGHTER_BOMBER = 110105
|
||||
CARGO = 110107
|
||||
ELECTRONIC_COMBAT_JAMMER = 110108
|
||||
TANKER = 110109
|
||||
PATROL = 110110
|
||||
RECONNAISSANCE = 110111
|
||||
UTILITY = 110113
|
||||
VSTOL = 110114
|
||||
AIRBORNE_EARLY_WARNING = 110116
|
||||
ANTISURFACE_WARFARE = 110117
|
||||
ANTISUBMARINE_WARFARE = 110118
|
||||
COMBAT_SEARCH_AND_RESCUE = 110120
|
||||
SUPPRESSION_OF_ENEMY_AIR_DEFENCE = 110130
|
||||
ESCORT = 110132
|
||||
ELECTRONIC_ATTACK = 110133
|
||||
ROTARY_WING = 110200
|
||||
|
||||
|
||||
@unique
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user