Codechange: allow certain enumeration to be added
Otherwise C++20 doesn't like it.
This commit is contained in:
@@ -666,9 +666,9 @@ bool LinkGraphLegendWindow::OnTooltip([[maybe_unused]] Point, WidgetID widget, T
|
||||
void LinkGraphLegendWindow::UpdateOverlayCompanies()
|
||||
{
|
||||
uint32_t mask = 0;
|
||||
for (uint c = 0; c < MAX_COMPANIES; c++) {
|
||||
if (this->IsWidgetDisabled(c + WID_LGL_COMPANY_FIRST)) continue;
|
||||
if (!this->IsWidgetLowered(c + WID_LGL_COMPANY_FIRST)) continue;
|
||||
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
||||
if (this->IsWidgetDisabled(WID_LGL_COMPANY_FIRST + c)) continue;
|
||||
if (!this->IsWidgetLowered(WID_LGL_COMPANY_FIRST + c)) continue;
|
||||
SetBit(mask, c);
|
||||
}
|
||||
this->overlay->SetCompanyMask(mask);
|
||||
@@ -680,8 +680,8 @@ void LinkGraphLegendWindow::UpdateOverlayCompanies()
|
||||
void LinkGraphLegendWindow::UpdateOverlayCargoes()
|
||||
{
|
||||
CargoTypes mask = 0;
|
||||
for (uint c = 0; c < num_cargo; c++) {
|
||||
if (!this->IsWidgetLowered(c + WID_LGL_CARGO_FIRST)) continue;
|
||||
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
||||
if (!this->IsWidgetLowered(WID_LGL_CARGO_FIRST + c)) continue;
|
||||
SetBit(mask, _sorted_cargo_specs[c]->Index());
|
||||
}
|
||||
this->overlay->SetCargoMask(mask);
|
||||
@@ -696,8 +696,8 @@ void LinkGraphLegendWindow::OnClick([[maybe_unused]] Point pt, WidgetID widget,
|
||||
this->UpdateOverlayCompanies();
|
||||
}
|
||||
} else if (widget == WID_LGL_COMPANIES_ALL || widget == WID_LGL_COMPANIES_NONE) {
|
||||
for (uint c = 0; c < MAX_COMPANIES; c++) {
|
||||
if (this->IsWidgetDisabled(c + WID_LGL_COMPANY_FIRST)) continue;
|
||||
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
||||
if (this->IsWidgetDisabled(WID_LGL_COMPANY_FIRST + c)) continue;
|
||||
this->SetWidgetLoweredState(WID_LGL_COMPANY_FIRST + c, widget == WID_LGL_COMPANIES_ALL);
|
||||
}
|
||||
this->UpdateOverlayCompanies();
|
||||
@@ -728,6 +728,6 @@ void LinkGraphLegendWindow::OnInvalidateData([[maybe_unused]] int data, [[maybe_
|
||||
|
||||
/* Disable the companies who are not active */
|
||||
for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) {
|
||||
this->SetWidgetDisabledState(i + WID_LGL_COMPANY_FIRST, !Company::IsValidID(i));
|
||||
this->SetWidgetDisabledState(WID_LGL_COMPANY_FIRST + i, !Company::IsValidID(i));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user