Change: always allow to click on the toolbar icons for road/rail/dock/airport
This change allows a user to see what is available and what will become available before it is available, instead of only disabling the button with no further explanation. It also always allows building roads and canals, even if no vehicles are available for road / water. For rail/road/tram, a dropdown with available types is shown. If none are available, it reads "None". If the type is not yet available, it is greyed out. For dock/airport, this always open the toolbar, but building airports, docks, and depots buttons are disabled till vehicles are available for those. Road is the only exception, with the primary road always being available. Here too, stations and depots are disabled till vehicles become available. It does mean you can now always build roads to for example help towns grow.
This commit is contained in:

committed by
Patric Stout

parent
a6aec252b1
commit
85a49a0d36
@@ -2033,11 +2033,6 @@ struct MainToolbarWindow : Window {
|
||||
this->SetWidgetDisabledState(WID_TN_GOAL, Goal::GetNumItems() == 0);
|
||||
this->SetWidgetDisabledState(WID_TN_STORY, StoryPage::GetNumItems() == 0);
|
||||
|
||||
this->SetWidgetDisabledState(WID_TN_RAILS, !CanBuildVehicleInfrastructure(VEH_TRAIN));
|
||||
this->SetWidgetDisabledState(WID_TN_ROADS, !CanBuildVehicleInfrastructure(VEH_ROAD, RTT_ROAD));
|
||||
this->SetWidgetDisabledState(WID_TN_TRAMS, !CanBuildVehicleInfrastructure(VEH_ROAD, RTT_TRAM));
|
||||
this->SetWidgetDisabledState(WID_TN_AIR, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT));
|
||||
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
@@ -2078,11 +2073,11 @@ struct MainToolbarWindow : Window {
|
||||
case MTHK_AIRCRAFT_LIST: ShowVehicleListWindow(_local_company, VEH_AIRCRAFT); break;
|
||||
case MTHK_ZOOM_IN: ToolbarZoomInClick(this); break;
|
||||
case MTHK_ZOOM_OUT: ToolbarZoomOutClick(this); break;
|
||||
case MTHK_BUILD_RAIL: if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype); break;
|
||||
case MTHK_BUILD_RAIL: ShowBuildRailToolbar(_last_built_railtype); break;
|
||||
case MTHK_BUILD_ROAD: ShowBuildRoadToolbar(_last_built_roadtype); break;
|
||||
case MTHK_BUILD_TRAM: if (CanBuildVehicleInfrastructure(VEH_ROAD, RTT_TRAM)) ShowBuildRoadToolbar(_last_built_tramtype); break;
|
||||
case MTHK_BUILD_TRAM: ShowBuildRoadToolbar(_last_built_tramtype); break;
|
||||
case MTHK_BUILD_DOCKS: ShowBuildDocksToolbar(); break;
|
||||
case MTHK_BUILD_AIRPORT: if (CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) ShowBuildAirToolbar(); break;
|
||||
case MTHK_BUILD_AIRPORT: ShowBuildAirToolbar(); break;
|
||||
case MTHK_BUILD_TREES: ShowBuildTreesToolbar(); break;
|
||||
case MTHK_MUSIC: ShowMusicWindow(); break;
|
||||
case MTHK_AI_DEBUG: ShowAIDebugWindow(); break;
|
||||
|
Reference in New Issue
Block a user