(svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88)
This commit is contained in:
@@ -338,11 +338,18 @@ struct BuildRoadToolbarWindow : Window {
|
||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_ROAD),
|
||||
|
||||
bool can_build = CanBuildVehicleInfrastructure(VEH_ROAD);
|
||||
this->SetWidgetsDisabledState(!can_build,
|
||||
WID_ROT_DEPOT,
|
||||
WID_ROT_BUS_STATION,
|
||||
WID_ROT_TRUCK_STATION,
|
||||
WIDGET_LIST_END);
|
||||
if (!can_build) {
|
||||
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD);
|
||||
DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD);
|
||||
DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user