添加一键放入

dev_chengFeng
yuanshuai 2022-04-22 19:29:10 +08:00
parent 765134f4b3
commit 1114c62c97
1 changed files with 7 additions and 4 deletions

View File

@ -159,12 +159,15 @@ end
function this:AutoSelectHero()
curSelectHeroList = {}
for i = 1, #heroDataList do
if heroDataList[i].type == RoleUpStarMatType.item and LengthOfTable(curSelectHeroList) < curNeedRoleNum or heroDataList[i].type == RoleUpStarMatType.hero and LengthOfTable(curSelectHeroList) < curNeedRoleNum
and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 and (not HarmonyManager.IsChangeColor(heroDataList[i].dynamicId) and(not HarmonyManager:IsEnvoy(heroDataList[i].dynamicId))) then
table.insert(curSelectHeroList,heroDataList[i])
if this.GetSelectNum()<curNeedRoleNum then
local signData={}
signData.id=heroDataList[i].id
local residueNum=curNeedRoleNum-this.GetSelectNum()--剩余可选择数量
signData.num=heroDataList[i].num>=residueNum and residueNum or heroDataList[i].num
table.insert(curSelectHeroList,signData)
end
end
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
this.numText.text=string.format("%s/%s",this.GetSelectNum(),curNeedRoleNum)
this.ScrollView:SetData(heroDataList, function (index, go)
this.OnShowSingleCardData(go, heroDataList[index])
end,true,true)