Helicopter waypoint altitude configurable (#207)

* Helicopter waypoint altitude configurable

Added a new option in Settings: Helicopter waypoint altitude (feet AGL).
It sets the waypoint altitude for helicopters in feet AGL. In campaigns in more mountainous areas, you might want to increase this setting to avoid the AI flying into the terrain.

* black?

* Distinguish cruise/combat altitudes for helicopters

Also includes a refactor for WaypointBuilder so it doesn't need a coalition. It can already reference the coalition from the flight.

* Update changelog.md

---------

Co-authored-by: Raffson <Raffson@users.noreply.github.com>
This commit is contained in:
MetalStormGhost
2023-10-02 19:54:21 +03:00
committed by GitHub
parent 226a171550
commit 54777a9045
19 changed files with 123 additions and 50 deletions

View File

@@ -84,7 +84,9 @@ class PilotSelector(QComboBox):
self.roster.set_pilot(self.pilot_index, pilot)
self.available_pilots_changed.emit()
def replace(self, squadron: Optional[Squadron], new_roster: Optional[FlightRoster]) -> None:
def replace(
self, squadron: Optional[Squadron], new_roster: Optional[FlightRoster]
) -> None:
self.squadron = squadron
self.roster = new_roster
self.rebuild()
@@ -159,7 +161,9 @@ class PilotControls(QHBoxLayout):
finally:
self.player_checkbox.blockSignals(False)
def replace(self, squadron: Optional[Squadron], new_roster: Optional[FlightRoster]) -> None:
def replace(
self, squadron: Optional[Squadron], new_roster: Optional[FlightRoster]
) -> None:
self.roster = new_roster
if self.roster is None or self.pilot_index >= self.roster.max_size:
self.disable_and_clear()

View File

@@ -194,7 +194,7 @@ class QFlightWaypointTab(QFrame):
self.on_change()
def on_rtb_waypoint(self):
rtb = WaypointBuilder(self.flight, self.coalition).land(self.flight.arrival)
rtb = WaypointBuilder(self.flight).land(self.flight.arrival)
self.degrade_to_custom_flight_plan()
assert isinstance(self.flight.flight_plan, CustomFlightPlan)
self.flight.flight_plan.layout.custom_waypoints.append(rtb)