DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ChangeFilter()

void ScriptConsoleSoundsTab::ChangeFilter ( TStringArray classes,
TextListboxWidget widget,
EditBoxWidget filterWidget,
int categoryMask = -1,
bool ignoreScope = false )
inlineprotected

См. определение в файле ScriptConsoleSoundsTab.c строка 172

173 {
174 widget.ClearItems();
175
176 TStringArray filters;
177 PrepareFilters(filterWidget.GetText(),filters);
178
180
181 TStringArray itemsArray = TStringArray();
182
183 for (int i = 0; i < classes.Count(); i++)
184 {
185 string config_path = classes.Get(i);
186
187 int objects_count = GetGame().ConfigGetChildrenCount(config_path);
188 for (int j = 0; j < objects_count; j++)
189 {
190 string child_name;
191 bool add = false;
192 GetGame().ConfigGetChildName(config_path, j, child_name);
193
194 if (!filters.Count())
195 {
196 add = true;
197 }
198 else
199 {
200 foreach (int indx, string filter:filters)
201 {
202 string child_name_lower = child_name;
203 child_name_lower.ToLower();
204
205 if (child_name_lower.Contains(filter))
206 {
207 add = true;
208 break;
209 }
210 }
211 }
212 if (add)
213 itemsArray.Insert(child_name);
214 }
215 }
216
217 if (itemsArray)
218 {
219 itemsArray.Sort();
220 foreach (string it:itemsArray)
221 {
222 widget.AddItem(it, NULL, 0);
223 }
224 }
225
226 if (filters)
227 {
228 /*
229 if (m_FilterOrderReversed)
230 filters.Invert();
231 */
232 foreach (string f:filters)
233 {
234 TStringArray arr2 = itemsByFilters.Get(f);
235 if (arr2)
236 {
237 arr2.Sort();
238 foreach (string itm: arr2)
239 {
240 int row = widget.AddItem(itm, NULL, 0);
241 }
242 }
243 }
244 }
245
246
247 }
map
Определения ControlsXboxNew.c:4
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
void PrepareFilters(string filter, out TStringArray filters)
Определения ScriptConsoleSoundsTab.c:155
proto native CGame GetGame()
array< string > TStringArray
Определения EnScript.c:685
bool Contains(string sample)
Returns true if sample is substring of string.
Определения EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.

Перекрестные ссылки CGame::ConfigGetChildName(), CGame::ConfigGetChildrenCount(), string::Contains(), GetGame(), PrepareFilters() и string::ToLower().

Используется в ChangeFilterSound().