英雄升级突破材料不足提示
parent
b73735f7cb
commit
d11e4a90cc
|
@ -143,6 +143,17 @@ function this.GetItemCountById(_itemId)
|
||||||
return have
|
return have
|
||||||
end
|
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获取物品数量
|
--通过物品id获取物品数量
|
||||||
function this.GetItemById(_itemId)
|
function this.GetItemById(_itemId)
|
||||||
return this.bagDatas[_itemId]
|
return this.bagDatas[_itemId]
|
||||||
|
|
|
@ -19,6 +19,7 @@ local upTuPoRankUpConfig={}--即将要突破的数据
|
||||||
local upStarRankUpConfig={}--即将要升星的数据
|
local upStarRankUpConfig={}--即将要升星的数据
|
||||||
local curStarRankUpConfig={}--当前升星的数据
|
local curStarRankUpConfig={}--当前升星的数据
|
||||||
local curTuPoRankUpConfig={}--当前突破的数据
|
local curTuPoRankUpConfig={}--当前突破的数据
|
||||||
|
local costId=0
|
||||||
--长按升级状态
|
--长按升级状态
|
||||||
local _isClicked = false --是否点击
|
local _isClicked = false --是否点击
|
||||||
local _isReqLvUp = false
|
local _isReqLvUp = false
|
||||||
|
@ -779,6 +780,7 @@ function this:UpdateHeroUpLvAndBreakMaterialShow()
|
||||||
this.costList[i].icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(costItemList[i][1]))
|
this.costList[i].icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(costItemList[i][1]))
|
||||||
if BagManager.GetItemCountById(costItemList[i][1])<costItemList[i][2] then
|
if BagManager.GetItemCountById(costItemList[i][1])<costItemList[i][2] then
|
||||||
isUpLvMaterials=false
|
isUpLvMaterials=false
|
||||||
|
costId=costItemList[i][1]
|
||||||
this.costList[i].costText.text=string.format("<color=#FF0000FF>%s</color>",costItemList[i][2])
|
this.costList[i].costText.text=string.format("<color=#FF0000FF>%s</color>",costItemList[i][2])
|
||||||
else
|
else
|
||||||
this.costList[i].costText.text=string.format("<color=#c5dedb>%s</color>",costItemList[i][2])
|
this.costList[i].costText.text=string.format("<color=#c5dedb>%s</color>",costItemList[i][2])
|
||||||
|
@ -915,7 +917,8 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
|
||||||
if isUpLvMaterials then
|
if isUpLvMaterials then
|
||||||
this:DeleteLvUpMaterials()
|
this:DeleteLvUpMaterials()
|
||||||
else
|
else
|
||||||
PopupTipPanel.ShowTip(Language[11813])
|
--PopupTipPanel.ShowTip(Language[11813])
|
||||||
|
this:ShowCostNotEnoughTip()
|
||||||
end
|
end
|
||||||
_isClicked = false
|
_isClicked = false
|
||||||
_isLongPress = false
|
_isLongPress = false
|
||||||
|
@ -927,9 +930,9 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
|
||||||
else
|
else
|
||||||
_isClicked = false
|
_isClicked = false
|
||||||
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
|
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
|
||||||
PopupTipPanel.ShowTip(Language[11813])
|
this:ShowCostNotEnoughTip()
|
||||||
else
|
else
|
||||||
PopupTipPanel.ShowTip(Language[11814])
|
this:ShowCostNotEnoughTip()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -945,7 +948,7 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
|
||||||
if isUpLvMaterials then
|
if isUpLvMaterials then
|
||||||
this:DeleteLvUpMaterials()
|
this:DeleteLvUpMaterials()
|
||||||
else
|
else
|
||||||
PopupTipPanel.ShowTip(Language[11813])
|
this:ShowCostNotEnoughTip()
|
||||||
end
|
end
|
||||||
_isClicked = false
|
_isClicked = false
|
||||||
_isLongPress = false
|
_isLongPress = false
|
||||||
|
@ -955,7 +958,7 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
|
||||||
if isUpLvMaterials then
|
if isUpLvMaterials then
|
||||||
this:DeleteLvUpMaterials()
|
this:DeleteLvUpMaterials()
|
||||||
else
|
else
|
||||||
PopupTipPanel.ShowTip(Language[11814])
|
this:ShowCostNotEnoughTip()
|
||||||
_isClicked = false
|
_isClicked = false
|
||||||
_isLongPress = false
|
_isLongPress = false
|
||||||
this.isPressed = false
|
this.isPressed = false
|
||||||
|
@ -963,6 +966,21 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
|
||||||
end
|
end
|
||||||
end
|
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)
|
function RoleInfoLayout:LongLvUpClick(oldLv)
|
||||||
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curHeroData.lv,oldLv,function (msg)
|
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curHeroData.lv,oldLv,function (msg)
|
||||||
|
@ -1007,6 +1025,8 @@ function RoleInfoLayout:DeleteLvUpMaterials()
|
||||||
this.ShowProAddVal(allAddProValOld)
|
this.ShowProAddVal(allAddProValOld)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--连续升级更新后端英雄数据
|
--连续升级更新后端英雄数据
|
||||||
function RoleInfoLayout:DeleteLvUpMaterials2(msg)
|
function RoleInfoLayout:DeleteLvUpMaterials2(msg)
|
||||||
for i, v in pairs(herodatas) do
|
for i, v in pairs(herodatas) do
|
||||||
|
|
Loading…
Reference in New Issue