MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / UpdateOverlayCompanies

Method UpdateOverlayCompanies

src/linkgraph/linkgraph_gui.cpp:656–665  ·  view source on GitHub ↗

* Update the overlay with the new company selection. */

Source from the content-addressed store, hash-verified

654 * Update the overlay with the new company selection.
655 */
656void LinkGraphLegendWindow::UpdateOverlayCompanies()
657{
658 CompanyMask mask;
659 for (CompanyID c = CompanyID::Begin(); c < MAX_COMPANIES; ++c) {
660 if (this->IsWidgetDisabled(WID_LGL_COMPANY_FIRST + c)) continue;
661 if (!this->IsWidgetLowered(WID_LGL_COMPANY_FIRST + c)) continue;
662 mask.Set(c);
663 }
664 this->overlay->SetCompanyMask(mask);
665}
666
667/**
668 * Update the overlay with the new cargo selection.

Callers 1

OnClickMethod · 0.95

Calls 5

BeginFunction · 0.85
IsWidgetDisabledMethod · 0.80
IsWidgetLoweredMethod · 0.80
SetCompanyMaskMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected