From 2f6c04a86df0fa3833d32bb75ff643ed37b5ecf7 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 20 May 2021 18:35:32 -0700 Subject: [PATCH] Add bullseye to the kneeboard. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/136 --- gen/kneeboard.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gen/kneeboard.py b/gen/kneeboard.py index d650d80d..e28ded01 100644 --- a/gen/kneeboard.py +++ b/gen/kneeboard.py @@ -38,6 +38,7 @@ from tabulate import tabulate from game.data.alic import AlicCodes from game.db import find_unittype, unit_type_from_name from game.theater import ConflictTheater, TheaterGroundObject, LatLon +from game.theater.bullseye import Bullseye from game.utils import meters from .aircraft import AIRCRAFT_DATA, FlightData from .airsupportgen import AwacsInfo, TankerInfo @@ -258,10 +259,14 @@ class BriefingPage(KneeboardPage): def __init__( self, flight: FlightData, + bullseye: Bullseye, + theater: ConflictTheater, start_time: datetime.datetime, dark_kneeboard: bool, ) -> None: self.flight = flight + self.bullseye = bullseye + self.theater = theater self.start_time = start_time self.dark_kneeboard = dark_kneeboard @@ -293,6 +298,10 @@ class BriefingPage(KneeboardPage): headers=["#", "Action", "Alt", "Dist", "GSPD", "Time", "Departure"], ) + writer.text( + f"Bullseye: {self.format_ll(self.bullseye.to_lat_lon(self.theater))}" + ) + writer.table( [ [ @@ -591,7 +600,13 @@ class KneeboardGenerator(MissionInfoGenerator): def generate_flight_kneeboard(self, flight: FlightData) -> List[KneeboardPage]: """Returns a list of kneeboard pages for the given flight.""" pages: List[KneeboardPage] = [ - BriefingPage(flight, self.mission.start_time, self.dark_kneeboard), + BriefingPage( + flight, + self.game.bullseye_for(flight.friendly), + self.game.theater, + self.mission.start_time, + self.dark_kneeboard, + ), SupportPage( flight, self.comms,