一键升级修改

dev_chengFeng
yuanshuai 2022-12-19 15:27:18 +08:00
parent 3371b86e57
commit 305ad1343b
1 changed files with 4 additions and 3 deletions

View File

@ -150,7 +150,8 @@ function RoleInfoLayout:BindEvent()
--一键升级
Util.AddClick(this.upMaxLvBtn, function()
local oldUpMaxLv=this:CalUpMaxLv()
if curHeroData.lv>=oldUpMaxLv then
local openLv=this.GetCurHeroLvLimit()
if curHeroData.lv>=openLv then
PopupTipPanel.ShowTip("等级已达上限")
return
end
@ -159,7 +160,7 @@ function RoleInfoLayout:BindEvent()
return
end
if oldUpMaxLv==curHeroData.lv then
if curHeroData.lv<this.GetCurHeroLvLimit() and oldUpMaxLv==curHeroData.lv then
PopupTipPanel.ShowTip("材料不足")
return
end
@ -297,7 +298,7 @@ function this.GetCurHeroLvLimit()
if curHeroData.breakId > 0 then
curLvEnd = heroRankupConfig[curHeroData.breakId].OpenLevel
end
if curHeroData.upStarId > 0 then
if curHeroData.lv>= curLvEnd and curHeroData.upStarId > 0 then
if heroRankupConfig[curHeroData.upStarId].OpenLevel > curLvEnd then
curLvEnd = heroRankupConfig[curHeroData.upStarId].OpenLevel
end