diff --git a/changelog.md b/changelog.md index 13d5a3ab..585b81c4 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ Saves from 9.x are not compatible with 10.0.0. ## Features/Improvements * **[Engine]** Support for DCS 2.9.2.49629 Open Beta. (F-15E JDAM and JSOW, F-16 AIM-9P, updated Falklands and Normandy airfields). +* **[UI]** Improved the description of "runway" state for FARPs, FOBs, carriers, and off-map spawns. ## Fixes diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index efa88516..2b71df9a 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -271,15 +271,15 @@ class RunwayStatus: def needs_repair(self) -> bool: return self.damaged and self.repair_turns_remaining is None - def __str__(self) -> str: + def describe(self) -> str: if not self.damaged: - return "Runway operational" + return "operational" turns_remaining = self.repair_turns_remaining if turns_remaining is None: - return "Runway damaged" + return "damaged" - return f"Runway repairing, {turns_remaining} turns remaining" + return f"repairing, {turns_remaining} turns remaining" @total_ordering @@ -915,6 +915,10 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC): def runway_status(self) -> RunwayStatus: ... + @abstractmethod + def describe_runway_status(self) -> str | None: + """Description of the runway status suitable for UI use.""" + @property def runway_can_be_repaired(self) -> bool: return self.runway_status.needs_repair @@ -1157,6 +1161,9 @@ class Airfield(ControlPoint): def runway_status(self) -> RunwayStatus: return self._runway_status + def describe_runway_status(self) -> str: + return f"Runway {self.runway_status.describe()}" + def damage_runway(self) -> None: self.runway_status.damage() @@ -1275,6 +1282,9 @@ class NavalControlPoint(ControlPoint, ABC): def runway_status(self) -> RunwayStatus: return RunwayStatus(damaged=not self.runway_is_operational()) + def describe_runway_status(self) -> str: + return f"Flight deck {self.runway_status.describe()}" + @property def runway_can_be_repaired(self) -> bool: return False @@ -1428,6 +1438,9 @@ class OffMapSpawn(ControlPoint): def runway_status(self) -> RunwayStatus: return RunwayStatus() + def describe_runway_status(self) -> str: + return f"Off-map airport {self.runway_status.describe()}" + @property def can_deploy_ground_units(self) -> bool: return False @@ -1474,6 +1487,11 @@ class Fob(ControlPoint): def runway_status(self) -> RunwayStatus: return RunwayStatus() + def describe_runway_status(self) -> str | None: + if not self.has_helipads: + return None + return f"FARP {self.runway_status.describe()}" + def mission_types(self, for_player: bool) -> Iterator[FlightType]: from game.ato import FlightType diff --git a/qt_ui/windows/basemenu/QBaseMenu2.py b/qt_ui/windows/basemenu/QBaseMenu2.py index 5540a3f5..f93d33a1 100644 --- a/qt_ui/windows/basemenu/QBaseMenu2.py +++ b/qt_ui/windows/basemenu/QBaseMenu2.py @@ -254,19 +254,22 @@ class QBaseMenu2(QDialog): f" (Up to {ground_unit_limit} deployable, {unit_overage} reserve)" ) - self.intel_summary.setText( - "\n".join( - [ - f"{aircraft}/{parking} aircraft", - f"{self.cp.base.total_armor} ground units" + deployable_unit_info, - f"{allocated.total_transferring} more ground units en route, {allocated.total_ordered} ordered", - 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'}", - ] - ) + intel_lines = [ + f"{aircraft}/{parking} aircraft", + f"{self.cp.base.total_armor} ground units" + deployable_unit_info, + f"{allocated.total_transferring} more ground units en route, {allocated.total_ordered} ordered", + ] + if (runway_description := self.cp.describe_runway_status()) is not None: + intel_lines.append(runway_description) + intel_lines.extend( + [ + 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'}", + ] ) + self.intel_summary.setText("\n".join(intel_lines)) + def generate_intel_tooltip(self) -> str: tooltip = ( f"Deployable unit limit ({self.cp.frontline_unit_count_limit}) = {FREE_FRONTLINE_UNIT_SUPPLY} (base) + "