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

Method GetWidgetString

src/station_gui.cpp:555–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553 }
554
555 std::string GetWidgetString(WidgetID widget, StringID stringid) const override
556 {
557 if (widget == WID_STL_CAPTION) {
558 return GetString(STR_STATION_LIST_CAPTION, this->window_number, this->vscroll->GetCount());
559 }
560
561 if (widget == WID_STL_CARGODROPDOWN) {
562 if (this->filter.cargoes == 0) return GetString(this->filter.include_no_rating ? STR_STATION_LIST_CARGO_FILTER_ONLY_NO_RATING : STR_STATION_LIST_CARGO_FILTER_NO_CARGO_TYPES);
563 if (this->filter.cargoes == _cargo_mask) return GetString(this->filter.include_no_rating ? STR_STATION_LIST_CARGO_FILTER_ALL_AND_NO_RATING : STR_CARGO_TYPE_FILTER_ALL);
564 if (CountBits(this->filter.cargoes) == 1 && !this->filter.include_no_rating) return GetString(CargoSpec::Get(FindFirstBit(this->filter.cargoes))->name);
565 return GetString(STR_STATION_LIST_CARGO_FILTER_MULTIPLE);
566 }
567
568 return this->Window::GetWidgetString(widget, stringid);
569 }
570
571 DropDownList BuildCargoDropDownList(bool expanded) const
572 {

Callers

nothing calls this directly

Calls 4

CountBitsFunction · 0.85
FindFirstBitFunction · 0.85
GetStringFunction · 0.70
GetCountMethod · 0.45

Tested by

no test coverage detected