添加一键放入
parent
765134f4b3
commit
1114c62c97
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue