mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Improved layout for airbase window layout.
Fixed missing icons for some windows.
This commit is contained in:
parent
6b77e1cce5
commit
4c3ff906ff
@ -1130,7 +1130,7 @@ FACTIONS = {
|
||||
]
|
||||
},
|
||||
|
||||
"USA 1944 (WIP)": {
|
||||
"USA 1944 (WIP) (Require WW2 Pack)": {
|
||||
"country": "USA",
|
||||
"side": "blue",
|
||||
"units": [
|
||||
@ -1150,7 +1150,7 @@ FACTIONS = {
|
||||
]
|
||||
},
|
||||
|
||||
"Germany 1944 (WIP)": {
|
||||
"Germany 1944 (WIP) (Require WW2 Pack)": {
|
||||
"country": "Russia", # WIP
|
||||
"side": "red",
|
||||
"units": [
|
||||
@ -1405,6 +1405,8 @@ def task_name(task) -> str:
|
||||
return "AirDefence"
|
||||
elif task == Embarking:
|
||||
return "Transportation"
|
||||
elif task == PinpointStrike:
|
||||
return "Ground units"
|
||||
else:
|
||||
return task.name
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ if __name__ == "__main__":
|
||||
app.processEvents()
|
||||
|
||||
# Uncomment to apply CSS (need works)
|
||||
#app.setStyleSheet(css)
|
||||
app.setStyleSheet(css)
|
||||
|
||||
GameUpdateSignal()
|
||||
|
||||
|
||||
@ -72,6 +72,11 @@ def load_icons():
|
||||
ICONS["Missile"] = QPixmap("./resources/ui/misc/missile.png")
|
||||
ICONS["Cheat"] = QPixmap("./resources/ui/misc/cheat.png")
|
||||
|
||||
ICONS["TaskCAS"] = QPixmap("./resources/ui/tasks/cas.png")
|
||||
ICONS["TaskCAP"] = QPixmap("./resources/ui/tasks/cap.png")
|
||||
ICONS["TaskSEAD"] = QPixmap("./resources/ui/tasks/sead.png")
|
||||
ICONS["TaskEmpty"] = QPixmap("./resources/ui/tasks/empty.png")
|
||||
|
||||
|
||||
EVENT_ICONS: Dict[str, QPixmap] = {}
|
||||
|
||||
|
||||
@ -59,13 +59,11 @@ class QBaseMenu(QDialog):
|
||||
Embarking: db.find_unittype(Embarking, self.game.player_name),
|
||||
CAS: db.find_unittype(CAS, self.game.player_name),
|
||||
PinpointStrike: db.find_unittype(PinpointStrike, self.game.player_name),
|
||||
AirDefence: db.find_unittype(AirDefence, self.game.player_name),
|
||||
}
|
||||
else:
|
||||
units = {
|
||||
CAP: db.find_unittype(CAP, self.game.enemy_name),
|
||||
Embarking: db.find_unittype(Embarking, self.game.enemy_name),
|
||||
AirDefence: db.find_unittype(AirDefence, self.game.enemy_name),
|
||||
CAS: db.find_unittype(CAS, self.game.enemy_name),
|
||||
PinpointStrike: db.find_unittype(PinpointStrike, self.game.enemy_name),
|
||||
}
|
||||
@ -76,12 +74,12 @@ class QBaseMenu(QDialog):
|
||||
tasks = list(units.keys())
|
||||
tasks_per_column = 3
|
||||
|
||||
self.unitLayout = QGridLayout()
|
||||
self.unitLayout = QVBoxLayout()
|
||||
self.bought_amount_labels = {}
|
||||
|
||||
row = 0
|
||||
|
||||
def add_purchase_row(unit_type):
|
||||
def add_purchase_row(unit_type, layout):
|
||||
|
||||
nonlocal row
|
||||
existing_units = self.cp.base.total_units_of_type(unit_type)
|
||||
@ -94,16 +92,18 @@ class QBaseMenu(QDialog):
|
||||
price = QLabel("{}m".format(db.PRICES[unit_type]))
|
||||
|
||||
buy = QPushButton("+")
|
||||
buy.setProperty("style", "btn-success")
|
||||
buy.clicked.connect(lambda: self.buy(unit_type))
|
||||
|
||||
sell = QPushButton("-")
|
||||
sell.setProperty("style", "btn-danger")
|
||||
sell.clicked.connect(lambda: self.sell(unit_type))
|
||||
|
||||
self.unitLayout.addWidget(unitName, row, 0)
|
||||
self.unitLayout.addWidget(amountBought, row, 1)
|
||||
self.unitLayout.addWidget(price, row, 2)
|
||||
self.unitLayout.addWidget(buy, row, 3)
|
||||
self.unitLayout.addWidget(sell, row, 4)
|
||||
layout.addWidget(unitName, row, 0)
|
||||
layout.addWidget(amountBought, row, 1)
|
||||
layout.addWidget(price, row, 2)
|
||||
layout.addWidget(buy, row, 3)
|
||||
layout.addWidget(sell, row, 4)
|
||||
|
||||
row = row + 1
|
||||
|
||||
@ -115,12 +115,14 @@ class QBaseMenu(QDialog):
|
||||
if len(units_column) == 0: continue
|
||||
units_column.sort(key=lambda x: db.PRICES[x])
|
||||
|
||||
taskTypeLabel = QLabel("<b>{}</b>".format(db.task_name(task_type)))
|
||||
self.unitLayout.addWidget(taskTypeLabel, row, 0)
|
||||
row = row + 1
|
||||
|
||||
taskBox = QGroupBox("{}".format(db.task_name(task_type)))
|
||||
taskBoxLayout = QGridLayout()
|
||||
taskBox.setLayout(taskBoxLayout)
|
||||
row = 0
|
||||
for unit_type in units_column:
|
||||
add_purchase_row(unit_type)
|
||||
add_purchase_row(unit_type, taskBoxLayout)
|
||||
|
||||
self.unitLayout.addWidget(taskBox)
|
||||
self.mainLayout.addLayout(self.unitLayout)
|
||||
else:
|
||||
intel = QGroupBox("Intel")
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
import os
|
||||
|
||||
from PySide2 import QtCore
|
||||
from PySide2.QtGui import QMovie
|
||||
from PySide2.QtGui import QIcon
|
||||
from PySide2.QtWidgets import QLabel, QDialog, QVBoxLayout, QGroupBox, QGridLayout, QPushButton
|
||||
|
||||
from game.game import Event, db, Game
|
||||
from userdata.debriefing import wait_for_debriefing, Debriefing
|
||||
from userdata.persistency import base_path
|
||||
from userdata.debriefing import Debriefing
|
||||
|
||||
|
||||
class QDebriefingWindow(QDialog):
|
||||
@ -17,6 +13,7 @@ class QDebriefingWindow(QDialog):
|
||||
self.setModal(True)
|
||||
self.setWindowTitle("Debriefing")
|
||||
self.setMinimumSize(300, 200)
|
||||
self.setWindowIcon(QIcon("./resources/icon.png"))
|
||||
|
||||
self.game = game
|
||||
self.gameEvent = gameEvent
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import os
|
||||
|
||||
from PySide2 import QtCore
|
||||
from PySide2.QtGui import QMovie
|
||||
from PySide2.QtGui import QMovie, QIcon
|
||||
from PySide2.QtWidgets import QLabel, QDialog, QVBoxLayout
|
||||
|
||||
from game.game import Event, Game
|
||||
@ -19,6 +19,7 @@ class QWaitingForMissionResultWindow(QDialog):
|
||||
self.game = game
|
||||
self.setWindowTitle("Waiting for mission completion.")
|
||||
self.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, False)
|
||||
self.setWindowIcon(QIcon("./resources/icon.png"))
|
||||
|
||||
self.initUi()
|
||||
wait_for_debriefing(lambda debriefing: self.process_debriefing(debriefing))
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
QWidget {
|
||||
/*QWidget {
|
||||
background-color: #4E5760;
|
||||
color:white;
|
||||
}
|
||||
@ -21,22 +21,39 @@ QTopPanel *{
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}*/
|
||||
|
||||
QPushButton[style="btn-primary"]{
|
||||
QPushButton[style="btn-success"]{
|
||||
background-color:#699245;
|
||||
color: white;
|
||||
cursor:pointer;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius:2px;
|
||||
border-radius:5px;
|
||||
}
|
||||
|
||||
QPushButton[style="btn-primary"]:hover{
|
||||
background-color:#f00;
|
||||
QPushButton[style="btn-success"]:hover{
|
||||
background-color:#8ABC5A;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius:2px;
|
||||
border-radius:5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
QBaseMenu{
|
||||
QPushButton[style="btn-danger"]{
|
||||
background-color:#9E3232;
|
||||
color: white;
|
||||
cursor:pointer;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius:5px;
|
||||
}
|
||||
|
||||
QPushButton[style="btn-danger"]:hover{
|
||||
background-color:#D84545;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius:5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*QBaseMenu{
|
||||
background-color:#699245;
|
||||
color:white;
|
||||
}
|
||||
@ -44,4 +61,4 @@ QBaseMenu{
|
||||
QWidget[style="baseMenuHeader"]{
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}*/
|
||||
BIN
resources/ui/ground_assets/aa_blue.png
Normal file
BIN
resources/ui/ground_assets/aa_blue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 B |
BIN
resources/ui/tasks/cap.png
Normal file
BIN
resources/ui/tasks/cap.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 718 B |
BIN
resources/ui/tasks/cas.png
Normal file
BIN
resources/ui/tasks/cas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 551 B |
BIN
resources/ui/tasks/empty.png
Normal file
BIN
resources/ui/tasks/empty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 217 B |
BIN
resources/ui/tasks/sead.png
Normal file
BIN
resources/ui/tasks/sead.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 572 B |
Loading…
x
Reference in New Issue
Block a user