Skip to content

Commit

Permalink
add most aircraft to multi-slot selection
Browse files Browse the repository at this point in the history
  • Loading branch information
spencershepard committed Feb 17, 2024
1 parent 1ff8992 commit c3b6d83
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
21 changes: 15 additions & 6 deletions Generator/MissionGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
16 changes: 15 additions & 1 deletion Generator/RotorOpsUnits.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,18 @@

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
]



0 comments on commit c3b6d83

Please sign in to comment.