| 62 | } |
| 63 | |
| 64 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 65 | { |
| 66 | switch (widget) { |
| 67 | case WID_GOAL_GLOBAL_BUTTON: |
| 68 | ShowGoalsList(CompanyID::Invalid()); |
| 69 | break; |
| 70 | |
| 71 | case WID_GOAL_COMPANY_BUTTON: |
| 72 | ShowGoalsList(_local_company); |
| 73 | break; |
| 74 | |
| 75 | case WID_GOAL_LIST: { |
| 76 | int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GOAL_LIST, WidgetDimensions::scaled.framerect.top); |
| 77 | for (const Goal *s : Goal::Iterate()) { |
| 78 | if (s->company == this->window_number) { |
| 79 | if (y == 0) { |
| 80 | this->HandleClick(s); |
| 81 | return; |
| 82 | } |
| 83 | y--; |
| 84 | } |
| 85 | } |
| 86 | break; |
| 87 | } |
| 88 | |
| 89 | default: |
| 90 | break; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Handle clicking at a goal. |
nothing calls this directly
no test coverage detected