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

Method OnDropdownSelect

src/town_gui.cpp:972–981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970 }
971
972 void OnDropdownSelect(WidgetID widget, int index, int) override
973 {
974 if (widget != WID_TD_SORT_CRITERIA) return;
975
976 if (this->towns.SortType() != index) {
977 this->towns.SetSortType(index);
978 this->last_sorting = this->towns.GetListing(); // Store new sorting order.
979 this->BuildSortTownList();
980 }
981 }
982
983 void OnPaint() override
984 {

Callers

nothing calls this directly

Calls 4

BuildSortTownListMethod · 0.95
SortTypeMethod · 0.80
SetSortTypeMethod · 0.80
GetListingMethod · 0.45

Tested by

no test coverage detected