* The "remove"-button click proc of the build-rail toolbar. * @param w Build-rail toolbar window * @see BuildRailToolbarWindow::OnClick() */
| 353 | * @see BuildRailToolbarWindow::OnClick() |
| 354 | */ |
| 355 | static void BuildRailClick_Remove(Window *w) |
| 356 | { |
| 357 | if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return; |
| 358 | ToggleRailButton_Remove(w); |
| 359 | SndClickBeep(); |
| 360 | |
| 361 | /* handle station builder */ |
| 362 | if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) { |
| 363 | if (_remove_button_clicked) { |
| 364 | /* starting drag & drop remove */ |
| 365 | if (!_settings_client.gui.station_dragdrop) { |
| 366 | SetTileSelectSize(1, 1); |
| 367 | } else { |
| 368 | VpSetPlaceSizingLimit(-1); |
| 369 | } |
| 370 | } else { |
| 371 | /* starting station build mode */ |
| 372 | if (!_settings_client.gui.station_dragdrop) { |
| 373 | int x = _settings_client.gui.station_numtracks; |
| 374 | int y = _settings_client.gui.station_platlength; |
| 375 | if (_station_gui.axis == 0) std::swap(x, y); |
| 376 | SetTileSelectSize(x, y); |
| 377 | } else { |
| 378 | VpSetPlaceSizingLimit(_settings_game.station.station_spread); |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | static void DoRailroadTrack(Track track) |
| 385 | { |
no test coverage detected