From 91bde9dccf5a636f9e13deda3cb888299ee0a864 Mon Sep 17 00:00:00 2001 From: Chris Seagraves <47610393+nosv1@users.noreply.github.com> Date: Wed, 30 Jun 2021 14:22:14 -0500 Subject: [PATCH] Add Cloud Base Altitude to Weather Display (#1371) Adds tooltip with cloud base altitude to weather panel (cherry picked from commit f80696b7244d2eace20111dacdcb149cb4747055) --- changelog.md | 1 + qt_ui/widgets/QTopPanel.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/changelog.md b/changelog.md index b30a0482..2dbd4b41 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ Saves from 4.0.0 are compatible with 4.0.1. ## Features/Improvements +* **[UI]** Hovering over the weather information now dispalys the cloud base (meters and feet). * **[UI]** Google search link added to unit information when there is no information provided. ## Fixes diff --git a/qt_ui/widgets/QTopPanel.py b/qt_ui/widgets/QTopPanel.py index a00b6044..83959b12 100644 --- a/qt_ui/widgets/QTopPanel.py +++ b/qt_ui/widgets/QTopPanel.py @@ -13,6 +13,7 @@ import qt_ui.uiconstants as CONST from game import Game from game.event.airwar import AirWarEvent from game.profiling import logged_duration +from game.utils import meters from gen.ato import Package from gen.flights.traveltime import TotEstimator from qt_ui.models import GameModel @@ -112,6 +113,11 @@ class QTopPanel(QFrame): self.transfers.setEnabled(True) self.conditionsWidget.setCurrentTurn(game.turn, game.conditions) + + base_m = game.conditions.weather.clouds.base + base_ft = int(meters(base_m).feet) + self.conditionsWidget.setToolTip(f"Cloud Base: {base_m}m / {base_ft}ft") + self.intel_box.set_game(game) self.budgetBox.setGame(game) self.factionsInfos.setGame(game)