mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
New mission briefing menu, work in progress.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from PySide2.QtWidgets import QGridLayout, QLabel, QGroupBox, QVBoxLayout
|
||||
|
||||
from game import db
|
||||
from qt_ui.uiconstants import AIRCRAFT_ICONS, VEHICLES_ICONS
|
||||
from theater import ControlPoint, Airport
|
||||
|
||||
|
||||
@@ -26,7 +28,14 @@ class QBaseInformation(QGroupBox):
|
||||
|
||||
i = 0
|
||||
for k,v in unit_dict.items():
|
||||
self.layout.addWidget(QLabel(str(v) + " x " + k), i, 0)
|
||||
icon = QLabel()
|
||||
if k in VEHICLES_ICONS.keys():
|
||||
icon.setPixmap(VEHICLES_ICONS[k])
|
||||
else:
|
||||
icon.setText("<b>"+k[:6]+"</b>")
|
||||
icon.setProperty("style", "icon-plane")
|
||||
self.layout.addWidget(icon, i, 0)
|
||||
self.layout.addWidget(QLabel(str(v) + " x " + k), i, 1)
|
||||
i = i + 1
|
||||
|
||||
stretch = QVBoxLayout()
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
from PySide2.QtWidgets import QGridLayout, QLabel, QGroupBox, QVBoxLayout, QHBoxLayout
|
||||
|
||||
from game import db
|
||||
from gen.flights.ai_flight_planner import FlightPlanner
|
||||
|
||||
|
||||
class QPlannedFlightView(QGroupBox):
|
||||
|
||||
def __init__(self, flight_planner:FlightPlanner):
|
||||
super(QPlannedFlightView, self).__init__("Planned flights")
|
||||
self.flight_planner = flight_planner
|
||||
self.init_ui()
|
||||
|
||||
def init_ui(self):
|
||||
self.layout = QGridLayout()
|
||||
|
||||
for i,f in enumerate(self.flight_planner.flights):
|
||||
ftype = QLabel("<b>" + f.flight_type.name + "</b>")
|
||||
count = QLabel(str(f.count) + " x " + db.unit_type_name(f.unit_type))
|
||||
sched = QLabel(" in " + str(f.scheduled_in) + " minutes")
|
||||
|
||||
self.layout.addWidget(ftype, i, 0)
|
||||
self.layout.addWidget(count, i, 1)
|
||||
self.layout.addWidget(sched, i, 2)
|
||||
|
||||
stretch = QVBoxLayout()
|
||||
stretch.addStretch()
|
||||
self.layout.addLayout(stretch, len(self.flight_planner.flights)+1, 0)
|
||||
self.setLayout(self.layout)
|
||||
Reference in New Issue
Block a user