mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Follow up work: * Data entry. I plan to do the air-to-air missiles in the near term. I covered some variants of the AIM-120, AIM-7, and AIM-9 here, but there are variants of those weapons for each mounting rack that need to be done still, as well as all the non-US weapons. * Arbitrary start dates. https://github.com/Khopa/dcs_liberation/issues/490
44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
from PySide2.QtWidgets import (
|
|
QGridLayout,
|
|
QGroupBox,
|
|
QLabel,
|
|
QSizePolicy,
|
|
QVBoxLayout,
|
|
)
|
|
|
|
from game import Game
|
|
from game.data.weapons import Pylon
|
|
from gen.flights.flight import Flight
|
|
from qt_ui.windows.mission.flight.payload.QPylonEditor import QPylonEditor
|
|
|
|
|
|
class QLoadoutEditor(QGroupBox):
|
|
|
|
def __init__(self, flight: Flight, game: Game) -> None:
|
|
super().__init__("Use custom loadout")
|
|
self.flight = flight
|
|
self.game = game
|
|
self.setCheckable(True)
|
|
self.setChecked(flight.use_custom_loadout)
|
|
|
|
self.toggled.connect(self.on_toggle)
|
|
|
|
hboxLayout = QVBoxLayout(self)
|
|
layout = QGridLayout(self)
|
|
|
|
for i, pylon in enumerate(Pylon.iter_pylons(self.flight.unit_type)):
|
|
label = QLabel(f"<b>{pylon.number}</b>")
|
|
label.setSizePolicy(
|
|
QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
|
|
layout.addWidget(label, i, 0)
|
|
layout.addWidget(QPylonEditor(game, flight, pylon), i, 1)
|
|
|
|
hboxLayout.addLayout(layout)
|
|
hboxLayout.addStretch()
|
|
self.setLayout(hboxLayout)
|
|
|
|
def on_toggle(self):
|
|
self.flight.use_custom_loadout = self.isChecked()
|
|
|
|
|