添加一键放入

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() function this:AutoSelectHero()
curSelectHeroList = {} curSelectHeroList = {}
for i = 1, #heroDataList do 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 if this.GetSelectNum()<curNeedRoleNum then
and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 and (not HarmonyManager.IsChangeColor(heroDataList[i].dynamicId) and(not HarmonyManager:IsEnvoy(heroDataList[i].dynamicId))) then local signData={}
table.insert(curSelectHeroList,heroDataList[i]) 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
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.ScrollView:SetData(heroDataList, function (index, go)
this.OnShowSingleCardData(go, heroDataList[index]) this.OnShowSingleCardData(go, heroDataList[index])
end,true,true) end,true,true)