瀏覽代碼

词牌选择升级等级修改

huangxiaoyue 1 年之前
父節點
當前提交
b2f5ba8d3c

+ 13 - 1
GameClient/Assets/Game/HotUpdate/Data/CardDataManager.cs

@@ -350,6 +350,18 @@ namespace GFGGame
             haveCount = _cardDicByType.ContainsKey(mainScore) ? _cardDicByType[mainScore].Count : 0;
         }
 
-
+        public static int GetNextUpCardNeedRoleLv(int cardLv) { 
+            int roleLv = RoleDataManager.lvl;
+            for (int i = roleLv + 1; i<RoleLevelCfgArray.Instance.dataArray.Length; i++)
+            {
+                int limit = RoleLevelCfgArray.Instance.GetCfg(i).cardLeverLimit;
+                if (cardLv < limit)
+                {
+                    roleLv = i;
+                    break;
+                }
+            }
+            return roleLv;
+        }
     }
 }

+ 8 - 12
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -615,6 +615,13 @@ namespace GFGGame
 
         private void OnClcikBtnAll()
         {
+            int lvLimit = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).cardLeverLimit;
+            if (_cardData.lv >= lvLimit)
+            {
+                PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级可继续升级词牌", CardDataManager.GetNextUpCardNeedRoleLv(_cardData.lv)));
+                return;
+            }
+
             ViewManager.Show<CardUpLevelView>(_cardData);
             //int cardUpLvGoldsNeed = 0;
             //for (int i = 0; i < itemsCount.Count; i++)
@@ -717,19 +724,8 @@ namespace GFGGame
             {
                 if (!showTips) return true;
 
-                int roleLv = RoleDataManager.lvl;
-                for (int i = roleLv + 1; i < RoleLevelCfgArray.Instance.dataArray.Length; i++)
-                {
-                    int limit = RoleLevelCfgArray.Instance.GetCfg(i).cardLeverLimit;
-                    if (_showLv < limit)
-                    {
-                        roleLv = i;
-                        break;
-                    }
-                }
-
                 if(_showLv < maxLv)
-                    PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级可继续升级词牌", roleLv));
+                    PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级可继续升级词牌", CardDataManager.GetNextUpCardNeedRoleLv(_showLv)));
 
                 return true;
             }

+ 3 - 4
GameClient/Assets/Game/HotUpdate/Views/Card/CardUpLevelView.cs

@@ -74,7 +74,6 @@ namespace GFGGame
 
         private void tidyData(int setLevel,string tidyType = "")
         {
-            _nowCountCanUpLevel = 0;
             _goldsHasNum = 0;
             _cumulativeGold = 0;
             int CumulativeExp = 0;
@@ -126,10 +125,10 @@ namespace GFGGame
                         if (_countCanUpMaxLevel < lvLimit)
                             _countCanUpMaxLevel += 1;
                     }
-                    else { 
-                        if (_nowCountCanUpLevel < lvLimit)
+                    else {
+                        if (_nowCountCanUpLevel < lvLimit) 
                             _nowCountCanUpLevel += 1;
-                        }
+                    }
                 }
                 else
                     break;

二進制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes