| 272 | } |
| 273 | |
| 274 | void UpdateSelectSize(const ObjectSpec *spec) |
| 275 | { |
| 276 | if (spec == nullptr) { |
| 277 | SetTileSelectSize(1, 1); |
| 278 | ResetObjectToPlace(); |
| 279 | } else { |
| 280 | _object_gui.sel_view = std::min<int>(_object_gui.sel_view, spec->views - 1); |
| 281 | SetObjectToPlaceWnd(SPR_CURSOR_TRANSMITTER, PAL_NONE, HT_RECT | HT_DIAGONAL, this); |
| 282 | int w = GB(spec->size, HasBit(_object_gui.sel_view, 0) ? 4 : 0, 4); |
| 283 | int h = GB(spec->size, HasBit(_object_gui.sel_view, 0) ? 0 : 4, 4); |
| 284 | SetTileSelectSize(w, h); |
| 285 | this->ReInit(); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | /** |
| 290 | * Update buttons to show the selection to the user. |
no test coverage detected