【ID1010843】

增加英雄回退功能
dev_chengFeng
jiaoyangna 2021-12-14 17:57:21 +08:00
parent 89a034a85e
commit 7e85eeaa90
1 changed files with 9 additions and 1 deletions

View File

@ -17,6 +17,7 @@ local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local itemNum = nil
local heroUseCount = nil
local heroUseItemId = nil
local returnHeroSame = 0
function this:InitComponent(gameObject)
this.spLoader = SpriteLoader.New()
this.titleText = Util.GetGameObject(gameObject, "TitleText"):GetComponent("Text")
@ -32,11 +33,15 @@ function this:BindEvent()
parent:ClosePanel()
end)
Util.AddClick(this.confirmBtn,function()
if returnHeroSame + LengthOfTable(HeroManager.GetAllHeroList()) - 1 > 999 then
PopupTipPanel.ShowTip("神将数量即将超出上限,请整理后再进行回退操作!")
return
end
local data
for k,v in pairs(selectHeroData) do
data=v.dynamicId
break
end
end
NetManager.HeroRetureEvent(data, function(msg)
local oldPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
HeroManager.ResetHeroStar(data)
@ -82,6 +87,9 @@ function this:OnShow(_parent,...)
local _data={}
for i=1,#dropList do
_data[i] = {dropList[i].id,dropList[i].num,nil,dropList[i].star}
if dropList[i].id == curhero.dynamicId then
returnHeroSame = dropList[i].num
end
end
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
table.sort(_data,function(a,b)