improve draw & battle display
This commit is contained in:
parent
93aae78f0d
commit
a9cd4c9e27
19 changed files with 281 additions and 150 deletions
|
|
@ -95,3 +95,6 @@ class BattleDTO:
|
||||||
score: str | None
|
score: str | None
|
||||||
victory_condition: str | None
|
victory_condition: str | None
|
||||||
comment: str | None
|
comment: str | None
|
||||||
|
state_icon: str | None
|
||||||
|
player1_icon: str | None
|
||||||
|
player2_icon: str | None
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ if TYPE_CHECKING:
|
||||||
from warchron.controller.app_controller import AppController
|
from warchron.controller.app_controller import AppController
|
||||||
from warchron.controller.dtos import ParticipantOption, SectorDTO, ChoiceDTO, BattleDTO
|
from warchron.controller.dtos import ParticipantOption, SectorDTO, ChoiceDTO, BattleDTO
|
||||||
from warchron.model.closure_service import ClosureService
|
from warchron.model.closure_service import ClosureService
|
||||||
from warchron.view.choices_dialog import ChoicesDialog
|
from warchron.view.choice_dialog import ChoiceDialog
|
||||||
from warchron.view.battles_dialog import BattlesDialog
|
from warchron.view.battle_dialog import BattleDialog
|
||||||
|
|
||||||
|
|
||||||
class RoundController:
|
class RoundController:
|
||||||
|
|
@ -54,10 +54,14 @@ class RoundController:
|
||||||
battles_for_display: List[BattleDTO] = []
|
battles_for_display: List[BattleDTO] = []
|
||||||
for sect in sectors:
|
for sect in sectors:
|
||||||
battle = rnd.get_battle(sect.id)
|
battle = rnd.get_battle(sect.id)
|
||||||
|
|
||||||
if not battle:
|
if not battle:
|
||||||
battle = self.app.model.create_battle(
|
battle = self.app.model.create_battle(
|
||||||
round_id=rnd.id, sector_id=sect.id
|
round_id=rnd.id, sector_id=sect.id
|
||||||
)
|
)
|
||||||
|
state_icon = ".\\src\\warchron\\view\\ui\\../resources/hourglass.png"
|
||||||
|
if battle.is_finished():
|
||||||
|
state_icon = ".\\src\\warchron\\view\\ui\\../resources/tick.png"
|
||||||
if battle.player_1_id:
|
if battle.player_1_id:
|
||||||
camp_part = camp.participants[battle.player_1_id]
|
camp_part = camp.participants[battle.player_1_id]
|
||||||
player_1_name = self.app.model.get_participant_name(
|
player_1_name = self.app.model.get_participant_name(
|
||||||
|
|
@ -79,6 +83,16 @@ class RoundController:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
winner_name = ""
|
winner_name = ""
|
||||||
|
p1_icon = None
|
||||||
|
p2_icon = None
|
||||||
|
if battle.is_draw():
|
||||||
|
p1_icon = ".\\src\\warchron\\view\\ui\\../resources/balance.png"
|
||||||
|
p2_icon = ".\\src\\warchron\\view\\ui\\../resources/balance.png"
|
||||||
|
elif battle.winner_id:
|
||||||
|
if battle.winner_id == battle.player_1_id:
|
||||||
|
p1_icon = ".\\src\\warchron\\view\\ui\\../resources/trophy.png"
|
||||||
|
elif battle.winner_id == battle.player_2_id:
|
||||||
|
p2_icon = ".\\src\\warchron\\view\\ui\\../resources/trophy.png"
|
||||||
battles_for_display.append(
|
battles_for_display.append(
|
||||||
BattleDTO(
|
BattleDTO(
|
||||||
id=battle.sector_id,
|
id=battle.sector_id,
|
||||||
|
|
@ -89,6 +103,9 @@ class RoundController:
|
||||||
score=battle.score,
|
score=battle.score,
|
||||||
victory_condition=battle.victory_condition,
|
victory_condition=battle.victory_condition,
|
||||||
comment=battle.comment,
|
comment=battle.comment,
|
||||||
|
state_icon=state_icon,
|
||||||
|
player1_icon=p1_icon,
|
||||||
|
player2_icon=p2_icon,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.app.view.display_round_battles(battles_for_display)
|
self.app.view.display_round_battles(battles_for_display)
|
||||||
|
|
@ -143,6 +160,8 @@ class RoundController:
|
||||||
major=war.get_objective_name(sect.major_objective_id),
|
major=war.get_objective_name(sect.major_objective_id),
|
||||||
minor=war.get_objective_name(sect.minor_objective_id),
|
minor=war.get_objective_name(sect.minor_objective_id),
|
||||||
influence=war.get_objective_name(sect.influence_objective_id),
|
influence=war.get_objective_name(sect.influence_objective_id),
|
||||||
|
mission=sect.mission,
|
||||||
|
description=sect.description,
|
||||||
)
|
)
|
||||||
for sect in sectors
|
for sect in sectors
|
||||||
]
|
]
|
||||||
|
|
@ -152,7 +171,7 @@ class RoundController:
|
||||||
participant = camp.participants[choice.participant_id]
|
participant = camp.participants[choice.participant_id]
|
||||||
player = self.app.model.get_player_from_campaign_participant(participant)
|
player = self.app.model.get_player_from_campaign_participant(participant)
|
||||||
part_opt = ParticipantOption(id=participant.id, name=player.name)
|
part_opt = ParticipantOption(id=participant.id, name=player.name)
|
||||||
dialog = ChoicesDialog(
|
dialog = ChoiceDialog(
|
||||||
self.app.view,
|
self.app.view,
|
||||||
participants=[part_opt],
|
participants=[part_opt],
|
||||||
default_participant_id=participant.id,
|
default_participant_id=participant.id,
|
||||||
|
|
@ -192,13 +211,15 @@ class RoundController:
|
||||||
major=war.get_objective_name(sect.major_objective_id),
|
major=war.get_objective_name(sect.major_objective_id),
|
||||||
minor=war.get_objective_name(sect.minor_objective_id),
|
minor=war.get_objective_name(sect.minor_objective_id),
|
||||||
influence=war.get_objective_name(sect.influence_objective_id),
|
influence=war.get_objective_name(sect.influence_objective_id),
|
||||||
|
mission=sect.mission,
|
||||||
|
description=sect.description,
|
||||||
)
|
)
|
||||||
|
|
||||||
part_opts: List[ParticipantOption] = []
|
part_opts: List[ParticipantOption] = []
|
||||||
for participant in participants:
|
for participant in participants:
|
||||||
player = self.app.model.get_player_from_campaign_participant(participant)
|
player = self.app.model.get_player_from_campaign_participant(participant)
|
||||||
part_opts.append(ParticipantOption(id=participant.id, name=player.name))
|
part_opts.append(ParticipantOption(id=participant.id, name=player.name))
|
||||||
dialog = BattlesDialog(
|
dialog = BattleDialog(
|
||||||
self.app.view,
|
self.app.view,
|
||||||
sectors=[sect_dto],
|
sectors=[sect_dto],
|
||||||
default_sector_id=sect.id,
|
default_sector_id=sect.id,
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,20 @@ class Battle:
|
||||||
def set_comment(self, new_comment: str | None) -> None:
|
def set_comment(self, new_comment: str | None) -> None:
|
||||||
self.comment = new_comment
|
self.comment = new_comment
|
||||||
|
|
||||||
# TODO improve draw detection
|
|
||||||
def is_draw(self) -> bool:
|
def is_draw(self) -> bool:
|
||||||
return self.winner_id is None and self.score is not None
|
if self.winner_id is not None:
|
||||||
|
return False
|
||||||
|
# Case 1: score entered → interpreted as unresolved outcome
|
||||||
|
if self.score and self.score.strip():
|
||||||
|
return True
|
||||||
|
# Case 2: explicit draw mention
|
||||||
|
if self.victory_condition:
|
||||||
|
if "draw" in self.victory_condition.casefold():
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def is_finished(self) -> bool:
|
||||||
|
return self.winner_id is not None or self.is_draw()
|
||||||
|
|
||||||
def toDict(self) -> Dict[str, Any]:
|
def toDict(self) -> Dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ from PyQt6.QtWidgets import QWidget, QDialog
|
||||||
|
|
||||||
from warchron.controller.dtos import ParticipantOption, SectorDTO
|
from warchron.controller.dtos import ParticipantOption, SectorDTO
|
||||||
from warchron.view.helpers import select_if_exists
|
from warchron.view.helpers import select_if_exists
|
||||||
from warchron.view.ui.ui_battle_result_dialog import Ui_battleResultDialog
|
from warchron.view.ui.ui_battle_dialog import Ui_battleDialog
|
||||||
|
|
||||||
|
|
||||||
class BattlesDialog(QDialog):
|
class BattleDialog(QDialog):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent: QWidget | None = None,
|
parent: QWidget | None = None,
|
||||||
|
|
@ -23,7 +23,7 @@ class BattlesDialog(QDialog):
|
||||||
default_comment: str | None = None,
|
default_comment: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.ui: Ui_battleResultDialog = Ui_battleResultDialog()
|
self.ui: Ui_battleDialog = Ui_battleDialog()
|
||||||
self.ui.setupUi(self) # type: ignore
|
self.ui.setupUi(self) # type: ignore
|
||||||
for sect in sectors:
|
for sect in sectors:
|
||||||
self.ui.sectorComboBox.addItem(sect.name, sect.id)
|
self.ui.sectorComboBox.addItem(sect.name, sect.id)
|
||||||
|
|
@ -4,10 +4,10 @@ from PyQt6.QtWidgets import QWidget, QDialog
|
||||||
|
|
||||||
from warchron.controller.dtos import ParticipantOption, SectorDTO
|
from warchron.controller.dtos import ParticipantOption, SectorDTO
|
||||||
from warchron.view.helpers import select_if_exists
|
from warchron.view.helpers import select_if_exists
|
||||||
from warchron.view.ui.ui_choices_dialog import Ui_choicesDialog
|
from warchron.view.ui.ui_choice_dialog import Ui_choiceDialog
|
||||||
|
|
||||||
|
|
||||||
class ChoicesDialog(QDialog):
|
class ChoiceDialog(QDialog):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent: QWidget | None = None,
|
parent: QWidget | None = None,
|
||||||
|
|
@ -20,7 +20,7 @@ class ChoicesDialog(QDialog):
|
||||||
default_comment: str | None = None,
|
default_comment: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.ui: Ui_choicesDialog = Ui_choicesDialog()
|
self.ui: Ui_choiceDialog = Ui_choiceDialog()
|
||||||
self.ui.setupUi(self) # type: ignore
|
self.ui.setupUi(self) # type: ignore
|
||||||
for part in participants:
|
for part in participants:
|
||||||
self.ui.playerComboBox.addItem(part.name, part.id)
|
self.ui.playerComboBox.addItem(part.name, part.id)
|
||||||
BIN
src/warchron/view/resources/arrow-switch.png
Normal file
BIN
src/warchron/view/resources/arrow-switch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 877 B |
BIN
src/warchron/view/resources/balance.png
Normal file
BIN
src/warchron/view/resources/balance.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 753 B |
BIN
src/warchron/view/resources/flag-white.png
Normal file
BIN
src/warchron/view/resources/flag-white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 698 B |
BIN
src/warchron/view/resources/hourglass.png
Normal file
BIN
src/warchron/view/resources/hourglass.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 716 B |
BIN
src/warchron/view/resources/tick.png
Normal file
BIN
src/warchron/view/resources/tick.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 634 B |
BIN
src/warchron/view/resources/trophy.png
Normal file
BIN
src/warchron/view/resources/trophy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 846 B |
|
|
@ -9,13 +9,17 @@
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
class Ui_battleResultDialog(object):
|
class Ui_battleDialog(object):
|
||||||
def setupUi(self, battleResultDialog):
|
def setupUi(self, battleResultDialog):
|
||||||
battleResultDialog.setObjectName("battleResultDialog")
|
battleResultDialog.setObjectName("battleResultDialog")
|
||||||
battleResultDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
battleResultDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||||
battleResultDialog.resize(668, 317)
|
battleResultDialog.resize(668, 317)
|
||||||
icon = QtGui.QIcon()
|
icon = QtGui.QIcon()
|
||||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon.addPixmap(
|
||||||
|
QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"),
|
||||||
|
QtGui.QIcon.Mode.Normal,
|
||||||
|
QtGui.QIcon.State.Off,
|
||||||
|
)
|
||||||
battleResultDialog.setWindowIcon(icon)
|
battleResultDialog.setWindowIcon(icon)
|
||||||
self.gridLayout = QtWidgets.QGridLayout(battleResultDialog)
|
self.gridLayout = QtWidgets.QGridLayout(battleResultDialog)
|
||||||
self.gridLayout.setObjectName("gridLayout")
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
|
|
@ -23,10 +27,14 @@ class Ui_battleResultDialog(object):
|
||||||
self.label_7.setObjectName("label_7")
|
self.label_7.setObjectName("label_7")
|
||||||
self.gridLayout.addWidget(self.label_7, 0, 0, 1, 1)
|
self.gridLayout.addWidget(self.label_7, 0, 0, 1, 1)
|
||||||
self.sectorComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
self.sectorComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.sectorComboBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.sectorComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
self.sectorComboBox.setSizePolicy(sizePolicy)
|
self.sectorComboBox.setSizePolicy(sizePolicy)
|
||||||
self.sectorComboBox.setObjectName("sectorComboBox")
|
self.sectorComboBox.setObjectName("sectorComboBox")
|
||||||
self.gridLayout.addWidget(self.sectorComboBox, 0, 1, 1, 1)
|
self.gridLayout.addWidget(self.sectorComboBox, 0, 1, 1, 1)
|
||||||
|
|
@ -34,10 +42,14 @@ class Ui_battleResultDialog(object):
|
||||||
self.label_5.setObjectName("label_5")
|
self.label_5.setObjectName("label_5")
|
||||||
self.gridLayout.addWidget(self.label_5, 0, 2, 1, 1)
|
self.gridLayout.addWidget(self.label_5, 0, 2, 1, 1)
|
||||||
self.player1ComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
self.player1ComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.player1ComboBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.player1ComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
self.player1ComboBox.setSizePolicy(sizePolicy)
|
self.player1ComboBox.setSizePolicy(sizePolicy)
|
||||||
self.player1ComboBox.setObjectName("player1ComboBox")
|
self.player1ComboBox.setObjectName("player1ComboBox")
|
||||||
self.gridLayout.addWidget(self.player1ComboBox, 0, 3, 1, 1)
|
self.gridLayout.addWidget(self.player1ComboBox, 0, 3, 1, 1)
|
||||||
|
|
@ -45,23 +57,36 @@ class Ui_battleResultDialog(object):
|
||||||
self.label_6.setObjectName("label_6")
|
self.label_6.setObjectName("label_6")
|
||||||
self.gridLayout.addWidget(self.label_6, 0, 4, 1, 1)
|
self.gridLayout.addWidget(self.label_6, 0, 4, 1, 1)
|
||||||
self.player2ComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
self.player2ComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.player2ComboBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.player2ComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
self.player2ComboBox.setSizePolicy(sizePolicy)
|
self.player2ComboBox.setSizePolicy(sizePolicy)
|
||||||
self.player2ComboBox.setObjectName("player2ComboBox")
|
self.player2ComboBox.setObjectName("player2ComboBox")
|
||||||
self.gridLayout.addWidget(self.player2ComboBox, 0, 5, 1, 1)
|
self.gridLayout.addWidget(self.player2ComboBox, 0, 5, 1, 1)
|
||||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
spacerItem = QtWidgets.QSpacerItem(
|
||||||
|
20,
|
||||||
|
40,
|
||||||
|
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||||
|
)
|
||||||
self.gridLayout.addItem(spacerItem, 1, 1, 1, 1)
|
self.gridLayout.addItem(spacerItem, 1, 1, 1, 1)
|
||||||
self.label = QtWidgets.QLabel(parent=battleResultDialog)
|
self.label = QtWidgets.QLabel(parent=battleResultDialog)
|
||||||
self.label.setObjectName("label")
|
self.label.setObjectName("label")
|
||||||
self.gridLayout.addWidget(self.label, 2, 0, 1, 1)
|
self.gridLayout.addWidget(self.label, 2, 0, 1, 1)
|
||||||
self.winnerComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
self.winnerComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.winnerComboBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.winnerComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
self.winnerComboBox.setSizePolicy(sizePolicy)
|
self.winnerComboBox.setSizePolicy(sizePolicy)
|
||||||
self.winnerComboBox.setObjectName("winnerComboBox")
|
self.winnerComboBox.setObjectName("winnerComboBox")
|
||||||
self.gridLayout.addWidget(self.winnerComboBox, 2, 1, 1, 1)
|
self.gridLayout.addWidget(self.winnerComboBox, 2, 1, 1, 1)
|
||||||
|
|
@ -85,18 +110,23 @@ class Ui_battleResultDialog(object):
|
||||||
self.gridLayout.addWidget(self.battleComment, 4, 1, 1, 5)
|
self.gridLayout.addWidget(self.battleComment, 4, 1, 1, 5)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=battleResultDialog)
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=battleResultDialog)
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
self.buttonBox.setStandardButtons(
|
||||||
|
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||||
|
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||||
|
)
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
self.gridLayout.addWidget(self.buttonBox, 5, 4, 1, 2)
|
self.gridLayout.addWidget(self.buttonBox, 5, 4, 1, 2)
|
||||||
|
|
||||||
self.retranslateUi(battleResultDialog)
|
self.retranslateUi(battleResultDialog)
|
||||||
self.buttonBox.accepted.connect(battleResultDialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(battleResultDialog.accept) # type: ignore
|
||||||
self.buttonBox.rejected.connect(battleResultDialog.reject) # type: ignore
|
self.buttonBox.rejected.connect(battleResultDialog.reject) # type: ignore
|
||||||
QtCore.QMetaObject.connectSlotsByName(battleResultDialog)
|
QtCore.QMetaObject.connectSlotsByName(battleResultDialog)
|
||||||
|
|
||||||
def retranslateUi(self, battleResultDialog):
|
def retranslateUi(self, battleResultDialog):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
battleResultDialog.setWindowTitle(_translate("battleResultDialog", "Battle result"))
|
battleResultDialog.setWindowTitle(
|
||||||
|
_translate("battleResultDialog", "Battle result")
|
||||||
|
)
|
||||||
self.label_7.setText(_translate("battleResultDialog", "Sector"))
|
self.label_7.setText(_translate("battleResultDialog", "Sector"))
|
||||||
self.label_5.setText(_translate("battleResultDialog", "Player 1"))
|
self.label_5.setText(_translate("battleResultDialog", "Player 1"))
|
||||||
self.label_6.setText(_translate("battleResultDialog", "Player 2"))
|
self.label_6.setText(_translate("battleResultDialog", "Player 2"))
|
||||||
|
|
@ -108,6 +138,7 @@ class Ui_battleResultDialog(object):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
battleResultDialog = QtWidgets.QDialog()
|
battleResultDialog = QtWidgets.QDialog()
|
||||||
ui = Ui_battleResultDialog()
|
ui = Ui_battleResultDialog()
|
||||||
108
src/warchron/view/ui/ui_choice_dialog.py
Normal file
108
src/warchron/view/ui/ui_choice_dialog.py
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_choice_dialog.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt6 UI code generator 6.7.1
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_choiceDialog(object):
|
||||||
|
def setupUi(self, choiceDialog):
|
||||||
|
choiceDialog.setObjectName("choiceDialog")
|
||||||
|
choiceDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||||
|
choiceDialog.resize(561, 246)
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
icon.addPixmap(
|
||||||
|
QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"),
|
||||||
|
QtGui.QIcon.Mode.Normal,
|
||||||
|
QtGui.QIcon.State.Off,
|
||||||
|
)
|
||||||
|
choiceDialog.setWindowIcon(icon)
|
||||||
|
self.gridLayout = QtWidgets.QGridLayout(choiceDialog)
|
||||||
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
|
self.label = QtWidgets.QLabel(parent=choiceDialog)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||||
|
self.playerComboBox = QtWidgets.QComboBox(parent=choiceDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.playerComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
|
self.playerComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.playerComboBox.setObjectName("playerComboBox")
|
||||||
|
self.gridLayout.addWidget(self.playerComboBox, 0, 1, 1, 1)
|
||||||
|
self.label_2 = QtWidgets.QLabel(parent=choiceDialog)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||||
|
self.priorityComboBox = QtWidgets.QComboBox(parent=choiceDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.priorityComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
|
self.priorityComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.priorityComboBox.setObjectName("priorityComboBox")
|
||||||
|
self.gridLayout.addWidget(self.priorityComboBox, 1, 1, 1, 1)
|
||||||
|
self.label_3 = QtWidgets.QLabel(parent=choiceDialog)
|
||||||
|
self.label_3.setObjectName("label_3")
|
||||||
|
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
|
||||||
|
self.secondaryComboBox = QtWidgets.QComboBox(parent=choiceDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(
|
||||||
|
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||||
|
)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.secondaryComboBox.sizePolicy().hasHeightForWidth()
|
||||||
|
)
|
||||||
|
self.secondaryComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.secondaryComboBox.setObjectName("secondaryComboBox")
|
||||||
|
self.gridLayout.addWidget(self.secondaryComboBox, 2, 1, 1, 1)
|
||||||
|
self.label_4 = QtWidgets.QLabel(parent=choiceDialog)
|
||||||
|
self.label_4.setObjectName("label_4")
|
||||||
|
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
|
||||||
|
self.choiceComment = QtWidgets.QPlainTextEdit(parent=choiceDialog)
|
||||||
|
self.choiceComment.setObjectName("choiceComment")
|
||||||
|
self.gridLayout.addWidget(self.choiceComment, 3, 1, 1, 1)
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=choiceDialog)
|
||||||
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
|
self.buttonBox.setStandardButtons(
|
||||||
|
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||||
|
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||||
|
)
|
||||||
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
|
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 2)
|
||||||
|
|
||||||
|
self.retranslateUi(choiceDialog)
|
||||||
|
self.buttonBox.accepted.connect(choiceDialog.accept) # type: ignore
|
||||||
|
self.buttonBox.rejected.connect(choiceDialog.reject) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(choiceDialog)
|
||||||
|
|
||||||
|
def retranslateUi(self, choiceDialog):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
choiceDialog.setWindowTitle(_translate("choiceDialog", "Choices"))
|
||||||
|
self.label.setText(_translate("choiceDialog", "Player"))
|
||||||
|
self.label_2.setText(_translate("choiceDialog", "Priority"))
|
||||||
|
self.label_3.setText(_translate("choiceDialog", "Secondary"))
|
||||||
|
self.label_4.setText(_translate("choiceDialog", "Comment"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import sys
|
||||||
|
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
choiceDialog = QtWidgets.QDialog()
|
||||||
|
ui = Ui_choiceDialog()
|
||||||
|
ui.setupUi(choiceDialog)
|
||||||
|
choiceDialog.show()
|
||||||
|
sys.exit(app.exec())
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>choicesDialog</class>
|
<class>choiceDialog</class>
|
||||||
<widget class="QDialog" name="choicesDialog">
|
<widget class="QDialog" name="choiceDialog">
|
||||||
<property name="windowModality">
|
<property name="windowModality">
|
||||||
<enum>Qt::ApplicationModal</enum>
|
<enum>Qt::ApplicationModal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>choicesDialog</receiver>
|
<receiver>choiceDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>choicesDialog</receiver>
|
<receiver>choiceDialog</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_choices_dialog.ui'
|
|
||||||
#
|
|
||||||
# Created by: PyQt6 UI code generator 6.7.1
|
|
||||||
#
|
|
||||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
|
||||||
# run again. Do not edit this file unless you know what you are doing.
|
|
||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_choicesDialog(object):
|
|
||||||
def setupUi(self, choicesDialog):
|
|
||||||
choicesDialog.setObjectName("choicesDialog")
|
|
||||||
choicesDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
|
||||||
choicesDialog.resize(561, 246)
|
|
||||||
icon = QtGui.QIcon()
|
|
||||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
|
||||||
choicesDialog.setWindowIcon(icon)
|
|
||||||
self.gridLayout = QtWidgets.QGridLayout(choicesDialog)
|
|
||||||
self.gridLayout.setObjectName("gridLayout")
|
|
||||||
self.label = QtWidgets.QLabel(parent=choicesDialog)
|
|
||||||
self.label.setObjectName("label")
|
|
||||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
|
||||||
self.playerComboBox = QtWidgets.QComboBox(parent=choicesDialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.playerComboBox.sizePolicy().hasHeightForWidth())
|
|
||||||
self.playerComboBox.setSizePolicy(sizePolicy)
|
|
||||||
self.playerComboBox.setObjectName("playerComboBox")
|
|
||||||
self.gridLayout.addWidget(self.playerComboBox, 0, 1, 1, 1)
|
|
||||||
self.label_2 = QtWidgets.QLabel(parent=choicesDialog)
|
|
||||||
self.label_2.setObjectName("label_2")
|
|
||||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
|
||||||
self.priorityComboBox = QtWidgets.QComboBox(parent=choicesDialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.priorityComboBox.sizePolicy().hasHeightForWidth())
|
|
||||||
self.priorityComboBox.setSizePolicy(sizePolicy)
|
|
||||||
self.priorityComboBox.setObjectName("priorityComboBox")
|
|
||||||
self.gridLayout.addWidget(self.priorityComboBox, 1, 1, 1, 1)
|
|
||||||
self.label_3 = QtWidgets.QLabel(parent=choicesDialog)
|
|
||||||
self.label_3.setObjectName("label_3")
|
|
||||||
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
|
|
||||||
self.secondaryComboBox = QtWidgets.QComboBox(parent=choicesDialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.secondaryComboBox.sizePolicy().hasHeightForWidth())
|
|
||||||
self.secondaryComboBox.setSizePolicy(sizePolicy)
|
|
||||||
self.secondaryComboBox.setObjectName("secondaryComboBox")
|
|
||||||
self.gridLayout.addWidget(self.secondaryComboBox, 2, 1, 1, 1)
|
|
||||||
self.label_4 = QtWidgets.QLabel(parent=choicesDialog)
|
|
||||||
self.label_4.setObjectName("label_4")
|
|
||||||
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
|
|
||||||
self.choiceComment = QtWidgets.QPlainTextEdit(parent=choicesDialog)
|
|
||||||
self.choiceComment.setObjectName("choiceComment")
|
|
||||||
self.gridLayout.addWidget(self.choiceComment, 3, 1, 1, 1)
|
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=choicesDialog)
|
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
|
||||||
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 2)
|
|
||||||
|
|
||||||
self.retranslateUi(choicesDialog)
|
|
||||||
self.buttonBox.accepted.connect(choicesDialog.accept) # type: ignore
|
|
||||||
self.buttonBox.rejected.connect(choicesDialog.reject) # type: ignore
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(choicesDialog)
|
|
||||||
|
|
||||||
def retranslateUi(self, choicesDialog):
|
|
||||||
_translate = QtCore.QCoreApplication.translate
|
|
||||||
choicesDialog.setWindowTitle(_translate("choicesDialog", "Choices"))
|
|
||||||
self.label.setText(_translate("choicesDialog", "Player"))
|
|
||||||
self.label_2.setText(_translate("choicesDialog", "Priority"))
|
|
||||||
self.label_3.setText(_translate("choicesDialog", "Secondary"))
|
|
||||||
self.label_4.setText(_translate("choicesDialog", "Comment"))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
import sys
|
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
|
||||||
choicesDialog = QtWidgets.QDialog()
|
|
||||||
ui = Ui_choicesDialog()
|
|
||||||
ui.setupUi(choicesDialog)
|
|
||||||
choicesDialog.show()
|
|
||||||
sys.exit(app.exec())
|
|
||||||
|
|
@ -229,6 +229,9 @@ class Ui_MainWindow(object):
|
||||||
self.horizontalLayout_6.addItem(spacerItem10)
|
self.horizontalLayout_6.addItem(spacerItem10)
|
||||||
self.endWarBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
self.endWarBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
||||||
self.endWarBtn.setEnabled(True)
|
self.endWarBtn.setEnabled(True)
|
||||||
|
icon3 = QtGui.QIcon()
|
||||||
|
icon3.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/flag-white.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
|
self.endWarBtn.setIcon(icon3)
|
||||||
self.endWarBtn.setObjectName("endWarBtn")
|
self.endWarBtn.setObjectName("endWarBtn")
|
||||||
self.horizontalLayout_6.addWidget(self.endWarBtn)
|
self.horizontalLayout_6.addWidget(self.endWarBtn)
|
||||||
self.verticalLayout_10.addLayout(self.horizontalLayout_6)
|
self.verticalLayout_10.addLayout(self.horizontalLayout_6)
|
||||||
|
|
@ -329,6 +332,7 @@ class Ui_MainWindow(object):
|
||||||
self.horizontalLayout_10.addItem(spacerItem14)
|
self.horizontalLayout_10.addItem(spacerItem14)
|
||||||
self.endCampaignBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
self.endCampaignBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
||||||
self.endCampaignBtn.setEnabled(True)
|
self.endCampaignBtn.setEnabled(True)
|
||||||
|
self.endCampaignBtn.setIcon(icon3)
|
||||||
self.endCampaignBtn.setObjectName("endCampaignBtn")
|
self.endCampaignBtn.setObjectName("endCampaignBtn")
|
||||||
self.horizontalLayout_10.addWidget(self.endCampaignBtn)
|
self.horizontalLayout_10.addWidget(self.endCampaignBtn)
|
||||||
self.verticalLayout_7.addLayout(self.horizontalLayout_10)
|
self.verticalLayout_7.addLayout(self.horizontalLayout_10)
|
||||||
|
|
@ -372,6 +376,9 @@ class Ui_MainWindow(object):
|
||||||
self.horizontalLayout_13.addItem(spacerItem15)
|
self.horizontalLayout_13.addItem(spacerItem15)
|
||||||
self.resolvePairingBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
self.resolvePairingBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||||
self.resolvePairingBtn.setEnabled(False)
|
self.resolvePairingBtn.setEnabled(False)
|
||||||
|
icon4 = QtGui.QIcon()
|
||||||
|
icon4.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-switch.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
|
self.resolvePairingBtn.setIcon(icon4)
|
||||||
self.resolvePairingBtn.setObjectName("resolvePairingBtn")
|
self.resolvePairingBtn.setObjectName("resolvePairingBtn")
|
||||||
self.horizontalLayout_13.addWidget(self.resolvePairingBtn)
|
self.horizontalLayout_13.addWidget(self.resolvePairingBtn)
|
||||||
self.verticalLayout_8.addLayout(self.horizontalLayout_13)
|
self.verticalLayout_8.addLayout(self.horizontalLayout_13)
|
||||||
|
|
@ -383,7 +390,7 @@ class Ui_MainWindow(object):
|
||||||
self.battlesTable.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
self.battlesTable.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||||
self.battlesTable.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
|
self.battlesTable.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
|
||||||
self.battlesTable.setObjectName("battlesTable")
|
self.battlesTable.setObjectName("battlesTable")
|
||||||
self.battlesTable.setColumnCount(5)
|
self.battlesTable.setColumnCount(6)
|
||||||
self.battlesTable.setRowCount(0)
|
self.battlesTable.setRowCount(0)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.battlesTable.setHorizontalHeaderItem(0, item)
|
self.battlesTable.setHorizontalHeaderItem(0, item)
|
||||||
|
|
@ -395,6 +402,8 @@ class Ui_MainWindow(object):
|
||||||
self.battlesTable.setHorizontalHeaderItem(3, item)
|
self.battlesTable.setHorizontalHeaderItem(3, item)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.battlesTable.setHorizontalHeaderItem(4, item)
|
self.battlesTable.setHorizontalHeaderItem(4, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.battlesTable.setHorizontalHeaderItem(5, item)
|
||||||
self.battlesTable.horizontalHeader().setStretchLastSection(False)
|
self.battlesTable.horizontalHeader().setStretchLastSection(False)
|
||||||
self.horizontalLayout_12.addWidget(self.battlesTable)
|
self.horizontalLayout_12.addWidget(self.battlesTable)
|
||||||
self.verticalLayout_8.addWidget(self.groupBox_6)
|
self.verticalLayout_8.addWidget(self.groupBox_6)
|
||||||
|
|
@ -404,14 +413,15 @@ class Ui_MainWindow(object):
|
||||||
self.horizontalLayout_9.addItem(spacerItem16)
|
self.horizontalLayout_9.addItem(spacerItem16)
|
||||||
self.endRoundBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
self.endRoundBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||||
self.endRoundBtn.setEnabled(True)
|
self.endRoundBtn.setEnabled(True)
|
||||||
|
self.endRoundBtn.setIcon(icon3)
|
||||||
self.endRoundBtn.setObjectName("endRoundBtn")
|
self.endRoundBtn.setObjectName("endRoundBtn")
|
||||||
self.horizontalLayout_9.addWidget(self.endRoundBtn)
|
self.horizontalLayout_9.addWidget(self.endRoundBtn)
|
||||||
self.verticalLayout_8.addLayout(self.horizontalLayout_9)
|
self.verticalLayout_8.addLayout(self.horizontalLayout_9)
|
||||||
self.selectedDetailsStack.addWidget(self.pageRound)
|
self.selectedDetailsStack.addWidget(self.pageRound)
|
||||||
self.verticalLayout_3.addWidget(self.splitter)
|
self.verticalLayout_3.addWidget(self.splitter)
|
||||||
icon3 = QtGui.QIcon()
|
icon5 = QtGui.QIcon()
|
||||||
icon3.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/swords-small.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon5.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/swords-small.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.tabWidget.addTab(self.warsTab, icon3, "")
|
self.tabWidget.addTab(self.warsTab, icon5, "")
|
||||||
self.verticalLayout_9.addWidget(self.tabWidget)
|
self.verticalLayout_9.addWidget(self.tabWidget)
|
||||||
MainWindow.setCentralWidget(self.centralwidget)
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
||||||
|
|
@ -428,52 +438,52 @@ class Ui_MainWindow(object):
|
||||||
self.statusbar.setObjectName("statusbar")
|
self.statusbar.setObjectName("statusbar")
|
||||||
MainWindow.setStatusBar(self.statusbar)
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
self.actionNew = QtGui.QAction(parent=MainWindow)
|
self.actionNew = QtGui.QAction(parent=MainWindow)
|
||||||
icon4 = QtGui.QIcon()
|
icon6 = QtGui.QIcon()
|
||||||
icon4.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/document.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon6.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/document.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionNew.setIcon(icon4)
|
self.actionNew.setIcon(icon6)
|
||||||
self.actionNew.setObjectName("actionNew")
|
self.actionNew.setObjectName("actionNew")
|
||||||
self.actionOpen = QtGui.QAction(parent=MainWindow)
|
self.actionOpen = QtGui.QAction(parent=MainWindow)
|
||||||
icon5 = QtGui.QIcon()
|
icon7 = QtGui.QIcon()
|
||||||
icon5.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/folder.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon7.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/folder.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionOpen.setIcon(icon5)
|
self.actionOpen.setIcon(icon7)
|
||||||
self.actionOpen.setObjectName("actionOpen")
|
self.actionOpen.setObjectName("actionOpen")
|
||||||
self.actionSave = QtGui.QAction(parent=MainWindow)
|
self.actionSave = QtGui.QAction(parent=MainWindow)
|
||||||
icon6 = QtGui.QIcon()
|
icon8 = QtGui.QIcon()
|
||||||
icon6.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/disk.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon8.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/disk.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionSave.setIcon(icon6)
|
self.actionSave.setIcon(icon8)
|
||||||
self.actionSave.setObjectName("actionSave")
|
self.actionSave.setObjectName("actionSave")
|
||||||
self.actionExit = QtGui.QAction(parent=MainWindow)
|
self.actionExit = QtGui.QAction(parent=MainWindow)
|
||||||
icon7 = QtGui.QIcon()
|
icon9 = QtGui.QIcon()
|
||||||
icon7.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/door--arrow.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon9.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/door--arrow.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionExit.setIcon(icon7)
|
self.actionExit.setIcon(icon9)
|
||||||
self.actionExit.setObjectName("actionExit")
|
self.actionExit.setObjectName("actionExit")
|
||||||
self.actionUndo = QtGui.QAction(parent=MainWindow)
|
self.actionUndo = QtGui.QAction(parent=MainWindow)
|
||||||
self.actionUndo.setEnabled(False)
|
self.actionUndo.setEnabled(False)
|
||||||
icon8 = QtGui.QIcon()
|
icon10 = QtGui.QIcon()
|
||||||
icon8.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-curve-180-left.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon10.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-curve-180-left.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionUndo.setIcon(icon8)
|
self.actionUndo.setIcon(icon10)
|
||||||
self.actionUndo.setObjectName("actionUndo")
|
self.actionUndo.setObjectName("actionUndo")
|
||||||
self.actionRedo = QtGui.QAction(parent=MainWindow)
|
self.actionRedo = QtGui.QAction(parent=MainWindow)
|
||||||
self.actionRedo.setEnabled(False)
|
self.actionRedo.setEnabled(False)
|
||||||
icon9 = QtGui.QIcon()
|
icon11 = QtGui.QIcon()
|
||||||
icon9.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-curve.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon11.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-curve.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionRedo.setIcon(icon9)
|
self.actionRedo.setIcon(icon11)
|
||||||
self.actionRedo.setObjectName("actionRedo")
|
self.actionRedo.setObjectName("actionRedo")
|
||||||
self.actionAbout = QtGui.QAction(parent=MainWindow)
|
self.actionAbout = QtGui.QAction(parent=MainWindow)
|
||||||
icon10 = QtGui.QIcon()
|
icon12 = QtGui.QIcon()
|
||||||
icon10.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/question.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon12.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/question.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionAbout.setIcon(icon10)
|
self.actionAbout.setIcon(icon12)
|
||||||
self.actionAbout.setObjectName("actionAbout")
|
self.actionAbout.setObjectName("actionAbout")
|
||||||
self.actionExport = QtGui.QAction(parent=MainWindow)
|
self.actionExport = QtGui.QAction(parent=MainWindow)
|
||||||
self.actionExport.setEnabled(False)
|
self.actionExport.setEnabled(False)
|
||||||
icon11 = QtGui.QIcon()
|
icon13 = QtGui.QIcon()
|
||||||
icon11.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/notebook--arrow.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon13.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/notebook--arrow.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionExport.setIcon(icon11)
|
self.actionExport.setIcon(icon13)
|
||||||
self.actionExport.setObjectName("actionExport")
|
self.actionExport.setObjectName("actionExport")
|
||||||
self.actionSave_as = QtGui.QAction(parent=MainWindow)
|
self.actionSave_as = QtGui.QAction(parent=MainWindow)
|
||||||
icon12 = QtGui.QIcon()
|
icon14 = QtGui.QIcon()
|
||||||
icon12.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/disk--pencil.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon14.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/disk--pencil.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.actionSave_as.setIcon(icon12)
|
self.actionSave_as.setIcon(icon14)
|
||||||
self.actionSave_as.setObjectName("actionSave_as")
|
self.actionSave_as.setObjectName("actionSave_as")
|
||||||
self.menuFile.addAction(self.actionNew)
|
self.menuFile.addAction(self.actionNew)
|
||||||
self.menuFile.addAction(self.actionOpen)
|
self.menuFile.addAction(self.actionOpen)
|
||||||
|
|
@ -597,6 +607,8 @@ class Ui_MainWindow(object):
|
||||||
item.setText(_translate("MainWindow", "Score"))
|
item.setText(_translate("MainWindow", "Score"))
|
||||||
item = self.battlesTable.horizontalHeaderItem(4)
|
item = self.battlesTable.horizontalHeaderItem(4)
|
||||||
item.setText(_translate("MainWindow", "Victory condition"))
|
item.setText(_translate("MainWindow", "Victory condition"))
|
||||||
|
item = self.battlesTable.horizontalHeaderItem(5)
|
||||||
|
item.setText(_translate("MainWindow", "Comment"))
|
||||||
self.endRoundBtn.setText(_translate("MainWindow", "End round"))
|
self.endRoundBtn.setText(_translate("MainWindow", "End round"))
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.warsTab), _translate("MainWindow", "Wars"))
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.warsTab), _translate("MainWindow", "Wars"))
|
||||||
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
||||||
|
|
|
||||||
|
|
@ -552,6 +552,10 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>End war</string>
|
<string>End war</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>../resources/flag-white.png</normaloff>../resources/flag-white.png</iconset>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -793,6 +797,10 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>End campaign</string>
|
<string>End campaign</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>../resources/flag-white.png</normaloff>../resources/flag-white.png</iconset>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -883,6 +891,10 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Resolve pairing</string>
|
<string>Resolve pairing</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>../resources/arrow-switch.png</normaloff>../resources/arrow-switch.png</iconset>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -932,6 +944,11 @@
|
||||||
<string>Victory condition</string>
|
<string>Victory condition</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Comment</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -960,6 +977,10 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>End round</string>
|
<string>End round</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>../resources/flag-white.png</normaloff>../resources/flag-white.png</iconset>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
|
|
@ -529,10 +529,22 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
table.setRowCount(len(sectors))
|
table.setRowCount(len(sectors))
|
||||||
for row, battle in enumerate(sectors):
|
for row, battle in enumerate(sectors):
|
||||||
sector_item = QtWidgets.QTableWidgetItem(battle.sector_name)
|
sector_item = QtWidgets.QTableWidgetItem(battle.sector_name)
|
||||||
|
if battle.state_icon:
|
||||||
|
sector_item.setIcon(QIcon(battle.state_icon))
|
||||||
player_1_item = QtWidgets.QTableWidgetItem(battle.player_1)
|
player_1_item = QtWidgets.QTableWidgetItem(battle.player_1)
|
||||||
|
if battle.player1_icon:
|
||||||
|
player_1_item.setIcon(QIcon(battle.player1_icon))
|
||||||
player_2_item = QtWidgets.QTableWidgetItem(battle.player_2)
|
player_2_item = QtWidgets.QTableWidgetItem(battle.player_2)
|
||||||
|
if battle.player2_icon:
|
||||||
|
player_2_item.setIcon(QIcon(battle.player2_icon))
|
||||||
|
score_item = QtWidgets.QTableWidgetItem(battle.score)
|
||||||
|
vp_item = QtWidgets.QTableWidgetItem(battle.victory_condition)
|
||||||
|
comment_item = QtWidgets.QTableWidgetItem(battle.comment)
|
||||||
sector_item.setData(Qt.ItemDataRole.UserRole, battle.id)
|
sector_item.setData(Qt.ItemDataRole.UserRole, battle.id)
|
||||||
table.setItem(row, 0, sector_item)
|
table.setItem(row, 0, sector_item)
|
||||||
table.setItem(row, 1, player_1_item)
|
table.setItem(row, 1, player_1_item)
|
||||||
table.setItem(row, 2, player_2_item)
|
table.setItem(row, 2, player_2_item)
|
||||||
|
table.setItem(row, 3, score_item)
|
||||||
|
table.setItem(row, 4, vp_item)
|
||||||
|
table.setItem(row, 5, comment_item)
|
||||||
table.resizeColumnsToContents()
|
table.resizeColumnsToContents()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue