Przeglądaj źródła

推荐搭配新物品影响排序

zhaoyang 2 lat temu
rodzic
commit
cfed60fe1e

+ 18 - 12
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -114,16 +114,19 @@ namespace GFGGame
             return arrayList;
         }
 
-        public static List<int> SortItemListByHighScore(List<int> arrayList)
+        public static List<int> SortItemListByHighScore(List<int> arrayList, bool checkNew = false)
         {
             arrayList.Sort((int a, int b) =>
             {
-                bool isNewA = CheckIsDressUpItemNew(a);
-                bool isNewB = CheckIsDressUpItemNew(b);
-                if (isNewA != isNewB)
+                if (checkNew)
                 {
-                    if (isNewA) return -1;
-                    if (isNewB) return 1;
+                    bool isNewA = CheckIsDressUpItemNew(a);
+                    bool isNewB = CheckIsDressUpItemNew(b);
+                    if (isNewA != isNewB)
+                    {
+                        if (isNewA) return -1;
+                        if (isNewB) return 1;
+                    }
                 }
                 int scoreA = ItemDataManager.GetItemAdditionScore(a, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags); ;
                 int scoreB = ItemDataManager.GetItemAdditionScore(b, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags); ;
@@ -134,16 +137,19 @@ namespace GFGGame
             });
             return arrayList;
         }
-        public static List<int> SortItemListByLowScore(List<int> arrayList)
+        public static List<int> SortItemListByLowScore(List<int> arrayList, bool checkNew = false)
         {
             arrayList.Sort((int a, int b) =>
             {
-                bool isNewA = CheckIsDressUpItemNew(a);
-                bool isNewB = CheckIsDressUpItemNew(b);
-                if (isNewA != isNewB)
+                if (checkNew)
                 {
-                    if (isNewA) return -1;
-                    if (isNewB) return 1;
+                    bool isNewA = CheckIsDressUpItemNew(a);
+                    bool isNewB = CheckIsDressUpItemNew(b);
+                    if (isNewA != isNewB)
+                    {
+                        if (isNewA) return -1;
+                        if (isNewB) return 1;
+                    }
                 }
                 int scoreA = ItemDataManager.GetItemAdditionScore(a, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags); ;
                 int scoreB = ItemDataManager.GetItemAdditionScore(b, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags); ;

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -674,11 +674,11 @@ namespace GFGGame
                 _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
                 if (_scoreIndex == SORT_BY_HIGH_SCORE)
                 {
-                    _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3);
+                    _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
                 }
                 else if (_scoreIndex == SORT_BY_LOW_SCORE)
                 {
-                    _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3);
+                    _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
                 }
                 else
                 {