| | 1 | | using System.Text.RegularExpressions; |
| | 2 | | using UIComponents.CollapsableSortedList; |
| | 3 | |
|
| | 4 | | public class CollapsableSortedFriendEntryList : CollapsableSortedListComponentView<string, FriendEntryBase> |
| | 5 | | { |
| | 6 | | public void Filter(string search) |
| | 7 | | { |
| 0 | 8 | | if (!gameObject.activeInHierarchy) return; |
| 0 | 9 | | var regex = new Regex(search, RegexOptions.IgnoreCase); |
| 0 | 10 | | Filter(entry => |
| | 11 | | { |
| 0 | 12 | | if (regex.IsMatch(entry.Model.userId)) return true; |
| 0 | 13 | | return !string.IsNullOrEmpty(entry.Model.userName) && regex.IsMatch(entry.Model.userName); |
| | 14 | | }); |
| | 15 | | // throttling may intruduce race conditions & artifacts into the ui |
| | 16 | | // StartCoroutine(FilterAsync(entry => regex.IsMatch(entry.model.userId) |
| | 17 | | // || regex.IsMatch(entry.model.userName))); |
| 0 | 18 | | } |
| | 19 | | } |