262 幻境阁系统-客户端 性能优化,在不需要排序列表的时候就不排序
| | |
| | | public void Display(int rowIndex) |
| | | { |
| | | |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | List<int> showItemList = manager.ShowItemList(type, isSort: true); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | |
| | | public void Display(int rowIndex) |
| | | { |
| | | |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | List<int> showItemList = manager.ShowItemList(type, isSort: true); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | |
| | | public void Display(int rowIndex) |
| | | { |
| | | |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | List<int> showItemList = manager.ShowItemList(type, isSort: true); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | |
| | | CheckTimeOut(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private void OnRefreshItemEvent(PackType type, int index, int itemID) |
| | | { |
| | | if (type != PackType.Item) |
| | | return; |
| | | //要与策划约定类型,避免频繁刷新 |
| | | if (ItemConfig.Get(itemID).Type != 146) |
| | | return; |
| | | UpdateRedPoint(); |
| | |
| | | if (!TryGetRowCountMax(type, out int rowCountMax) || type != nowType) |
| | | return 0; |
| | | int id = selectId; |
| | | List<int> list = ShowItemList(type, tabType); |
| | | List<int> list = ShowItemList(type, tabType, isSort: true); |
| | | if (list.IsNullOrEmpty() || !list.Contains(id)) |
| | | return 0; |
| | | int index = list.IndexOf(id); |
| | |
| | | return result == id; |
| | | } |
| | | |
| | | public List<int> ShowItemList(PhantasmPavilionType type, int tabType = 0) |
| | | public List<int> ShowItemList(PhantasmPavilionType type, int tabType = 0, bool isSort = false) |
| | | { |
| | | var resList = new List<int>(); |
| | | List<int> resList = new List<int>(); |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Model: |
| | |
| | | resList = GetTableKeys(type); |
| | | break; |
| | | } |
| | | if (isSort) |
| | | { |
| | | resList.Sort((int a, int b) => Cmp(a, b, type)); |
| | | } |
| | | return resList; |
| | | } |
| | | |
| | |
| | | public void Display(int rowIndex, CellView cellView) |
| | | { |
| | | int tabType = cellView.info.Value.infoInt1; |
| | | List<int> showItemList = manager.ShowItemList(type, tabType); |
| | | List<int> showItemList = manager.ShowItemList(type, tabType, isSort: true); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | |
| | | public void Display(int rowIndex,CellView cellView) |
| | | { |
| | | int tabType = cellView.info.Value.infoInt1; |
| | | List<int> showItemList = manager.ShowItemList(type, tabType); |
| | | List<int> showItemList = manager.ShowItemList(type, tabType, isSort: true); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |