| 470 | } |
| 471 | |
| 472 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 473 | { |
| 474 | switch (widget) { |
| 475 | case WID_QES_LOCATION: { |
| 476 | const Sign *si = Sign::Get(this->cur_sign); |
| 477 | TileIndex tile = TileVirtXY(si->x, si->y); |
| 478 | if (_ctrl_pressed) { |
| 479 | ShowExtraViewportWindow(tile); |
| 480 | } else { |
| 481 | ScrollMainWindowToTile(tile); |
| 482 | } |
| 483 | break; |
| 484 | } |
| 485 | |
| 486 | case WID_QES_PREVIOUS: |
| 487 | case WID_QES_NEXT: { |
| 488 | const Sign *si = this->PrevNextSign(widget == WID_QES_NEXT); |
| 489 | |
| 490 | /* Rebuild the sign list */ |
| 491 | this->signs.ForceRebuild(); |
| 492 | this->signs.NeedResort(); |
| 493 | this->BuildSignsList(); |
| 494 | this->SortSignsList(); |
| 495 | |
| 496 | /* Scroll to sign and reopen window */ |
| 497 | ScrollMainWindowToTile(TileVirtXY(si->x, si->y)); |
| 498 | UpdateSignEditWindow(si); |
| 499 | break; |
| 500 | } |
| 501 | |
| 502 | case WID_QES_OK: |
| 503 | if (RenameSign(this->cur_sign, this->name_editbox.text.GetText())) break; |
| 504 | [[fallthrough]]; |
| 505 | |
| 506 | case WID_QES_CANCEL: |
| 507 | this->Close(); |
| 508 | break; |
| 509 | |
| 510 | case WID_QES_DELETE: |
| 511 | /* Only need to set the buffer to null, the rest is handled as the OK button */ |
| 512 | RenameSign(this->cur_sign, ""); |
| 513 | /* don't delete this, we are deleted in Sign::~Sign() -> DeleteRenameSignWindow() */ |
| 514 | break; |
| 515 | |
| 516 | case WID_QES_MOVE: |
| 517 | HandlePlacePushButton(this, WID_QES_MOVE, SPR_CURSOR_SIGN, HT_RECT); |
| 518 | this->last_user_action = widget; |
| 519 | break; |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override |
| 524 | { |
nothing calls this directly
no test coverage detected