mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +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:
44
qt_ui/windows/intel.py
Normal file
44
qt_ui/windows/intel.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from PySide2.QtWidgets import (
|
||||
QDialog,
|
||||
QGroupBox,
|
||||
QScrollArea, QVBoxLayout, QWidget,
|
||||
)
|
||||
|
||||
from game.game import Game
|
||||
from qt_ui.uiconstants import ICONS
|
||||
from qt_ui.windows.finances.QFinancesMenu import FinancesLayout
|
||||
|
||||
|
||||
class EconomyIntelBox(QGroupBox):
|
||||
def __init__(self, game: Game) -> None:
|
||||
super().__init__("Economy")
|
||||
|
||||
widget = QWidget()
|
||||
scroll_area = QScrollArea()
|
||||
scroll_area.setWidgetResizable(True)
|
||||
scroll_area.setWidget(widget)
|
||||
|
||||
scrolling_layout = QVBoxLayout()
|
||||
widget.setLayout(scrolling_layout)
|
||||
|
||||
self.setLayout(QVBoxLayout())
|
||||
self.layout().addWidget(scroll_area)
|
||||
|
||||
scrolling_layout.addLayout(FinancesLayout(game, player=False))
|
||||
|
||||
|
||||
class IntelWindow(QDialog):
|
||||
|
||||
def __init__(self, game: Game):
|
||||
super().__init__()
|
||||
|
||||
self.game = game
|
||||
self.setModal(True)
|
||||
self.setWindowTitle("Intelligence")
|
||||
self.setWindowIcon(ICONS["Statistics"])
|
||||
self.setMinimumSize(600, 250)
|
||||
|
||||
layout = QVBoxLayout()
|
||||
self.setLayout(layout)
|
||||
|
||||
layout.addWidget(EconomyIntelBox(game))
|
||||
Reference in New Issue
Block a user