mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
kneeboard: custom flight name in title (#911)
If a flight has a custom flight name set it gets appended to the title in the kneeboard. Partially addresses #862 .
This commit is contained in:
parent
7d5244a5bc
commit
cd9432e395
@ -319,6 +319,7 @@ class FlightData:
|
|||||||
intra_flight_channel: RadioFrequency,
|
intra_flight_channel: RadioFrequency,
|
||||||
bingo_fuel: Optional[int],
|
bingo_fuel: Optional[int],
|
||||||
joker_fuel: Optional[int],
|
joker_fuel: Optional[int],
|
||||||
|
custom_name: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
self.package = package
|
self.package = package
|
||||||
self.country = country
|
self.country = country
|
||||||
@ -336,6 +337,7 @@ class FlightData:
|
|||||||
self.bingo_fuel = bingo_fuel
|
self.bingo_fuel = bingo_fuel
|
||||||
self.joker_fuel = joker_fuel
|
self.joker_fuel = joker_fuel
|
||||||
self.callsign = create_group_callsign_from_unit(self.units[0])
|
self.callsign = create_group_callsign_from_unit(self.units[0])
|
||||||
|
self.custom_name = custom_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def client_units(self) -> List[FlyingUnit]:
|
def client_units(self) -> List[FlyingUnit]:
|
||||||
@ -814,6 +816,7 @@ class AircraftConflictGenerator:
|
|||||||
intra_flight_channel=channel,
|
intra_flight_channel=channel,
|
||||||
bingo_fuel=flight.flight_plan.bingo_fuel,
|
bingo_fuel=flight.flight_plan.bingo_fuel,
|
||||||
joker_fuel=flight.flight_plan.joker_fuel,
|
joker_fuel=flight.flight_plan.joker_fuel,
|
||||||
|
custom_name=flight.custom_name,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -248,7 +248,11 @@ class BriefingPage(KneeboardPage):
|
|||||||
|
|
||||||
def write(self, path: Path) -> None:
|
def write(self, path: Path) -> None:
|
||||||
writer = KneeboardPageWriter()
|
writer = KneeboardPageWriter()
|
||||||
writer.title(f"{self.flight.callsign} Mission Info")
|
if self.flight.custom_name is not None:
|
||||||
|
custom_name_title = ' ("{}")'.format(self.flight.custom_name)
|
||||||
|
else:
|
||||||
|
custom_name_title = ""
|
||||||
|
writer.title(f"{self.flight.callsign} Mission Info{custom_name_title}")
|
||||||
|
|
||||||
# TODO: Handle carriers.
|
# TODO: Handle carriers.
|
||||||
writer.heading("Airfield Info")
|
writer.heading("Airfield Info")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user