forked from mirror/OpenTTD
(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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user