@@ -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();
@@ -605,6 +605,10 @@ static void AcceptEnginePreview(EngineID
if (company == _local_company) {
AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
/* Update the toolbar. */
if (e->type == VEH_ROAD) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_ROAD);
if (e->type == VEH_SHIP) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_WATER);
/**
@@ -749,6 +753,10 @@ static void NewVehicleAvailable(Engine *
SetDParam(0, GetEngineCategoryName(index));
SetDParam(1, index);
AddNewsItem(STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE, NS_NEW_VEHICLES, NR_ENGINE, index);
void EnginesMonthlyLoop()
@@ -457,11 +457,7 @@ struct BuildRoadToolbarWindow : Window {
RTW_ONE_WAY,
this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_ROAD),
RTW_DEPOT,
RTW_BUS_STATION,
RTW_TRUCK_STATION,
@@ -471,6 +467,15 @@ struct BuildRoadToolbarWindow : Window {
* Update the remove button lowered state of the road toolbar
*
Status change: