summaryrefslogtreecommitdiff
path: root/src/airport_gui.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-07 23:06:23 +0100
committerPatric Stout <github@truebrain.nl>2021-01-08 16:43:51 +0100
commitaf22a4f2cda86a7667578281a51ea1ec08a49af6 (patch)
treeef59fd78c7d3e2b68594bfbe22b43a6abaf0001e /src/airport_gui.cpp
parent85a49a0d3605b83b911c57c6e5cc9d8b79365131 (diff)
downloadopenttd-af22a4f2cda86a7667578281a51ea1ec08a49af6.tar.xz
Add: show in the tooltip of disabled toolbar buttons why they are disabled
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r--src/airport_gui.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index 62eca78f9..e12b8dccb 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -97,6 +97,11 @@ struct BuildAirToolbarWindow : Window {
WIDGET_LIST_END);
if (!can_build) {
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_AIR);
+
+ /* Show in the tooltip why this button is disabled. */
+ this->GetWidget<NWidgetCore>(WID_AT_AIRPORT)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE);
+ } else {
+ this->GetWidget<NWidgetCore>(WID_AT_AIRPORT)->SetToolTip(STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP);
}
}