summaryrefslogtreecommitdiff
path: root/src/dock_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r--src/dock_gui.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index 069fd3bbb..7062a6456 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -173,6 +173,7 @@ struct BuildDocksToolbarWindow : Window {
BuildDocksToolbarWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
{
this->InitNested(desc, window_number);
+ this->OnInvalidateData();
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
}
@@ -181,9 +182,17 @@ struct BuildDocksToolbarWindow : Window {
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}
+ void OnInvalidateData(int data = 0)
+ {
+ this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_SHIP),
+ DTW_DEPOT,
+ DTW_STATION,
+ DTW_BUOY,
+ WIDGET_LIST_END);
+ }
+
virtual void OnPaint()
{
- this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_SHIP), DTW_DEPOT, DTW_STATION, DTW_BUOY, WIDGET_LIST_END);
this->DrawWidgets();
}