Add helper functions for network settings admin state

This commit is contained in:
Jonathan G Rennison
2024-02-27 18:11:13 +00:00
parent f186b640f6
commit 3a301cd986
7 changed files with 27 additions and 20 deletions

View File

@@ -2105,10 +2105,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase {
this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD);
/* Disable renaming engines in network games if you are not the server. */
this->SetWidgetDisabledState(WID_BV_RENAME, this->sel_engine == INVALID_ENGINE || (_networking && !_network_server));
/* disable renaming engines in network games if you are not the server */
this->SetWidgetDisabledState(WID_BV_RENAME, _networking && !(_network_server || _network_settings_access));
this->SetWidgetDisabledState(WID_BV_RENAME, this->sel_engine == INVALID_ENGINE || IsNonAdminNetworkClient());
this->DrawWidgets();