MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / UpdateSelectSize

Method UpdateSelectSize

src/object_gui.cpp:274–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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.

Callers 1

UpdateButtonsMethod · 0.95

Calls 6

SetTileSelectSizeFunction · 0.85
ResetObjectToPlaceFunction · 0.85
SetObjectToPlaceWndFunction · 0.85
GBFunction · 0.85
HasBitFunction · 0.85
ReInitMethod · 0.80

Tested by

no test coverage detected