Просмотр исходного кода

战斗套装部件显示分数

zhaoyang 3 лет назад
Родитель
Сommit
765b817f21

+ 37 - 21
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -44,10 +44,10 @@ namespace GFGGame
 
                 FunctionOpenCfg functionOpenCfg = FunctionOpenCfgArray.Instance.GetCfg(typeof(SuitListView).Name);
                 if (GameGlobal.myUnit != null//游戏角色初始数据不处理
-                    && itemCfg.rarity == ConstDressRarity.Rarity_TIANYI 
+                    && itemCfg.rarity == ConstDressRarity.Rarity_TIANYI
                     && StorageDataManager.Instance.GetStorageValue(ConstStorageId.FUNCTION_OPEN + functionOpenCfg.index) == 0)
                 {
-                    
+
                     FunctionOpenDataManager.Instance.CheckHasSpecialFunOpen();
                 }
             }
@@ -151,25 +151,41 @@ namespace GFGGame
             //五个属性中最大的为主属性
             mainScore = 1;
             mainScoreValue = 0;
-            if (itemCfg.score1 > mainScoreValue)
-            {
-                mainScoreValue = itemCfg.score1;
-                mainScore = 1;
-            }
-            if (itemCfg.score2 > mainScoreValue)
-            {
-                mainScoreValue = itemCfg.score2;
-                mainScore = 2;
-            }
-            if (itemCfg.score3 > mainScoreValue)
-            {
-                mainScoreValue = itemCfg.score3;
-                mainScore = 3;
-            }
-            if (itemCfg.score4 > mainScoreValue)
-            {
-                mainScoreValue = itemCfg.score4;
-                mainScore = 4;
+            // if (itemCfg.score1 > mainScoreValue)
+            // {
+            //     mainScoreValue = itemCfg.score1;
+            //     mainScore = 1;
+            // }
+            // if (itemCfg.score2 > mainScoreValue)
+            // {
+            //     mainScoreValue = itemCfg.score2;
+            //     mainScore = 2;
+            // }
+            // if (itemCfg.score3 > mainScoreValue)
+            // {
+            //     mainScoreValue = itemCfg.score3;
+            //     mainScore = 3;
+            // }
+            // if (itemCfg.score4 > mainScoreValue)
+            // {
+            //     mainScoreValue = itemCfg.score4;
+            //     mainScore = 4;
+            // }
+            mainScore = itemCfg.mainScore;
+            switch (mainScore)
+            {
+                case 1:
+                    mainScoreValue = itemCfg.score1;
+                    break;
+                case 2:
+                    mainScoreValue = itemCfg.score2;
+                    break;
+                case 3:
+                    mainScoreValue = itemCfg.score3;
+                    break;
+                case 4:
+                    mainScoreValue = itemCfg.score4;
+                    break;
             }
         }
         public static int GetItemScoreValue(int itemId, int scoreType)

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

@@ -729,16 +729,16 @@ namespace GFGGame
             ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
 
             listItem.m_ScoreType.visible = true;
-            int mainScore;
-            int mainValuel;
-            ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
-            listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + mainScore);
-
+            // int mainScore;
+            // int mainValuel;
+            // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
+            listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + _fightCfg.scoreType);
+            listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id, _fightCfg.scoreType);
 
             listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
             listItem.m_txtTitle.text = partName;
             listItem.target.data = id;
-            listItem.m_txtScore.visible = false;
+            // listItem.m_txtScore.visible = false;
             //listItem.m_ScoreType.visible = true;
             listItem.m_imgNeed.visible = false;