Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop

dev_chengFeng
ZhangBiao 2020-08-13 12:00:38 +08:00
commit a6d69bd001
6 changed files with 73 additions and 67 deletions

View File

@ -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
@ -126,9 +127,9 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
local formationMask = Util.GetGameObject(go.transform, "formationMask")
-- formationMask:SetActive(false)
formationMask:SetActive((heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108]) or heroData.lockState == 1)
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(heroData.isFormation ~= "" )
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive( heroData.lockState == 1)
formationMask:SetActive(false)-- LengthOfTable(heroData.formationList) ~= 0 or heroData.lockState == 1)
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(false)--(LengthOfTable(heroData.formationList) ~= 0 )
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive(false)--( heroData.lockState == 1)
Util.GetGameObject(go.transform, "noumenon"):SetActive( heroData.id == curHeroData.id )
local starGrid = Util.GetGameObject(go.transform, "star")
SetHeroStars(starGrid, heroData.star,1,nil,nil,Vector2.New(0,1))
@ -140,61 +141,66 @@ 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()
if #heroData.formationList ~= 0 then
local text = ""
for index, value in ipairs(heroData.formationList) do
text = HeroManager.GetHeroFormationStr(index)
end
PopupTipPanel.ShowTip(text)
return
end
if heroData.lockState == 1 then
PopupTipPanel.ShowTip(Language[11776])
return
end
end)
-- Util.AddOnceClick(formationMask, function()
-- if #heroData.formationList ~= 0 then
-- local text = ""
-- for index, value in ipairs(heroData.formationList) do
-- text = HeroManager.GetHeroFormationStr(index)
-- end
-- PopupTipPanel.ShowTip(text)
-- return
-- end
-- if heroData.lockState == 1 then
-- PopupTipPanel.ShowTip(Language[11776])
-- return
-- end
-- end)
end
function this.HeroSortData(heroData)
Log("#heroData "..#heroData)
-- Log("#heroData "..#heroData)
--Language[11108]
table.sort(heroData, function(a, b)
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormation == Language[11108]))
or (a.isFormation ~= "" and a.isFormation ~= Language[11108]) and (b.isFormation ~= "" and b.isFormation ~= Language[11108]) 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 (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (not b.dynamicId ~= "" and b.isFormation ~= Language[11108])
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()
curSelectHeroList = {}
for i = 1, #heroDataList do
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 then--
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and LengthOfTable(heroDataList[i].formationList) == 0 and heroDataList[i].lockState == 0 then--
curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i]
end
end

View File

@ -139,8 +139,8 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
local formationMask = Util.GetGameObject(go.transform, "formationMask")
-- formationMask:SetActive(false)
formationMask:SetActive((heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108]) or heroData.lockState == 1)
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(heroData.isFormation ~= "" )
formationMask:SetActive( #heroData.formationList ~= 0 or heroData.lockState == 1)--(heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108])
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(#heroData.formationList ~= 0)
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive( heroData.lockState == 1)
Util.GetGameObject(go.transform, "noumenon"):SetActive( heroData.id == curHeroData.Id )
local starGrid = Util.GetGameObject(go.transform, "star")
@ -178,11 +178,11 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
end)
end
function this.HeroSortData(heroData)
Log("#heroData "..#heroData)
-- Log("#heroData "..#heroData)
--Language[11108]
table.sort(heroData, function(a, b)
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormation == Language[11108]))
or (a.isFormation ~= "" and a.isFormation ~= Language[11108]) and (b.isFormation ~= "" and b.isFormation ~= Language[11108]) then
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
@ -201,7 +201,7 @@ function this.HeroSortData(heroData)
return a.lockState < b.lockState
end
else
return (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (not b.dynamicId ~= "" and b.isFormation ~= Language[11108])
return LengthOfTable( a.formationList) == 0 and LengthOfTable(b.formationList) > 0
end
end)
end
@ -209,7 +209,7 @@ function CompoundHeroUpStarListPanel:AutoSelectHero()
LogGreen("sssssssssssssssssssss")
curSelectHeroList = {}
for i = 1, #heroDataList do
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 then--
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and #heroDataList[i].formationList == 0 and heroDataList[i].lockState == 0 then--
LogGreen("heroDataList[i].dynamicId "..heroDataList[i].dynamicId)
curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i]
end

View File

@ -308,7 +308,7 @@ function this.UpdateUpStarPosHeroData(curSelectHeroList,_upStarData,go)
else
upStarMaterialIsAll[upStarData[2]]=1
Util.GetGameObject(curGo.transform,"add/add"):SetActive(false)
Util.GetGameObject(curGo.transform,"num"):GetComponent("Text").text=string.format("<color=#FFFFFFFF>%s/%s</color>", LengthOfTable(curSelectHeroList),upStarData[4])
Util.GetGameObject(curGo.transform,"num"):GetComponent("Text").text=string.format("<color=#00FF06>%s/%s</color>", LengthOfTable(curSelectHeroList),upStarData[4])
end
local curUpStarConsumeMaterial={}
for i, v in pairs(curSelectHeroList) do
@ -345,7 +345,7 @@ function this.UpdateUpStarPosHeroData2(curSelectHeroList)
local _curUpStarData = this.GetAllHeroCompoundData2(curSelectHeroConfig.config,curSelectHeroConfig,true)
if curSelectHero then this.UpdateHeroUpStarData(_curUpStarData) end
Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(false)
Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("<color=#FFFFFFFF>%s/%s</color>", LengthOfTable(curSelectHeroList),1)
Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("<color=#00FF06>%s/%s</color>", LengthOfTable(curSelectHeroList),1)
end
end
@ -372,7 +372,7 @@ function this.UpdateFirstHeroUpStarData(curHeroCompoundData)
proImage:GetComponent("Image").sprite=Util.LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
SetHeroStars(starGrid, heroConfig.Star,1,nil,-15.3)
if curSelectHero and curSelectHero.heroConfig then
num:GetComponent("Text").text=string.format("<color=#FFFFFF>%s/%s</color>",1,1)
num:GetComponent("Text").text=string.format("<color=#00FF06>%s/%s</color>",1,1)
else
num:GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>",0,1)
end

Binary file not shown.