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:
Dan Albert
2020-12-25 03:19:20 -08:00
parent b53cac4c7a
commit 1d76ee4871
7 changed files with 198 additions and 78 deletions

View File

@@ -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()