From c3b6d838fcace4f2c2c0c8975a89a43755d8234f Mon Sep 17 00:00:00 2001 From: spencershepard Date: Fri, 16 Feb 2024 23:53:10 -0800 Subject: [PATCH] add most aircraft to multi-slot selection --- Generator/MissionGenerator.py | 21 +++++++++++++++------ Generator/RotorOpsUnits.py | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Generator/MissionGenerator.py b/Generator/MissionGenerator.py index 70b1934..90f04e4 100644 --- a/Generator/MissionGenerator.py +++ b/Generator/MissionGenerator.py @@ -23,6 +23,7 @@ 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 @@ def populateSlotSelection(self): 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 @@ def addSlotBox(self, aircraft_type=None): 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 diff --git a/Generator/RotorOpsUnits.py b/Generator/RotorOpsUnits.py index d0202e4..6e0b832 100644 --- a/Generator/RotorOpsUnits.py +++ b/Generator/RotorOpsUnits.py @@ -54,4 +54,18 @@ e_zone_sams = [ dcs.vehicles.AirDefence.Strela_10M3, -] \ No newline at end of file +] + +#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 + ] + + +