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

Function BuildSetDropDownList

src/settings_gui.cpp:147–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145
146template <class T>
147DropDownList BuildSetDropDownList(int *selected_index)
148{
149 int n = T::GetNumSets();
150 *selected_index = T::GetIndexOfUsedSet();
151 DropDownList list;
152 for (int i = 0; i < n; i++) {
153 list.push_back(MakeDropDownListStringItem(GetListLabel(T::GetSet(i)), i));
154 }
155 return list;
156}
157
158std::set<int> _refresh_rates = { 30, 60, 75, 90, 100, 120, 144, 240 };
159

Callers

nothing calls this directly

Calls 3

GetListLabelFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected