取消选择重新保存编队

dev_chengFeng
jiaoyangna 2021-02-23 15:56:15 +08:00
parent 186fd78744
commit d07d7da359
1 changed files with 15 additions and 0 deletions

View File

@ -91,6 +91,21 @@ function FourTrailSingleHelpHero:SetIcon1(heroData,player)
self.selectText.text = "取消选择"
Util.AddOnceClick(self.btn, function()
NetManager.UseHelpHeroRequest(heroData.dynamicId,self.curType,0,function()
local curFormation = FormationManager.GetFormationByID(1700 + self.curType)
--上阵列表赋值
local choosedList ={}
for j = 1, #curFormation.teamHeroInfos do
local teamInfo = curFormation.teamHeroInfos[j]
-- 加空判断避免不知名错误
if teamInfo and teamInfo.heroId ~= heroData.dynamicId then
table.insert(choosedList, {heroId = teamInfo.heroId,position=teamInfo.position})
end
end
FormationManager.RefreshFormation(
(1700 + self.curType),
choosedList,
FormationManager.formationList[(1700 + self.curType)].teamPokemonInfos
)
MonsterCampManager.SetFriendHelpHero(nil,self.curType)
self:SetIcon1(heroData,player)
return