(svn r20856) -Fix [FS#4141]: Road/water toolbars did not get updated when the first vehicle of their type becomes available.

This commit is contained in:
terkhen
2010-09-28 21:58:06 +00:00
parent 97c0b40ab7
commit 897bb71621
3 changed files with 28 additions and 6 deletions

View File

@@ -457,11 +457,7 @@ struct BuildRoadToolbarWindow : Window {
RTW_ONE_WAY,
WIDGET_LIST_END);
this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_ROAD),
RTW_DEPOT,
RTW_BUS_STATION,
RTW_TRUCK_STATION,
WIDGET_LIST_END);
this->OnInvalidateData();
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
}
@@ -471,6 +467,15 @@ struct BuildRoadToolbarWindow : Window {
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}
void OnInvalidateData(int data = 0)
{
this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_ROAD),
RTW_DEPOT,
RTW_BUS_STATION,
RTW_TRUCK_STATION,
WIDGET_LIST_END);
}
/**
* Update the remove button lowered state of the road toolbar
*