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

Method GetStringParameter

src/newgrf_badge_gui.cpp:501–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501std::string NWidgetBadgeFilter::GetStringParameter(const BadgeFilterChoices &choices) const
502{
503 auto it = choices.find(this->badge_class);
504 if (it == std::end(choices)) {
505 return ::GetString(STR_BADGE_FILTER_ANY_LABEL, GetClassBadge(this->badge_class)->name);
506 }
507
508 return ::GetString(STR_BADGE_FILTER_IS_LABEL, GetClassBadge(it->first)->name, GetBadge(it->second)->name);
509}
510
511/**
512 * Get the drop down list of badges for this filter.

Callers 2

GetWidgetStringMethod · 0.80
GetWidgetStringMethod · 0.80

Calls 5

GetClassBadgeFunction · 0.85
GetBadgeFunction · 0.85
GetStringFunction · 0.70
endFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected