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:
BenBenBeartrax 2021-02-21 22:29:31 +01:00 committed by GitHub
parent 7d5244a5bc
commit cd9432e395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -319,6 +319,7 @@ class FlightData:
intra_flight_channel: RadioFrequency,
bingo_fuel: Optional[int],
joker_fuel: Optional[int],
custom_name: Optional[str],
) -> None:
self.package = package
self.country = country
@ -336,6 +337,7 @@ class FlightData:
self.bingo_fuel = bingo_fuel
self.joker_fuel = joker_fuel
self.callsign = create_group_callsign_from_unit(self.units[0])
self.custom_name = custom_name
@property
def client_units(self) -> List[FlyingUnit]:
@ -814,6 +816,7 @@ class AircraftConflictGenerator:
intra_flight_channel=channel,
bingo_fuel=flight.flight_plan.bingo_fuel,
joker_fuel=flight.flight_plan.joker_fuel,
custom_name=flight.custom_name,
)
)

View File

@ -248,7 +248,11 @@ class BriefingPage(KneeboardPage):
def write(self, path: Path) -> None:
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.
writer.heading("Airfield Info")