合成修改
parent
f17e4e319a
commit
de27163861
|
@ -67,18 +67,18 @@ function CompoundHeroFirstUpStarListPanel:OnOpen(heroData,_openThisPanel,_curHer
|
|||
curSelectHeroList = {}
|
||||
if _curHeroData.dynamicId then curSelectHeroList[_curHeroData.dynamicId] = _curHeroData end
|
||||
this.HeroSortData(heroDataList)
|
||||
for i, v in pairs(heroDataList) do
|
||||
for n,w in pairs(FormationManager.formationList) do
|
||||
if HeroManager.heroResolveLicence[n] then
|
||||
for m = 1, #w.teamHeroInfos do
|
||||
if v.dynamicId==w.teamHeroInfos[m].heroId then
|
||||
local isFormationStr = HeroManager.GetHeroFormationStr(n)
|
||||
v.isFormation = isFormationStr
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- for i, v in pairs(heroDataList) do
|
||||
-- for n,w in pairs(FormationManager.formationList) do
|
||||
-- if HeroManager.heroResolveLicence[n] then
|
||||
-- for m = 1, #w.teamHeroInfos do
|
||||
-- if v.dynamicId==w.teamHeroInfos[m].heroId then
|
||||
-- local isFormationStr = HeroManager.GetHeroFormationStr(n)
|
||||
-- v.isFormation = isFormationStr
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
this.ScrollView:SetData(heroDataList, function (index, go)
|
||||
this.OnShowSingleCardData(go, heroDataList[index])
|
||||
end)
|
||||
|
@ -111,13 +111,14 @@ function this.OnClickEnterHero(go,heroData,type)
|
|||
this.OnShowSingleCardData(go,heroData,type)
|
||||
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||
end
|
||||
|
||||
local oldSelectGo
|
||||
function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
|
||||
local choosed = Util.GetGameObject(go.transform, "choosed")
|
||||
choosed:SetActive(false)
|
||||
if curSelectHeroList[heroData.dynamicId] then
|
||||
curSelectHeroList[heroData.dynamicId]=heroData
|
||||
choosed:SetActive(true)
|
||||
oldSelectGo = choosed
|
||||
end
|
||||
Util.GetGameObject(go.transform, "frame"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
|
||||
Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
|
||||
|
@ -140,12 +141,17 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
|
|||
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||
return
|
||||
end
|
||||
if LengthOfTable(curSelectHeroList)>=curNeedRoleNum then
|
||||
PopupTipPanel.ShowTip(Language[10660])
|
||||
return
|
||||
-- if LengthOfTable(curSelectHeroList)>=curNeedRoleNum then
|
||||
-- PopupTipPanel.ShowTip(Language[10660])
|
||||
-- return
|
||||
-- end
|
||||
if oldSelectGo then
|
||||
oldSelectGo:SetActive(false)
|
||||
end
|
||||
curSelectHeroList = {}
|
||||
curSelectHeroList[heroData.dynamicId]=heroData
|
||||
choosed:SetActive(true)
|
||||
oldSelectGo = choosed
|
||||
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||
end)
|
||||
-- Util.AddOnceClick(formationMask, function()
|
||||
|
@ -167,28 +173,28 @@ function this.HeroSortData(heroData)
|
|||
-- Log("#heroData "..#heroData)
|
||||
--Language[11108]
|
||||
table.sort(heroData, function(a, b)
|
||||
if (LengthOfTable( a.formationList) == 0 and LengthOfTable( b.formationList) == 0)
|
||||
or (LengthOfTable(a.formationList) > 0) and (LengthOfTable(b.formationList) > 0) then
|
||||
if a.lockState == b.lockState then
|
||||
if a.heroConfig.Star == b.heroConfig.Star then
|
||||
if a.lv == b.lv then
|
||||
if a.id ~= curHeroData.Id and b.id ~= curHeroData.Id or a.id == curHeroData.Id and b.id == curHeroData.Id then
|
||||
return a.id > b.id
|
||||
else
|
||||
return not a.id ~= curHeroData.Id and b.id == curHeroData.Id
|
||||
end
|
||||
else
|
||||
return a.lv < b.lv
|
||||
end
|
||||
else
|
||||
return a.heroConfig.Star < b.heroConfig.Star
|
||||
end
|
||||
else
|
||||
return a.lockState < b.lockState
|
||||
end
|
||||
else
|
||||
return LengthOfTable( a.formationList) == 0 and LengthOfTable(b.formationList) > 0
|
||||
end
|
||||
-- if (LengthOfTable( a.formationList) == 0 and LengthOfTable( b.formationList) == 0)
|
||||
-- or (LengthOfTable(a.formationList) > 0) and (LengthOfTable(b.formationList) > 0) then
|
||||
-- if a.lockState == b.lockState then
|
||||
-- if a.heroConfig.Star == b.heroConfig.Star then
|
||||
-- if a.lv == b.lv then
|
||||
-- -- if a.id ~= curHeroData.Id and b.id ~= curHeroData.Id or a.id == curHeroData.Id and b.id == curHeroData.Id then
|
||||
-- return a.id > b.id
|
||||
-- -- else
|
||||
-- -- return not a.id ~= curHeroData.Id and b.id == curHeroData.Id
|
||||
-- -- end
|
||||
-- else
|
||||
return a.lv > b.lv
|
||||
-- end
|
||||
-- else
|
||||
-- return a.heroConfig.Star < b.heroConfig.Star
|
||||
-- end
|
||||
-- else
|
||||
-- return a.lockState < b.lockState
|
||||
-- end
|
||||
-- else
|
||||
-- return LengthOfTable( a.formationList) == 0 and LengthOfTable(b.formationList) > 0
|
||||
-- end
|
||||
end)
|
||||
end
|
||||
function CompoundHeroFirstUpStarListPanel:AutoSelectHero()
|
||||
|
|
Loading…
Reference in New Issue