diff options
author | frosch <frosch@openttd.org> | 2015-02-22 15:26:27 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-02-22 15:26:27 +0000 |
commit | c639fb0d8eb0371a95c39027a986636f1ca8f764 (patch) | |
tree | 65de5e1182f4e5f05a6bd7394e4b71a57a783a32 /src/dock_gui.cpp | |
parent | f26e9bf59dd953ab76bf816ba7aad87638c22c21 (diff) | |
download | openttd-c639fb0d8eb0371a95c39027a986636f1ca8f764.tar.xz |
(svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88)
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r-- | src/dock_gui.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 95145945c..f6699daef 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -116,11 +116,17 @@ struct BuildDocksToolbarWindow : Window { virtual void OnInvalidateData(int data = 0, bool gui_scope = true) { if (!gui_scope) return; - this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_SHIP), + + bool can_build = CanBuildVehicleInfrastructure(VEH_SHIP); + this->SetWidgetsDisabledState(!can_build, WID_DT_DEPOT, WID_DT_STATION, WID_DT_BUOY, WIDGET_LIST_END); + if (!can_build) { + DeleteWindowById(WC_BUILD_STATION, TRANSPORT_WATER); + DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_WATER); + } } virtual void OnClick(Point pt, int widget, int click_count) |