mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Mission planning has been completely redone. Missions are now planned by right clicking the target area and choosing "New package". A package can include multiple flights for the same objective. Right now the automatic flight planner is only fragging single-flight packages in the same manner that it used to, but that can be improved now. The air tasking order (ATO) is now the left bar of the main UI. This shows every fragged package, and the flights in the selected package. The info bar that was previously on the left is now a smaller bar at the bottom of the screen. The old "Mission Planning" button is now just the "Take Off" button. The flight plan display no longer shows enemy flight plans. That could be re-added if needed, probably with a difficulty/cheat option. Aircraft inventories have been disassociated from the Planner class. Aircraft inventories are now stored globally in the Game object. Save games made prior to this update will not be compatible do to the changes in how aircraft inventories and planned flights are stored.
64 lines
2.1 KiB
Python
64 lines
2.1 KiB
Python
from PySide2.QtCore import Qt
|
|
from PySide2.QtWidgets import (
|
|
QFrame,
|
|
QGridLayout,
|
|
QScrollArea,
|
|
QVBoxLayout,
|
|
QWidget,
|
|
)
|
|
|
|
from game.event import UnitsDeliveryEvent
|
|
from qt_ui.models import GameModel
|
|
from qt_ui.windows.basemenu.QRecruitBehaviour import QRecruitBehaviour
|
|
from theater import ControlPoint, PinpointStrike, db
|
|
|
|
|
|
class QArmorRecruitmentMenu(QFrame, QRecruitBehaviour):
|
|
|
|
def __init__(self, cp: ControlPoint, game_model: GameModel):
|
|
QFrame.__init__(self)
|
|
self.cp = cp
|
|
self.game_model = game_model
|
|
|
|
self.bought_amount_labels = {}
|
|
self.existing_units_labels = {}
|
|
|
|
for event in self.game_model.game.events:
|
|
if event.__class__ == UnitsDeliveryEvent and event.from_cp == self.cp:
|
|
self.deliveryEvent = event
|
|
if not self.deliveryEvent:
|
|
self.deliveryEvent = self.game_model.game.units_delivery_event(self.cp)
|
|
|
|
self.init_ui()
|
|
|
|
def init_ui(self):
|
|
main_layout = QVBoxLayout()
|
|
|
|
units = {
|
|
PinpointStrike: db.find_unittype(PinpointStrike,
|
|
self.game_model.game.player_name),
|
|
}
|
|
|
|
scroll_content = QWidget()
|
|
task_box_layout = QGridLayout()
|
|
scroll_content.setLayout(task_box_layout)
|
|
row = 0
|
|
|
|
for task_type in units.keys():
|
|
units_column = list(set(units[task_type]))
|
|
if len(units_column) == 0: continue
|
|
units_column.sort(key=lambda x: db.PRICES[x])
|
|
for unit_type in units_column:
|
|
row = self.add_purchase_row(unit_type, task_box_layout, row)
|
|
stretch = QVBoxLayout()
|
|
stretch.addStretch()
|
|
task_box_layout.addLayout(stretch, row, 0)
|
|
|
|
scroll_content.setLayout(task_box_layout)
|
|
scroll = QScrollArea()
|
|
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
|
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
|
|
scroll.setWidgetResizable(True)
|
|
scroll.setWidget(scroll_content)
|
|
main_layout.addWidget(scroll)
|
|
self.setLayout(main_layout) |