mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix UI to obey max group sizes.
This also adds max group sizes for aircraft that need it but don't according to DCS. Only the first tanker or AEW&C unit in a group can be contacted by radio.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import logging
|
||||
from typing import Optional, Type
|
||||
|
||||
from PySide2.QtCore import Qt, Signal
|
||||
@@ -260,7 +259,12 @@ class QFlightCreator(QDialog):
|
||||
)
|
||||
|
||||
def update_max_size(self, available: int) -> None:
|
||||
self.flight_size_spinner.setMaximum(min(available, 4))
|
||||
aircraft = self.aircraft_selector.currentData()
|
||||
if aircraft is None:
|
||||
self.flight_size_spinner.setMaximum(0)
|
||||
return
|
||||
|
||||
self.flight_size_spinner.setMaximum(min(available, aircraft.max_group_size))
|
||||
|
||||
if self.flight_size_spinner.maximum() >= 2:
|
||||
if self.flight_size_spinner.value() < 2:
|
||||
self.flight_size_spinner.setValue(2)
|
||||
self.flight_size_spinner.setValue(2)
|
||||
|
||||
Reference in New Issue
Block a user