Add setting to enable non-admin multiplayer clients to rename towns

This commit is contained in:
Jonathan G Rennison
2021-03-14 16:44:15 +00:00
parent 3e6b06f7b0
commit 3f4333bcc8
9 changed files with 44 additions and 2 deletions

View File

@@ -354,7 +354,8 @@ public:
{
extern const Town *_viewport_highlight_town;
this->SetWidgetLoweredState(WID_TV_CATCHMENT, _viewport_highlight_town == this->town);
this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, _networking && !(_network_server || _network_settings_access));
this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, _networking && !(_network_server || _network_settings_access) &&
!(_local_company != COMPANY_SPECTATOR && _settings_game.difficulty.rename_towns_in_multiplayer));
this->DrawWidgets();
}
@@ -565,7 +566,7 @@ public:
{
if (str == nullptr) return;
DoCommandP(0, this->window_number, 0, CMD_RENAME_TOWN | CMD_MSG(STR_ERROR_CAN_T_RENAME_TOWN), nullptr, str);
DoCommandP(0, this->window_number, 0, ((_networking && !(_network_server || _network_settings_access)) ? CMD_RENAME_TOWN_NON_ADMIN : CMD_RENAME_TOWN) | CMD_MSG(STR_ERROR_CAN_T_RENAME_TOWN), nullptr, str);
}
bool IsNewGRFInspectable() const override