Display a "No aircraft available" message.

If in the create flight dialog, there are no suitable aircraft for a task, or no aircraft left at all, a suitable message is now shown that prevents the user from creating a flight.

Also adds in a quick "remember what plane the user had selected last" feature.
This commit is contained in:
Simon Clark
2021-01-13 12:11:53 +00:00
parent c40ad75fa2
commit 1e1cebc3fc
2 changed files with 9 additions and 1 deletions

View File

@@ -117,6 +117,8 @@ class QFlightCreator(QDialog):
arrival: ControlPoint = self.arrival.currentData()
divert: ControlPoint = self.divert.currentData()
size: int = self.flight_size_spinner.value()
if aircraft == None:
return "You must select an aircraft type."
if not origin.captured:
return f"{origin.name} is not owned by your coalition."
if arrival is not None and not arrival.captured: