1
0
Fork 0

Merge branch 'ilmikko-town-rename' into allow-town-rename-mp

pull/13916/head
ilmikko 2025-03-29 19:05:21 +01:00
commit 8bbd817307
2 changed files with 6 additions and 1 deletions

View File

@ -536,6 +536,7 @@ struct EconomySettings {
TownCargoGenMode town_cargogen_mode; ///< algorithm for generating cargo from houses, @see TownCargoGenMode
bool allow_town_roads; ///< towns are allowed to build roads (always allowed when generating world / in SE)
TownFounding found_town; ///< town founding.
bool town_renaming_allowed; ///< users can rename towns, even in multiplayer
PlaceHouses place_houses; ///< players are allowed to place town houses.
bool station_noise_level; ///< build new airports when the town noise level is still within accepted limits
uint16_t town_noise_population[4]; ///< population to base decision on noise evaluation (@see town_council_tolerance)

View File

@ -383,7 +383,11 @@ public:
nvp->InitializeViewport(this, this->town->xy, ScaleZoomGUI(ZOOM_LVL_TOWN));
/* disable renaming town in network games if you are not the server */
this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, _networking && !_network_server);
bool renaming_disabled = _networking && !_network_server;
if (_settings_game.economy.town_renaming_allowed) {
renaming_disabled = false;
}
this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, renaming_disabled);
}
void Close([[maybe_unused]] int data = 0) override