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

Method UpdateButtons

src/town_gui.cpp:1197–1218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195 }
1196
1197 void UpdateButtons(bool check_availability)
1198 {
1199 if (check_availability && _game_mode != GM_EDITOR) {
1200 if (_settings_game.economy.found_town != TF_CUSTOM_LAYOUT) this->town_layout = _settings_game.economy.town_layout;
1201 this->ReInit();
1202 }
1203
1204 for (WidgetID i = WID_TF_SIZE_SMALL; i <= WID_TF_SIZE_RANDOM; i++) {
1205 this->SetWidgetLoweredState(i, i == WID_TF_SIZE_SMALL + this->town_size);
1206 }
1207
1208 this->SetWidgetLoweredState(WID_TF_CITY, this->city);
1209
1210 for (WidgetID i = WID_TF_LAYOUT_ORIGINAL; i <= WID_TF_LAYOUT_RANDOM; i++) {
1211 this->SetWidgetLoweredState(i, i == WID_TF_LAYOUT_ORIGINAL + this->town_layout);
1212 }
1213
1214 this->SetWidgetLoweredState(WID_TF_EXPAND_BUILDINGS, FoundTownWindow::expand_modes.Test(TownExpandMode::Buildings));
1215 this->SetWidgetLoweredState(WID_TF_EXPAND_ROADS, FoundTownWindow::expand_modes.Test(TownExpandMode::Roads));
1216
1217 this->SetDirty();
1218 }
1219
1220 template <typename Tcallback>
1221 void ExecuteFoundTownCommand(TileIndex tile, bool random, StringID errstr, Tcallback cc)

Callers 4

FoundTownWindowMethod · 0.95
OnClickMethod · 0.95
OnPlaceObjectAbortMethod · 0.95
OnInvalidateDataMethod · 0.95

Calls 4

ReInitMethod · 0.80
SetWidgetLoweredStateMethod · 0.80
TestMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected