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

Method UpdateSelectSize

src/town_gui.cpp:1656–1673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1654 }
1655
1656 void UpdateSelectSize(const HouseSpec *spec)
1657 {
1658 if (spec == nullptr) {
1659 SetTileSelectSize(1, 1);
1660 ResetObjectToPlace();
1661 } else {
1662 SetObjectToPlaceWnd(SPR_CURSOR_TOWN, PAL_NONE, HT_RECT | HT_DIAGONAL, this);
1663 if (spec->building_flags.Test(BuildingFlag::Size2x2)) {
1664 SetTileSelectSize(2, 2);
1665 } else if (spec->building_flags.Test(BuildingFlag::Size2x1)) {
1666 SetTileSelectSize(2, 1);
1667 } else if (spec->building_flags.Test(BuildingFlag::Size1x2)) {
1668 SetTileSelectSize(1, 2);
1669 } else if (spec->building_flags.Test(BuildingFlag::Size1x1)) {
1670 SetTileSelectSize(1, 1);
1671 }
1672 }
1673 }
1674
1675 /**
1676 * Get a date range string for house availability year.

Callers

nothing calls this directly

Calls 4

SetTileSelectSizeFunction · 0.85
ResetObjectToPlaceFunction · 0.85
SetObjectToPlaceWndFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected