mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Top bar layout, added some icons and possible to pass turn
This commit is contained in:
parent
89e8ef65ea
commit
8246c8e94b
@ -3,17 +3,17 @@
|
||||
QLiberationWindow{
|
||||
}
|
||||
|
||||
/*QTopPanel,
|
||||
QTopPanel,
|
||||
QTopPanel *{
|
||||
background-color: #4E5760;
|
||||
color: white;
|
||||
/*background-color: #4E5760;*/
|
||||
/*color: white;*/
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton[style="btn-primary"]{
|
||||
background-color:#699245;
|
||||
color:white;
|
||||
padding: 21px 5px 21px 5px;
|
||||
margin-top: 6px;
|
||||
}*/
|
||||
/*background-color:#699245;*/
|
||||
/*color:white;*/
|
||||
/*padding: 21px 5px 21px 5px;
|
||||
margin-top: 6px;*/
|
||||
}
|
||||
@ -51,6 +51,8 @@ def load_icons():
|
||||
|
||||
ICONS["Money"] = QPixmap("./resources/ui/misc/money_icon.png")
|
||||
ICONS["PassTurn"] = QPixmap("./resources/ui/misc/pass_turn.png")
|
||||
ICONS["Settings"] = QPixmap("./resources/ui/misc/settings.png")
|
||||
ICONS["Statistics"] = QPixmap("./resources/ui/misc/statistics.png")
|
||||
ICONS["Ordnance"] = QPixmap("./resources/ui/misc/ordnance_icon.png")
|
||||
|
||||
ICONS["target"] = QPixmap("./resources/ui/ground_assets/target.png")
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from PySide2.QtWidgets import QFrame, QHBoxLayout, QPushButton
|
||||
from PySide2.QtWidgets import QFrame, QHBoxLayout, QPushButton, QVBoxLayout, QMessageBox
|
||||
|
||||
from game import Game
|
||||
from qt_ui.widgets.QBudgetBox import QBudgetBox
|
||||
@ -21,13 +21,44 @@ class QTopPanel(QFrame):
|
||||
self.budgetBox = QBudgetBox()
|
||||
self.budgetBox.setBudget(self.game.budget, self.game.budget_reward_amount)
|
||||
|
||||
self.passTurn = QPushButton("Pass Turn")
|
||||
self.passTurn.setIcon(CONST.ICONS["PassTurn"])
|
||||
self.passTurn.setProperty("style", "btn-primary")
|
||||
self.passTurnButton = QPushButton("Pass Turn")
|
||||
self.passTurnButton.setIcon(CONST.ICONS["PassTurn"])
|
||||
self.passTurnButton.setProperty("style", "btn-primary")
|
||||
self.passTurnButton.clicked.connect(self.passTurn)
|
||||
|
||||
self.submenus = QVBoxLayout()
|
||||
self.settings = QPushButton("Settings")
|
||||
self.settings.setIcon(CONST.ICONS["Settings"])
|
||||
self.settings.setProperty("style", "btn-primary")
|
||||
self.settings.clicked.connect(self.openSettings)
|
||||
|
||||
self.statistics = QPushButton("Statistics")
|
||||
self.statistics.setIcon(CONST.ICONS["Statistics"])
|
||||
self.statistics.setProperty("style", "btn-primary")
|
||||
self.statistics.clicked.connect(self.openStatisticsWindow)
|
||||
|
||||
self.submenus.addWidget(self.settings)
|
||||
self.submenus.addWidget(self.statistics)
|
||||
|
||||
self.layout = QHBoxLayout()
|
||||
self.layout.addStretch(1)
|
||||
self.layout.addLayout(self.submenus)
|
||||
self.layout.addWidget(self.turnCounter)
|
||||
self.layout.addWidget(self.budgetBox)
|
||||
self.layout.addWidget(self.passTurn)
|
||||
self.setLayout(self.layout)
|
||||
self.layout.addWidget(self.passTurnButton)
|
||||
self.setLayout(self.layout)
|
||||
|
||||
def setGame(self, game:Game):
|
||||
self.game = game
|
||||
self.turnCounter.setCurrentTurn(self.game.turn, self.game.current_day)
|
||||
self.budgetBox.setBudget(self.game.budget, self.game.budget_reward_amount)
|
||||
|
||||
def openSettings(self):
|
||||
QMessageBox.information(self, "Settings", "Todo open game settings")
|
||||
|
||||
def openStatisticsWindow(self):
|
||||
QMessageBox.information(self, "Stats", "Todo open stats window")
|
||||
|
||||
def passTurn(self):
|
||||
self.game.pass_turn()
|
||||
self.setGame(self.game)
|
||||
BIN
resources/ui/misc/pass_turn.png
Normal file
BIN
resources/ui/misc/pass_turn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 334 B |
BIN
resources/ui/misc/settings.png
Normal file
BIN
resources/ui/misc/settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 799 B |
BIN
resources/ui/misc/statistics.png
Normal file
BIN
resources/ui/misc/statistics.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 665 B |
Loading…
x
Reference in New Issue
Block a user