mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix ground object menus for scuds and silkworms.
These really need to be added to the unit data, but this will do as a stop gap since the group generators need an overhaul anyway.
This commit is contained in:
parent
040a3d9b36
commit
933517055e
@ -114,9 +114,12 @@ class QGroundObjectMenu(QDialog):
|
|||||||
dcs_unit_type = vehicles.vehicle_map.get(unit.type)
|
dcs_unit_type = vehicles.vehicle_map.get(unit.type)
|
||||||
if dcs_unit_type is not None:
|
if dcs_unit_type is not None:
|
||||||
# Hack: Don't know which variant is used.
|
# Hack: Don't know which variant is used.
|
||||||
|
try:
|
||||||
unit_display_name = next(
|
unit_display_name = next(
|
||||||
GroundUnitType.for_dcs_type(dcs_unit_type)
|
GroundUnitType.for_dcs_type(dcs_unit_type)
|
||||||
).name
|
).name
|
||||||
|
except StopIteration:
|
||||||
|
pass
|
||||||
self.intelLayout.addWidget(
|
self.intelLayout.addWidget(
|
||||||
QLabel(
|
QLabel(
|
||||||
"<b>Unit #"
|
"<b>Unit #"
|
||||||
@ -136,21 +139,20 @@ class QGroundObjectMenu(QDialog):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Hack: Don't know which variant is used.
|
# Hack: Don't know which variant is used.
|
||||||
|
|
||||||
|
try:
|
||||||
unit_type = next(GroundUnitType.for_dcs_type(dcs_unit_type))
|
unit_type = next(GroundUnitType.for_dcs_type(dcs_unit_type))
|
||||||
|
name = unit_type.name
|
||||||
|
price = unit_type.price
|
||||||
|
except StopIteration:
|
||||||
|
name = dcs_unit_type.name
|
||||||
|
price = 0
|
||||||
|
|
||||||
self.intelLayout.addWidget(
|
self.intelLayout.addWidget(
|
||||||
QLabel(
|
QLabel(f"<b>Unit #{unit.id} - {name}</b> [DEAD]"), i, 0
|
||||||
"<b>Unit #"
|
|
||||||
+ str(unit.id)
|
|
||||||
+ " - "
|
|
||||||
+ str(unit_type)
|
|
||||||
+ "</b> [DEAD]"
|
|
||||||
),
|
|
||||||
i,
|
|
||||||
0,
|
|
||||||
)
|
)
|
||||||
if self.cp.captured:
|
if self.cp.captured:
|
||||||
repair = QPushButton(f"Repair [{unit_type.price}M]")
|
repair = QPushButton(f"Repair [{price}M]")
|
||||||
repair.setProperty("style", "btn-success")
|
repair.setProperty("style", "btn-success")
|
||||||
repair.clicked.connect(
|
repair.clicked.connect(
|
||||||
lambda u=unit, g=g, p=unit_type.price: self.repair_unit(g, u, p)
|
lambda u=unit, g=g, p=unit_type.price: self.repair_unit(g, u, p)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user