mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +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,
|
||||
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,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user