Browse Source

修改改名卡弹窗内容

leiyasi 1 year ago
parent
commit
8fb7546e12
1 changed files with 12 additions and 4 deletions
  1. 12 4
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/ChangeNameView.cs

+ 12 - 4
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/ChangeNameView.cs

@@ -102,11 +102,19 @@ namespace GFGGame
             string costName = ItemUtil.GetItemName(GlobalCfgArray.globalCfg.changeNameCostArr[0]);
             string costName = ItemUtil.GetItemName(GlobalCfgArray.globalCfg.changeNameCostArr[0]);
             int count = GlobalCfgArray.globalCfg.changeNameCostArr[1];
             int count = GlobalCfgArray.globalCfg.changeNameCostArr[1];
 
 
-            AlertUI.Show(string.Format("是否花费{0}个{1}改名1次?", count, costName))
-            .SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
+            long haveNum = ItemDataManager.GetItemNum(GlobalCfgArray.globalCfg.changeNameCostArr[0]);
+            if (haveNum >= count)
             {
             {
-                ChangeName(roleName);
-            });
+                AlertUI.Show(string.Format("是否花费{0}个{1}改名1次?", count, costName))
+                .SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
+                {
+                    ChangeName(roleName);
+                });
+            }
+            else
+            {
+                PromptController.Instance.ShowFloatTextPrompt("改名卡数量不足");
+            }
 
 
         }
         }