From c52addbfc5d656819d540794b325a9b4d85f3840 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 26 十一月 2025 11:31:14 +0800
Subject: [PATCH] 262 幻境阁系统-客户端 性能优化,在不需要排序列表的时候就不排序

---
 Main/System/PhantasmPavilion/PhantasmPavilionFaceCell.cs    |    2 +-
 Main/System/PhantasmPavilion/PhantasmPavilionManager.cs     |   15 +++++++--------
 Main/System/PhantasmPavilion/PhantasmPavilionTitleCell.cs   |    4 ++--
 Main/System/PhantasmPavilion/PhantasmPavilionChatBoxCell.cs |    2 +-
 Main/System/PhantasmPavilion/PhantasmPavilionModelCell.cs   |    2 +-
 Main/System/PhantasmPavilion/PhantasmPavilionFacePicCell.cs |    2 +-
 6 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionChatBoxCell.cs b/Main/System/PhantasmPavilion/PhantasmPavilionChatBoxCell.cs
index 1efa1b1..849b4fe 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionChatBoxCell.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionChatBoxCell.cs
@@ -9,7 +9,7 @@
     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++)
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionFaceCell.cs b/Main/System/PhantasmPavilion/PhantasmPavilionFaceCell.cs
index 544267a..a2c8052 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionFaceCell.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionFaceCell.cs
@@ -9,7 +9,7 @@
     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++)
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionFacePicCell.cs b/Main/System/PhantasmPavilion/PhantasmPavilionFacePicCell.cs
index bb842f7..7c244bf 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionFacePicCell.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionFacePicCell.cs
@@ -9,7 +9,7 @@
     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++)
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs b/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
index e2c81c2..b4d1eaa 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
@@ -80,14 +80,10 @@
         CheckTimeOut();
     }
 
-
-
-
     private void OnRefreshItemEvent(PackType type, int index, int itemID)
     {
         if (type != PackType.Item)
             return;
-        //瑕佷笌绛栧垝绾﹀畾绫诲瀷锛岄伩鍏嶉绻佸埛鏂�
         if (ItemConfig.Get(itemID).Type != 146)
             return;
         UpdateRedPoint();
@@ -116,7 +112,7 @@
         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);
@@ -346,9 +342,9 @@
         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:
@@ -361,7 +357,10 @@
                 resList = GetTableKeys(type);
                 break;
         }
-        resList.Sort((int a, int b) => Cmp(a, b, type));
+        if (isSort)
+        {
+            resList.Sort((int a, int b) => Cmp(a, b, type));
+        }
         return resList;
     }
 
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionModelCell.cs b/Main/System/PhantasmPavilion/PhantasmPavilionModelCell.cs
index 5f97812..6ed747c 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionModelCell.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionModelCell.cs
@@ -9,7 +9,7 @@
     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++)
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionTitleCell.cs b/Main/System/PhantasmPavilion/PhantasmPavilionTitleCell.cs
index 497c261..c51f539 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionTitleCell.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionTitleCell.cs
@@ -6,10 +6,10 @@
     readonly PhantasmPavilionType type = PhantasmPavilionType.Title;
     [SerializeField] List<PhantasmPavilionTitleItem> items = new List<PhantasmPavilionTitleItem>();
     PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
-    public void Display(int rowIndex,CellView cellView)
+    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++)

--
Gitblit v1.8.0