add most aircraft to multi-slot selection

This commit is contained in:
spencershepard 2024-02-16 23:53:10 -08:00 committed by Spencer Shepard
parent 879efef0b6
commit 656d4b22fe
2 changed files with 30 additions and 7 deletions

View File

@ -23,6 +23,7 @@ from PyQt5 import QtGui
from PyQt5.QtGui import QPixmap, QFont
from PyQt5.QtCore import QObject, QEvent, Qt, QUrl
import resources # pyqt resource file
from Generator import aircraftMods
from MissionGeneratorUI import Ui_MainWindow
@ -356,6 +357,7 @@ class Window(QMainWindow, Ui_MainWindow):
for type in RotorOpsUnits.player_helos:
self.slot_template_comboBox.addItem(type.id)
self.slot_template_comboBox.addItem("None")
def slotChanged(self):
@ -756,20 +758,27 @@ class Window(QMainWindow, Ui_MainWindow):
new_slot = QComboBox()
self.slot_boxes.append(new_slot)
self.layout.addWidget(new_slot)
for helo_type in RotorOpsUnits.player_helos:
new_slot.addItem(helo_type.id)
for helicopter_id in sorted(dcs.helicopters.helicopter_map):
if dcs.helicopters.helicopter_map[helicopter_id].flyable:
new_slot.addItem(helicopter_id)
new_slot.addItem(aircraftMods.UH_60L.id)
for plane_id in sorted(dcs.planes.plane_map):
if dcs.planes.plane_map[plane_id].flyable and plane_id not in RotorOpsUnits.low_fidelity_aircraft_ids:
new_slot.addItem(plane_id)
new_slot.setCurrentIndex(0)
# use the aircraft type if provided
if aircraft_type:
if aircraft_type and new_slot.findText(aircraft_type):
new_slot.setCurrentIndex(new_slot.findText(aircraft_type))
# else duplicate the last slot type if it exists
elif len(self.slot_boxes) > 1:
new_slot.setCurrentIndex(self.slot_boxes[-2].currentIndex())
else:
new_slot.setCurrentIndex(0)
def removeSlotBox(self):
last_index = len(self.slot_boxes) - 1

View File

@ -54,4 +54,18 @@ f_fighter_planes = [
e_zone_sams = [
dcs.vehicles.AirDefence.Strela_10M3,
]
]
#flaming cliffs aircraft
low_fidelity_aircraft_ids = [
dcs.planes.F_15C.id,
dcs.planes.Su_27.id,
dcs.planes.Su_33.id,
dcs.planes.MiG_29A.id,
dcs.planes.MiG_29S.id,
dcs.planes.Su_25T.id,
dcs.planes.Su_25TM.id
]