mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
WIP
This commit is contained in:
@@ -35,8 +35,8 @@ class QBaseMenu2(QDialog):
|
||||
|
||||
self.setWindowFlags(Qt.WindowStaysOnTopHint)
|
||||
self.setMinimumSize(300, 200)
|
||||
self.setMinimumWidth(680)
|
||||
self.setMaximumWidth(680)
|
||||
self.setMinimumWidth(800)
|
||||
self.setMaximumWidth(800)
|
||||
self.setModal(True)
|
||||
self.initUi()
|
||||
|
||||
@@ -50,7 +50,7 @@ class QBaseMenu2(QDialog):
|
||||
|
||||
header = QLabel(self)
|
||||
header.setGeometry(0, 0, 655, 106)
|
||||
pixmap = QPixmap("./resources/ui/airbase.png")
|
||||
pixmap = QPixmap(self.get_base_image())
|
||||
header.setPixmap(pixmap)
|
||||
|
||||
title = QLabel("<b>" + self.cp.name + "</b>")
|
||||
@@ -75,7 +75,6 @@ class QBaseMenu2(QDialog):
|
||||
def closeEvent(self, closeEvent:QCloseEvent):
|
||||
GameUpdateSignal.get_instance().updateGame(self.game)
|
||||
|
||||
|
||||
def get_base_image(self):
|
||||
if self.cp.cptype == ControlPointType.AIRCRAFT_CARRIER_GROUP:
|
||||
return "./resources/ui/carrier.png"
|
||||
|
||||
@@ -33,10 +33,12 @@ class QMissionPlanning(QDialog):
|
||||
self.select_airbase = QChooseAirbase(self.game)
|
||||
self.select_airbase.selected_airbase_changed.connect(self.on_departure_cp_changed)
|
||||
self.planned_flight_view = QPlannedFlightsView(None)
|
||||
self.available_aircraft_at_selected_location = {}
|
||||
if self.captured_cp[0].id in self.game.planners.keys():
|
||||
self.planner = self.game.planners[self.captured_cp[0].id]
|
||||
self.planned_flight_view.set_flight_planner(self.planner)
|
||||
self.selected_cp = self.captured_cp[0]
|
||||
self.available_aircraft_at_selected_location = self.planner.get_available_aircraft()
|
||||
|
||||
self.planned_flight_view.selectionModel().setCurrentIndex(self.planned_flight_view.indexAt(QPoint(1, 1)), QItemSelectionModel.Rows)
|
||||
self.planned_flight_view.selectionModel().selectionChanged.connect(self.on_flight_selection_change)
|
||||
@@ -82,8 +84,10 @@ class QMissionPlanning(QDialog):
|
||||
if len(cps) == 1:
|
||||
self.selected_cp = cps[0]
|
||||
self.planner = self.game.planners[cps[0].id]
|
||||
self.available_aircraft_at_selected_location = self.planner.get_available_aircraft()
|
||||
self.planned_flight_view.set_flight_planner(self.planner)
|
||||
else:
|
||||
self.available_aircraft_at_selected_location = {}
|
||||
self.planned_flight_view.set_flight_planner(None)
|
||||
|
||||
def on_flight_selection_change(self):
|
||||
|
||||
@@ -40,7 +40,8 @@ class QFlightCreator(QDialog):
|
||||
for aircraft_type in self.planner.get_available_aircraft().keys():
|
||||
print(aircraft_type)
|
||||
print(aircraft_type.name)
|
||||
self.select_type_aircraft.addItem(aircraft_type.id, userData=aircraft_type)
|
||||
if self.available[aircraft_type] > 0:
|
||||
self.select_type_aircraft.addItem(aircraft_type.id, userData=aircraft_type)
|
||||
self.select_type_aircraft.setCurrentIndex(0)
|
||||
|
||||
self.select_flight_type = QComboBox()
|
||||
@@ -61,6 +62,11 @@ class QFlightCreator(QDialog):
|
||||
self.select_count_of_aircraft.setMaximum(4)
|
||||
self.select_count_of_aircraft.setValue(2)
|
||||
|
||||
aircraft_type = self.select_type_aircraft.currentData()
|
||||
if aircraft_type is not None:
|
||||
self.select_count_of_aircraft.setValue(min(self.available[aircraft_type], 2))
|
||||
self.select_count_of_aircraft.setMaximum(min(self.available[aircraft_type], 4))
|
||||
|
||||
self.add_button = QPushButton("Add")
|
||||
self.add_button.clicked.connect(self.create_flight)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user