940 {
941 widget.ClearItems();
942
945
946 string widgetText;
947 filterWidget.GetText(widgetText);
949
950 map<string,int> itemsAndColors = new map<string,int>();
951 map<string,ref TStringArray> itemsByFilters = new map<string,ref TStringArray>();
952
954
955 map<string, ref ScriptConsoleItem> items =
m_Developer.GetItems();
956 foreach (string itemName, ScriptConsoleItem itemData : items)
957 {
958 string displayName = "NO DISPLAY NAME";
959 if (itemData.m_DisplayName != string.Empty)
960 displayName = itemData.m_DisplayName;
961
962 int scope = itemData.m_Scope;
964 {
965 int categoryBit = itemData.m_CategoryMask;
966 categoryBit = (1 << categoryBit);
967
968 bool display = false;
969 bool matchWithDisplayName = false;
970 int color = 0;
971 if (categoryBit & categoryMask)
972 {
973 display = true;
974 }
976 {
977 string childNameLower = itemName;
979 string displayNameLower = displayName;
981
982 foreach (int indx, string filter : filters)
983 {
985 {
986 display = false;
987 color = filterColors.Get(indx);
989 if (!arr)
990 {
992 itemsByFilters.Set(filter, arr);
993 }
994
995 arr.Insert(itemName + " - [" + displayName + "]");
996 itemsAndColors.Insert(itemName + " - [" + displayName + "]",color);
997 break;
998 }
999 }
1000 }
1001 else if (categoryMask == 0)
1002 {
1003 display = true;
1004 }
1005
1006 if (display)
1007 {
1008 itemsArray.Insert(itemName + " - [" + displayName + "]");
1009 }
1010 }
1011 }
1012
1013 if (itemsArray)
1014 {
1015 itemsArray.Sort();
1016 foreach (string it : itemsArray)
1017 {
1018 widget.AddItem(it, NULL, 0);
1019 }
1020 }
1021
1022 if (filters)
1023 {
1025 filters.Invert();
1026
1027 foreach (string f : filters)
1028 {
1030 if (arr2)
1031 {
1032 arr2.Sort();
1033 foreach (string itm: arr2)
1034 {
1035 int row = widget.AddItem(itm, NULL, 0);
1036 int clr = itemsAndColors.Get(itm);
1037 if (clr)
1038 {
1039 widget.SetItemColor(row, 0, clr);
1040 }
1041 }
1042 }
1043 }
1044 }
1045 }
void PrepareFilters(string filter, out TStringArray filters, out TIntArray colors)
bool m_FilterOrderReversed
PluginDeveloper m_Developer
PluginConfigDebugProfile m_ConfigDebugProfile
class array< Class T > TStringArray
bool Contains(string sample)
Returns true if sample is substring of string.
proto int ToLower()
Changes string to lowercase. Returns length.