|
@@ -210,25 +210,25 @@ static void BuildRoadClick_Demolish(Wind
|
|
|
{
|
|
|
HandlePlacePushButton(w, RTW_DEMOLISH, ANIMCURSOR_DEMOLISH, 1, PlaceRoad_DemolishArea);
|
|
|
}
|
|
|
|
|
|
static void BuildRoadClick_Depot(Window *w)
|
|
|
{
|
|
|
if (_game_mode == GM_EDITOR) return;
|
|
|
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
|
|
if (HandlePlacePushButton(w, RTW_DEPOT, SPR_CURSOR_ROAD_DEPOT, 1, PlaceRoad_Depot)) ShowRoadDepotPicker();
|
|
|
}
|
|
|
|
|
|
static void BuildRoadClick_BusStation(Window *w)
|
|
|
{
|
|
|
if (_game_mode == GM_EDITOR) return;
|
|
|
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
|
|
if (HandlePlacePushButton(w, RTW_BUS_STATION, SPR_CURSOR_BUS_STATION, 1, PlaceRoad_BusStation)) ShowRVStationPicker(RoadStop::BUS);
|
|
|
}
|
|
|
|
|
|
static void BuildRoadClick_TruckStation(Window *w)
|
|
|
{
|
|
|
if (_game_mode == GM_EDITOR) return;
|
|
|
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
|
|
if (HandlePlacePushButton(w, RTW_TRUCK_STATION, SPR_CURSOR_TRUCK_STATION, 1, PlaceRoad_TruckStation)) ShowRVStationPicker(RoadStop::TRUCK);
|
|
|
}
|
|
|
|
|
|
static void BuildRoadClick_Bridge(Window *w)
|
|
|
{
|
|
|
HandlePlacePushButton(w, RTW_BUILD_BRIDGE, SPR_CURSOR_BRIDGE, 1, PlaceRoad_Bridge);
|
|
@@ -267,12 +267,13 @@ static void BuildRoadToolbWndProc(Window
|
|
|
case WE_CREATE: DisableWindowWidget(w, RTW_REMOVE); break;
|
|
|
|
|
|
case WE_PAINT:
|
|
|
if (IsWindowWidgetLowered(w, RTW_ROAD_X) || IsWindowWidgetLowered(w, RTW_ROAD_Y) || IsWindowWidgetLowered(w, RTW_BUS_STATION) || IsWindowWidgetLowered(w, RTW_TRUCK_STATION)) {
|
|
|
EnableWindowWidget(w, RTW_REMOVE);
|
|
|
}
|
|
|
SetWindowWidgetsDisabledState(w, !CanBuildVehicleInfrastructure(VEH_ROAD), 6, 7, 8, WIDGET_LIST_END);
|
|
|
DrawWindowWidgets(w);
|
|
|
break;
|
|
|
|
|
|
case WE_CLICK: {
|
|
|
if (e->we.click.widget >= 3) _build_road_button_proc[e->we.click.widget - 3](w);
|
|
|
} break;
|