|
@@ -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("改名卡数量不足");
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|