mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Base menu UI : Added ammo depots & factory information (WIP UX)
This commit is contained in:
parent
a43e926dd2
commit
1af95955b6
@ -791,18 +791,27 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def frontline_unit_count_limit(self) -> int:
|
def frontline_unit_count_limit(self) -> int:
|
||||||
|
|
||||||
tally_connected_ammo_depots = 0
|
|
||||||
|
|
||||||
for cp_objective in self.connected_objectives:
|
|
||||||
if cp_objective.category == "ammo" and not cp_objective.is_dead:
|
|
||||||
tally_connected_ammo_depots += 1
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
FREE_FRONTLINE_UNIT_SUPPLY
|
FREE_FRONTLINE_UNIT_SUPPLY
|
||||||
+ tally_connected_ammo_depots * AMMO_DEPOT_FRONTLINE_UNIT_CONTRIBUTION
|
+ self.active_ammo_depots_count * AMMO_DEPOT_FRONTLINE_UNIT_CONTRIBUTION
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def active_ammo_depots_count(self) -> int:
|
||||||
|
"""Return the number of available ammo depots"""
|
||||||
|
return sum(
|
||||||
|
[
|
||||||
|
1
|
||||||
|
for obj in self.connected_objectives
|
||||||
|
if obj.category == "ammo" and not obj.is_dead
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def total_ammo_depots_count(self) -> int:
|
||||||
|
"""Return the number of ammo depots, including dead ones"""
|
||||||
|
return sum([1 for obj in self.connected_objectives if obj.category == "ammo"])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def strike_targets(self) -> List[Union[MissionTarget, Unit]]:
|
def strike_targets(self) -> List[Union[MissionTarget, Unit]]:
|
||||||
return []
|
return []
|
||||||
|
|||||||
@ -201,6 +201,8 @@ class QBaseMenu2(QDialog):
|
|||||||
f"{aircraft}/{parking} aircraft",
|
f"{aircraft}/{parking} aircraft",
|
||||||
f"{self.cp.base.total_armor} ground units",
|
f"{self.cp.base.total_armor} ground units",
|
||||||
str(self.cp.runway_status),
|
str(self.cp.runway_status),
|
||||||
|
f"{self.cp.active_ammo_depots_count}/{self.cp.total_ammo_depots_count} ammo depots",
|
||||||
|
f"{'Factory can produce units' if self.cp.has_factory else 'Does not have a factory'}",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user