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

Method UpdateOverlayCargoes

src/linkgraph/linkgraph_gui.cpp:670–678  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

668 * Update the overlay with the new cargo selection.
669 */
670void LinkGraphLegendWindow::UpdateOverlayCargoes()
671{
672 CargoTypes mask = 0;
673 for (uint c = 0; c < num_cargo; c++) {
674 if (!this->IsWidgetLowered(WID_LGL_CARGO_FIRST + c)) continue;
675 SetBit(mask, _sorted_cargo_specs[c]->Index());
676 }
677 this->overlay->SetCargoMask(mask);
678}
679
680void LinkGraphLegendWindow::OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count)
681{

Callers 1

OnClickMethod · 0.95

Calls 4

SetBitFunction · 0.85
IsWidgetLoweredMethod · 0.80
SetCargoMaskMethod · 0.80
IndexMethod · 0.45

Tested by

no test coverage detected