Generalize commit range display for all patrols.

Fixes https://github.com/Khopa/dcs_liberation/issues/890

(cherry picked from commit 132ba905c7)
This commit is contained in:
Dan Albert
2021-04-22 17:55:14 -07:00
parent 29579a2aec
commit e4e65df976
3 changed files with 11 additions and 8 deletions

View File

@@ -58,6 +58,8 @@ from gen.flights.flightplan import (
FlightPlan,
FlightPlanBuilder,
InvalidObjectiveLocation,
PatrollingFlightPlan,
TarCapFlightPlan,
)
from gen.flights.traveltime import TotEstimator
from qt_ui.displayoptions import DisplayOptions, ThreatZoneOptions
@@ -721,13 +723,11 @@ class QLiberationMap(QGraphicsView):
)
prev_pos = tuple(new_pos)
if selected and DisplayOptions.barcap_commit_range:
self.draw_barcap_commit_range(scene, flight)
if selected and DisplayOptions.patrol_engagement_range:
self.draw_patrol_commit_range(scene, flight)
def draw_barcap_commit_range(self, scene: QGraphicsScene, flight: Flight) -> None:
if flight.flight_type is not FlightType.BARCAP:
return
if not isinstance(flight.flight_plan, BarCapFlightPlan):
def draw_patrol_commit_range(self, scene: QGraphicsScene, flight: Flight) -> None:
if not isinstance(flight.flight_plan, PatrollingFlightPlan):
return
start = flight.flight_plan.patrol_start
end = flight.flight_plan.patrol_end