diff options
author | Patric Stout <truebrain@openttd.org> | 2021-01-08 19:48:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 19:48:39 +0100 |
commit | 7ba0fa4bf01ff7e9f08a10a83c27243733f0a18c (patch) | |
tree | d57153273c19f8ed012e42b4de16048082f9a2bc /src/dock_gui.cpp | |
parent | 0f1d338dda71df118b9dc380dca942915e184317 (diff) | |
download | openttd-7ba0fa4bf01ff7e9f08a10a83c27243733f0a18c.tar.xz |
Fix af22a4f2: scenario editor doesn't have build station/depot/etc (#8529)
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r-- | src/dock_gui.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 39237f5ca..9fe8c7875 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -125,15 +125,19 @@ struct BuildDocksToolbarWindow : Window { if (!can_build) { DeleteWindowById(WC_BUILD_STATION, TRANSPORT_WATER); DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_WATER); + } - /* Show in the tooltip why this button is disabled. */ - this->GetWidget<NWidgetCore>(WID_DT_DEPOT)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE); - this->GetWidget<NWidgetCore>(WID_DT_STATION)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE); - this->GetWidget<NWidgetCore>(WID_DT_BUOY)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE); - } else { - this->GetWidget<NWidgetCore>(WID_DT_DEPOT)->SetToolTip(STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP); - this->GetWidget<NWidgetCore>(WID_DT_STATION)->SetToolTip(STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP); - this->GetWidget<NWidgetCore>(WID_DT_BUOY)->SetToolTip(STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP); + if (_game_mode != GM_EDITOR) { + if (!can_build) { + /* Show in the tooltip why this button is disabled. */ + this->GetWidget<NWidgetCore>(WID_DT_DEPOT)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE); + this->GetWidget<NWidgetCore>(WID_DT_STATION)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE); + this->GetWidget<NWidgetCore>(WID_DT_BUOY)->SetToolTip(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE); + } else { + this->GetWidget<NWidgetCore>(WID_DT_DEPOT)->SetToolTip(STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP); + this->GetWidget<NWidgetCore>(WID_DT_STATION)->SetToolTip(STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP); + this->GetWidget<NWidgetCore>(WID_DT_BUOY)->SetToolTip(STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP); + } } } |