diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagManager.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagManager.lua index 5b92a8e468..980f92e092 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagManager.lua @@ -143,6 +143,17 @@ function this.GetItemCountById(_itemId) return have end + +function this.GetItemNameById(_itemId) + local name = "" + if this.bagDatas[_itemId] then + name = this.bagDatas[_itemId].name + else + name=itemConfig[_itemId].Name + end + return name +end + --通过物品id获取物品数量 function this.GetItemById(_itemId) return this.bagDatas[_itemId] diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua index e13552f834..9f7c7f0c60 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua @@ -19,6 +19,7 @@ local upTuPoRankUpConfig={}--即将要突破的数据 local upStarRankUpConfig={}--即将要升星的数据 local curStarRankUpConfig={}--当前升星的数据 local curTuPoRankUpConfig={}--当前突破的数据 +local costId=0 --长按升级状态 local _isClicked = false --是否点击 local _isReqLvUp = false @@ -779,6 +780,7 @@ function this:UpdateHeroUpLvAndBreakMaterialShow() this.costList[i].icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(costItemList[i][1])) if BagManager.GetItemCountById(costItemList[i][1])%s",costItemList[i][2]) else this.costList[i].costText.text=string.format("%s",costItemList[i][2]) @@ -915,7 +917,8 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp) if isUpLvMaterials then this:DeleteLvUpMaterials() else - PopupTipPanel.ShowTip(Language[11813]) + --PopupTipPanel.ShowTip(Language[11813]) + this:ShowCostNotEnoughTip() end _isClicked = false _isLongPress = false @@ -927,9 +930,9 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp) else _isClicked = false if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then - PopupTipPanel.ShowTip(Language[11813]) + this:ShowCostNotEnoughTip() else - PopupTipPanel.ShowTip(Language[11814]) + this:ShowCostNotEnoughTip() end end end @@ -945,7 +948,7 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp) if isUpLvMaterials then this:DeleteLvUpMaterials() else - PopupTipPanel.ShowTip(Language[11813]) + this:ShowCostNotEnoughTip() end _isClicked = false _isLongPress = false @@ -955,7 +958,7 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp) if isUpLvMaterials then this:DeleteLvUpMaterials() else - PopupTipPanel.ShowTip(Language[11814]) + this:ShowCostNotEnoughTip() _isClicked = false _isLongPress = false this.isPressed = false @@ -963,6 +966,21 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp) end end end + + +function RoleInfoLayout:ShowCostNotEnoughTip() + if isHeroUpTuPo then + PopupTipPanel.ShowTip(BagManager.GetItemNameById(costId).."不足无法突破") + else + PopupTipPanel.ShowTip(BagManager.GetItemNameById(costId).."不足无法升级") + end + if costId==4 then + UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,4) + end +end + + + --长按升级结束后请求协议 function RoleInfoLayout:LongLvUpClick(oldLv) NetManager.HeroLvUpEvent(curHeroData.dynamicId,curHeroData.lv,oldLv,function (msg) @@ -1007,6 +1025,8 @@ function RoleInfoLayout:DeleteLvUpMaterials() this.ShowProAddVal(allAddProValOld) end + + --连续升级更新后端英雄数据 function RoleInfoLayout:DeleteLvUpMaterials2(msg) for i, v in pairs(herodatas) do