mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
refactor of previous commits
refactor to enum typing and many other fixes fix tests attempt to fix some typescript more typescript fixes more typescript test fixes revert all API changes update to pydcs mypy fixes Use properties to check if player is blue/red/neutral update requirements.txt black -_- bump pydcs and fix mypy add opponent property bump pydcs
This commit is contained in:
@@ -14,13 +14,14 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from game.debriefing import Debriefing
|
||||
from game.theater import Player
|
||||
from qt_ui.windows.GameUpdateSignal import GameUpdateSignal
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class LossGrid(QGridLayout):
|
||||
def __init__(self, debriefing: Debriefing, player: bool) -> None:
|
||||
def __init__(self, debriefing: Debriefing, player: Player) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.add_loss_rows(
|
||||
@@ -57,8 +58,10 @@ class LossGrid(QGridLayout):
|
||||
|
||||
|
||||
class ScrollingCasualtyReportContainer(QGroupBox):
|
||||
def __init__(self, debriefing: Debriefing, player: bool) -> None:
|
||||
country = debriefing.player_country if player else debriefing.enemy_country
|
||||
def __init__(self, debriefing: Debriefing, player: Player) -> None:
|
||||
country = (
|
||||
debriefing.player_country if player.is_blue else debriefing.enemy_country
|
||||
)
|
||||
super().__init__(f"{country}'s lost units:")
|
||||
scroll_content = QWidget()
|
||||
scroll_content.setLayout(LossGrid(debriefing, player))
|
||||
@@ -91,10 +94,14 @@ class QDebriefingWindow(QDialog):
|
||||
title = QLabel("<b>Casualty report</b>")
|
||||
layout.addWidget(title)
|
||||
|
||||
player_lost_units = ScrollingCasualtyReportContainer(debriefing, player=True)
|
||||
player_lost_units = ScrollingCasualtyReportContainer(
|
||||
debriefing, player=Player.BLUE
|
||||
)
|
||||
layout.addWidget(player_lost_units)
|
||||
|
||||
enemy_lost_units = ScrollingCasualtyReportContainer(debriefing, player=False)
|
||||
enemy_lost_units = ScrollingCasualtyReportContainer(
|
||||
debriefing, player=Player.RED
|
||||
)
|
||||
layout.addWidget(enemy_lost_units, 1)
|
||||
|
||||
okay = QPushButton("Okay")
|
||||
|
||||
Reference in New Issue
Block a user