mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add on-leave toggle for pilots.
Pilots on leave will not be assignable to any flights (but will not be unassigned from any already scheduled this turn). https://github.com/dcs-liberation/dcs_liberation/issues/276
This commit is contained in:
@@ -458,6 +458,15 @@ class SquadronModel(QAbstractListModel):
|
||||
pilot.player = not pilot.player
|
||||
self.endResetModel()
|
||||
|
||||
def toggle_leave_state(self, index: QModelIndex) -> None:
|
||||
pilot = self.pilot_at_index(index)
|
||||
self.beginResetModel()
|
||||
if pilot.on_leave:
|
||||
pilot.return_from_leave()
|
||||
else:
|
||||
pilot.send_on_leave()
|
||||
self.endResetModel()
|
||||
|
||||
|
||||
class GameModel:
|
||||
"""A model for the Game object.
|
||||
|
||||
Reference in New Issue
Block a user