* Select or deselect waypoint for coverage area highlight. * Selecting a waypoint will deselect a town. * @param *wp Waypoint in question * @param sel Select or deselect given waypoint */
| 3757 | * @param sel Select or deselect given waypoint |
| 3758 | */ |
| 3759 | void SetViewportCatchmentWaypoint(const Waypoint *wp, bool sel) |
| 3760 | { |
| 3761 | SetWindowDirtyForViewportCatchment(); |
| 3762 | /* Mark tiles dirty for redrawing and update selected waypoint if a different waypoint is already highlighted. */ |
| 3763 | if (sel && _viewport_highlight_waypoint != wp) { |
| 3764 | ClearViewportCatchment(); |
| 3765 | _viewport_highlight_waypoint = wp; |
| 3766 | MarkCatchmentTilesDirty(); |
| 3767 | /* Mark tiles dirty for redrawing and clear waypoint selection if deselecting highlight. */ |
| 3768 | } else if (!sel && _viewport_highlight_waypoint == wp) { |
| 3769 | MarkCatchmentTilesDirty(); |
| 3770 | _viewport_highlight_waypoint = nullptr; |
| 3771 | } |
| 3772 | /* Redraw the currently selected waypoint window */ |
| 3773 | if (_viewport_highlight_waypoint != nullptr) SetWindowDirty(WC_WAYPOINT_VIEW, _viewport_highlight_waypoint->index); |
| 3774 | } |
| 3775 | |
| 3776 | /** |
| 3777 | * Select or deselect waypoint for rectangle area highlight. |
no test coverage detected