Codechange: use parameter pack/folding instead of va_arg macros for widget states

This commit is contained in:
Rubidium
2023-09-16 21:56:09 +02:00
committed by rubidium42
parent 30eba33f1e
commit 8ab0936491
17 changed files with 58 additions and 88 deletions

View File

@@ -519,16 +519,14 @@ public:
this->SetWidgetsDisabledState(this->vehicles.size() == 0 || _local_company != this->vli.company,
WID_GL_STOP_ALL,
WID_GL_START_ALL,
WID_GL_MANAGE_VEHICLES_DROPDOWN,
WIDGET_LIST_END);
WID_GL_MANAGE_VEHICLES_DROPDOWN);
/* Disable the group specific function when we select the default group or all vehicles */
this->SetWidgetsDisabledState(IsDefaultGroupID(this->vli.index) || IsAllGroupID(this->vli.index) || _local_company != this->vli.company,
WID_GL_DELETE_GROUP,
WID_GL_RENAME_GROUP,
WID_GL_LIVERY_GROUP,
WID_GL_REPLACE_PROTECTION,
WIDGET_LIST_END);
WID_GL_REPLACE_PROTECTION);
/* Disable remaining buttons for non-local companies
* Needed while changing _local_company, eg. by cheats
@@ -538,8 +536,7 @@ public:
*/
this->SetWidgetsDisabledState(_local_company != this->vli.company,
WID_GL_CREATE_GROUP,
WID_GL_AVAILABLE_VEHICLES,
WIDGET_LIST_END);
WID_GL_AVAILABLE_VEHICLES);
/* If not a default group and the group has replace protection, show an enabled replace sprite. */
uint16_t protect_sprite = SPR_GROUP_REPLACE_OFF_TRAIN;