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

Method OnTooltip

src/rail_gui.cpp:489–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487 }
488
489 bool OnTooltip([[maybe_unused]] Point pt, WidgetID widget, TooltipCloseCondition close_cond) override
490 {
491 bool can_build = CanBuildVehicleInfrastructure(VEH_TRAIN);
492 if (can_build) return false;
493
494 if (std::ranges::find(can_build_widgets, widget) == std::end(can_build_widgets)) return false;
495
496 GuiShowTooltips(this, GetEncodedString(STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE), close_cond);
497 return true;
498 }
499
500 void OnInit() override
501 {

Callers

nothing calls this directly

Calls 5

GuiShowTooltipsFunction · 0.85
GetEncodedStringFunction · 0.70
findFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected