mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add display option for BARCAP commit range.
This commit is contained in:
@@ -54,6 +54,7 @@ from gen.flights.flight import (
|
||||
FlightWaypointType,
|
||||
)
|
||||
from gen.flights.flightplan import (
|
||||
BarCapFlightPlan,
|
||||
FlightPlan,
|
||||
FlightPlanBuilder,
|
||||
InvalidObjectiveLocation,
|
||||
@@ -609,6 +610,27 @@ class QLiberationMap(QGraphicsView):
|
||||
flight.flight_plan)
|
||||
prev_pos = tuple(new_pos)
|
||||
|
||||
if selected and DisplayOptions.barcap_commit_range:
|
||||
self.draw_barcap_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):
|
||||
return
|
||||
start = flight.flight_plan.patrol_start
|
||||
end = flight.flight_plan.patrol_end
|
||||
line = LineString([
|
||||
ShapelyPoint(start.x, start.y),
|
||||
ShapelyPoint(end.x, end.y),
|
||||
])
|
||||
doctrine = self.game.faction_for(flight.departure.captured).doctrine
|
||||
bubble = line.buffer(doctrine.cap_engagement_range.meters)
|
||||
self.flight_path_items.append(self.draw_shapely_poly(
|
||||
scene, bubble, CONST.COLORS["yellow"], CONST.COLORS["transparent"]
|
||||
))
|
||||
|
||||
def draw_waypoint(self, scene: QGraphicsScene,
|
||||
position: Tuple[float, float], player: bool,
|
||||
selected: bool) -> None:
|
||||
|
||||
Reference in New Issue
Block a user