diff --git a/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroFirstUpStarListPanel.lua b/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroFirstUpStarListPanel.lua index 7a55a150cf..181aec8ec7 100644 --- a/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroFirstUpStarListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroFirstUpStarListPanel.lua @@ -126,9 +126,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.formationList ~= 0 or heroData.lockState == 1) - Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(heroData.formationList ~= 0 ) - 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)) @@ -148,34 +148,34 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择 choosed:SetActive(true) 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 (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 + 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 + return not a.id ~= curHeroData.Id and b.id == curHeroData.Id end else return a.lv < b.lv @@ -187,14 +187,14 @@ 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 function CompoundHeroFirstUpStarListPanel:AutoSelectHero() curSelectHeroList = {} for i = 1, #heroDataList do - if LengthOfTable(curSelectHeroList) < curNeedRoleNum and heroDataList[i].formationList == 0 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 diff --git a/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroUpStarListPanel.lua b/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroUpStarListPanel.lua index 31828ad4c0..6a6604b514 100644 --- a/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroUpStarListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/CompoundHero/CompoundHeroUpStarListPanel.lua @@ -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 diff --git a/Assets/ManagedResources/~Lua/Modules/CompoundHero/view/CompoundHero_Compound.lua b/Assets/ManagedResources/~Lua/Modules/CompoundHero/view/CompoundHero_Compound.lua index 0e3aee19a1..56ab567596 100644 --- a/Assets/ManagedResources/~Lua/Modules/CompoundHero/view/CompoundHero_Compound.lua +++ b/Assets/ManagedResources/~Lua/Modules/CompoundHero/view/CompoundHero_Compound.lua @@ -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("%s/%s", LengthOfTable(curSelectHeroList),upStarData[4]) + Util.GetGameObject(curGo.transform,"num"):GetComponent("Text").text=string.format("%s/%s", 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("%s/%s", LengthOfTable(curSelectHeroList),1) + Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("%s/%s", 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("%s/%s",1,1) + num:GetComponent("Text").text=string.format("%s/%s",1,1) else num:GetComponent("Text").text=string.format("%s/%s",0,1) end