| 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) |
no test coverage detected