| 565 | } |
| 566 | |
| 567 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 568 | { |
| 569 | if (widget < WID_RAT_BUILD_NS) return; |
| 570 | |
| 571 | _remove_button_clicked = false; |
| 572 | switch (widget) { |
| 573 | case WID_RAT_BUILD_NS: |
| 574 | HandlePlacePushButton(this, WID_RAT_BUILD_NS, GetRailTypeInfo(_cur_railtype)->cursor.rail_ns, HT_LINE | HT_DIR_VL); |
| 575 | this->last_user_action = widget; |
| 576 | break; |
| 577 | |
| 578 | case WID_RAT_BUILD_X: |
| 579 | HandlePlacePushButton(this, WID_RAT_BUILD_X, GetRailTypeInfo(_cur_railtype)->cursor.rail_swne, HT_LINE | HT_DIR_X); |
| 580 | this->last_user_action = widget; |
| 581 | break; |
| 582 | |
| 583 | case WID_RAT_BUILD_EW: |
| 584 | HandlePlacePushButton(this, WID_RAT_BUILD_EW, GetRailTypeInfo(_cur_railtype)->cursor.rail_ew, HT_LINE | HT_DIR_HL); |
| 585 | this->last_user_action = widget; |
| 586 | break; |
| 587 | |
| 588 | case WID_RAT_BUILD_Y: |
| 589 | HandlePlacePushButton(this, WID_RAT_BUILD_Y, GetRailTypeInfo(_cur_railtype)->cursor.rail_nwse, HT_LINE | HT_DIR_Y); |
| 590 | this->last_user_action = widget; |
| 591 | break; |
| 592 | |
| 593 | case WID_RAT_AUTORAIL: |
| 594 | HandlePlacePushButton(this, WID_RAT_AUTORAIL, GetRailTypeInfo(_cur_railtype)->cursor.autorail, HT_RAIL); |
| 595 | this->last_user_action = widget; |
| 596 | break; |
| 597 | |
| 598 | case WID_RAT_DEMOLISH: |
| 599 | HandlePlacePushButton(this, WID_RAT_DEMOLISH, ANIMCURSOR_DEMOLISH, HT_RECT | HT_DIAGONAL); |
| 600 | this->last_user_action = widget; |
| 601 | break; |
| 602 | |
| 603 | case WID_RAT_BUILD_DEPOT: |
| 604 | if (HandlePlacePushButton(this, WID_RAT_BUILD_DEPOT, GetRailTypeInfo(_cur_railtype)->cursor.depot, HT_RECT)) { |
| 605 | ShowBuildTrainDepotPicker(this); |
| 606 | this->last_user_action = widget; |
| 607 | } |
| 608 | break; |
| 609 | |
| 610 | case WID_RAT_BUILD_WAYPOINT: |
| 611 | this->last_user_action = widget; |
| 612 | if (HandlePlacePushButton(this, WID_RAT_BUILD_WAYPOINT, SPR_CURSOR_WAYPOINT, HT_RECT)) { |
| 613 | ShowBuildWaypointPicker(this); |
| 614 | } |
| 615 | break; |
| 616 | |
| 617 | case WID_RAT_BUILD_STATION: |
| 618 | if (HandlePlacePushButton(this, WID_RAT_BUILD_STATION, SPR_CURSOR_RAIL_STATION, HT_RECT)) { |
| 619 | ShowStationBuilder(this); |
| 620 | this->last_user_action = widget; |
| 621 | } |
| 622 | break; |
| 623 | |
| 624 | case WID_RAT_BUILD_SIGNALS: { |
nothing calls this directly
no test coverage detected