mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add basic intel window.
Currently only shows the enemy's economic information. https://github.com/Khopa/dcs_liberation/issues/658
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtWidgets import QGroupBox, QHBoxLayout, QLabel, QVBoxLayout
|
||||
from PySide2.QtWidgets import (
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
QVBoxLayout,
|
||||
)
|
||||
|
||||
from game import Game
|
||||
from qt_ui.windows.intel import IntelWindow
|
||||
|
||||
|
||||
class QIntelBox(QGroupBox):
|
||||
@@ -21,8 +28,14 @@ class QIntelBox(QGroupBox):
|
||||
self.total_ground_forces = QLabel()
|
||||
summary.addWidget(self.total_ground_forces)
|
||||
|
||||
details = QPushButton("Details")
|
||||
columns.addWidget(details)
|
||||
details.clicked.connect(self.open_details_window)
|
||||
|
||||
self.update_summary()
|
||||
|
||||
self.details_window: Optional[IntelWindow] = None
|
||||
|
||||
def set_game(self, game: Optional[Game]) -> None:
|
||||
self.game = game
|
||||
self.update_summary()
|
||||
@@ -38,3 +51,7 @@ class QIntelBox(QGroupBox):
|
||||
self.total_aircraft.setText(f"Total enemy aircraft: {aircraft}")
|
||||
self.total_ground_forces.setText(
|
||||
f"Total enemy ground units: {ground_units}")
|
||||
|
||||
def open_details_window(self) -> None:
|
||||
self.details_window = IntelWindow(self.game)
|
||||
self.details_window.show()
|
||||
|
||||
Reference in New Issue
Block a user