| 148 | } |
| 149 | |
| 150 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 151 | { |
| 152 | switch (widget) { |
| 153 | case WID_DT_CANAL: // Build canal button |
| 154 | if (_game_mode == GM_EDITOR) { |
| 155 | HandlePlacePushButton(this, WID_DT_CANAL, SPR_CURSOR_CANAL, HT_RECT); |
| 156 | } else { |
| 157 | HandlePlacePushButton(this, WID_DT_CANAL, SPR_CURSOR_CANAL, HT_RECT | HT_DIAGONAL); |
| 158 | } |
| 159 | break; |
| 160 | |
| 161 | case WID_DT_LOCK: // Build lock button |
| 162 | HandlePlacePushButton(this, WID_DT_LOCK, SPR_CURSOR_LOCK, HT_SPECIAL); |
| 163 | break; |
| 164 | |
| 165 | case WID_DT_DEMOLISH: // Demolish aka dynamite button |
| 166 | HandlePlacePushButton(this, WID_DT_DEMOLISH, ANIMCURSOR_DEMOLISH, HT_RECT | HT_DIAGONAL); |
| 167 | break; |
| 168 | |
| 169 | case WID_DT_DEPOT: // Build depot button |
| 170 | if (HandlePlacePushButton(this, WID_DT_DEPOT, SPR_CURSOR_SHIP_DEPOT, HT_RECT)) ShowBuildDocksDepotPicker(this); |
| 171 | break; |
| 172 | |
| 173 | case WID_DT_STATION: // Build station button |
| 174 | if (HandlePlacePushButton(this, WID_DT_STATION, SPR_CURSOR_DOCK, HT_SPECIAL)) ShowBuildDockStationPicker(this); |
| 175 | break; |
| 176 | |
| 177 | case WID_DT_BUOY: // Build buoy button |
| 178 | HandlePlacePushButton(this, WID_DT_BUOY, SPR_CURSOR_BUOY, HT_RECT); |
| 179 | break; |
| 180 | |
| 181 | case WID_DT_RIVER: // Build river button (in scenario editor) |
| 182 | if (_game_mode != GM_EDITOR) return; |
| 183 | HandlePlacePushButton(this, WID_DT_RIVER, SPR_CURSOR_RIVER, HT_RECT | HT_DIAGONAL); |
| 184 | break; |
| 185 | |
| 186 | case WID_DT_BUILD_AQUEDUCT: // Build aqueduct button |
| 187 | HandlePlacePushButton(this, WID_DT_BUILD_AQUEDUCT, SPR_CURSOR_AQUEDUCT, HT_SPECIAL); |
| 188 | break; |
| 189 | |
| 190 | default: return; |
| 191 | } |
| 192 | this->last_clicked_widget = widget; |
| 193 | } |
| 194 | |
| 195 | void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override |
| 196 | { |
nothing calls this directly
no test coverage detected