| 569 | } |
| 570 | |
| 571 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 572 | { |
| 573 | if (widget < WID_ETT_BUTTONS_START) return; |
| 574 | |
| 575 | switch (widget) { |
| 576 | case WID_ETT_DEMOLISH: // Demolish aka dynamite button |
| 577 | HandlePlacePushButton(this, WID_ETT_DEMOLISH, ANIMCURSOR_DEMOLISH, HT_RECT | HT_DIAGONAL); |
| 578 | this->last_user_action = widget; |
| 579 | break; |
| 580 | |
| 581 | case WID_ETT_LOWER_LAND: // Lower land button |
| 582 | HandlePlacePushButton(this, WID_ETT_LOWER_LAND, ANIMCURSOR_LOWERLAND, HT_POINT); |
| 583 | this->last_user_action = widget; |
| 584 | break; |
| 585 | |
| 586 | case WID_ETT_RAISE_LAND: // Raise land button |
| 587 | HandlePlacePushButton(this, WID_ETT_RAISE_LAND, ANIMCURSOR_RAISELAND, HT_POINT); |
| 588 | this->last_user_action = widget; |
| 589 | break; |
| 590 | |
| 591 | case WID_ETT_LEVEL_LAND: // Level land button |
| 592 | HandlePlacePushButton(this, WID_ETT_LEVEL_LAND, SPR_CURSOR_LEVEL_LAND, HT_POINT | HT_DIAGONAL); |
| 593 | this->last_user_action = widget; |
| 594 | break; |
| 595 | |
| 596 | case WID_ETT_PLACE_ROCKS: // Place rocks button |
| 597 | HandlePlacePushButton(this, WID_ETT_PLACE_ROCKS, SPR_CURSOR_ROCKY_AREA, HT_RECT); |
| 598 | this->last_user_action = widget; |
| 599 | break; |
| 600 | |
| 601 | case WID_ETT_PLACE_DESERT: // Place desert button (in tropical climate) |
| 602 | HandlePlacePushButton(this, WID_ETT_PLACE_DESERT, SPR_CURSOR_DESERT, HT_RECT); |
| 603 | this->last_user_action = widget; |
| 604 | break; |
| 605 | |
| 606 | case WID_ETT_PLACE_OBJECT: // Place transmitter button |
| 607 | ShowBuildObjectPicker(); |
| 608 | break; |
| 609 | |
| 610 | case WID_ETT_INCREASE_SIZE: |
| 611 | case WID_ETT_DECREASE_SIZE: { // Increase/Decrease terraform size |
| 612 | int size = (widget == WID_ETT_INCREASE_SIZE) ? 1 : -1; |
| 613 | this->HandleButtonClick(widget); |
| 614 | size += _terraform_size; |
| 615 | |
| 616 | if (!IsInsideMM(size, 1, 8 + 1)) return; |
| 617 | _terraform_size = size; |
| 618 | |
| 619 | this->SetDirty(); |
| 620 | break; |
| 621 | } |
| 622 | |
| 623 | case WID_ETT_NEW_SCENARIO: // gen random land |
| 624 | this->HandleButtonClick(widget); |
| 625 | ShowCreateScenario(); |
| 626 | break; |
| 627 | |
| 628 | case WID_ETT_RESET_LANDSCAPE: // Reset landscape |
nothing calls this directly
no test coverage detected