2021-04-21 13:12:04 +08:00
|
|
|
|
----- 回溯 -----
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local this = {}
|
|
|
|
|
local sortType=0
|
|
|
|
|
local sortingOrder=0
|
|
|
|
|
local tarHero={}--当前筛选后显示英雄列表
|
|
|
|
|
local selectHeroData={}--选择的英雄list did = data
|
|
|
|
|
local oldChoosed=nil--上一个选中英雄
|
|
|
|
|
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
|
2020-07-24 12:11:00 +08:00
|
|
|
|
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2020-07-10 18:29:38 +08:00
|
|
|
|
local costItemId = 0
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
function this:InitComponent(gameObject)
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader = SpriteLoader.New()
|
2020-08-07 12:22:10 +08:00
|
|
|
|
this.helpBtn=Util.GetGameObject(gameObject,"Content/Resolve_Recall/HelpBtn")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.helpPos=this.helpBtn:GetComponent("RectTransform").localPosition
|
2020-08-07 12:22:10 +08:00
|
|
|
|
this.confirmBtn=Util.GetGameObject(gameObject,"Content/Resolve_Recall/ConfirmBtn")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--道具数量信息
|
2020-08-07 12:22:10 +08:00
|
|
|
|
this.usePropIcon=Util.GetGameObject(gameObject,"Content/Resolve_Recall/UseProps/Icon"):GetComponent("Image")
|
|
|
|
|
this.usePropInfo=Util.GetGameObject(gameObject,"Content/Resolve_Recall/UseProps/Info"):GetComponent("Text")
|
|
|
|
|
this.empty=Util.GetGameObject(gameObject,"Content/Resolve_Recall/Empty")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
this.cardPre = Util.GetGameObject(gameObject,"item")
|
2020-08-07 12:22:10 +08:00
|
|
|
|
this.scrollbar = Util.GetGameObject(gameObject,"Content/Resolve_Recall/Scrollbar"):GetComponent("Scrollbar")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local v21 = Util.GetGameObject(gameObject, "Content/Resolve_Recall/ItemListRoot"):GetComponent("RectTransform").rect
|
|
|
|
|
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(gameObject, "Content/Resolve_Recall/ItemListRoot").transform,
|
2020-09-02 19:30:56 +08:00
|
|
|
|
this.cardPre, this.scrollbar, Vector2.New(v21.width, v21.height), 1, 5, Vector2.New(43,15))
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.ScrollView.moveTween.MomentumAmount = 1
|
|
|
|
|
this.ScrollView.moveTween.Strength = 1
|
2021-04-21 13:12:04 +08:00
|
|
|
|
Util.GetGameObject(this.confirmBtn,"Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite("guiyuananniu_zh")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:BindEvent()
|
|
|
|
|
Util.AddClick(this.helpBtn,function()
|
|
|
|
|
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.Resolve_Recall,this.helpPos.x,this.helpPos.y)
|
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(this.confirmBtn,function()
|
|
|
|
|
if tonumber(LengthOfTable(selectHeroData))==0 then
|
2021-03-02 16:53:12 +08:00
|
|
|
|
PopupTipPanel.ShowTip(Language[11749])
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
2020-07-10 18:29:38 +08:00
|
|
|
|
if BagManager.GetItemCountById(costItemId)==0 then
|
|
|
|
|
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,costItemId)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ResolveRecall,
|
|
|
|
|
HeroManager.GetHeroReturnItems(selectHeroData,GENERAL_POPUP_TYPE.ResolveRecall),selectHeroData)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:AddListener()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:RemoveListener()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnShow(...)
|
|
|
|
|
local args={...}
|
|
|
|
|
sortingOrder =args[1]
|
2021-01-05 14:29:33 +08:00
|
|
|
|
sortType = PlayerManager.now_index or 0
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen(PlayerManager.now_index)
|
2021-11-05 15:48:22 +08:00
|
|
|
|
this.SortTypeClick(sortingOrder,sortType,args[3],args[4])
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnClose()
|
|
|
|
|
selectHeroData={}
|
|
|
|
|
oldChoosed=nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnDestroy()
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader:Destroy()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--展示数据
|
2021-11-05 15:48:22 +08:00
|
|
|
|
function this.SortTypeClick(_sort,_sortType,isTop,isAni)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
selectHeroData={}
|
|
|
|
|
|
|
|
|
|
tarHero={}
|
|
|
|
|
tarHero=this.GetHeroData(_sortType)
|
|
|
|
|
--设置empty
|
|
|
|
|
this.empty:SetActive(#tarHero==0)
|
|
|
|
|
--设置回溯按钮置灰
|
|
|
|
|
--Util.SetGray(this.confirmBtn,tonumber(LengthOfTable(selectHeroData))==0)
|
2021-03-04 10:16:07 +08:00
|
|
|
|
this.usePropIcon.gameObject:SetActive(tonumber(LengthOfTable(selectHeroData))~=0)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.usePropInfo.enabled=tonumber(LengthOfTable(selectHeroData))==0
|
2021-02-24 11:23:53 +08:00
|
|
|
|
this.usePropInfo.alignment= GetCurLanguage() ~= 2 and "MiddleCenter" or "MiddleRight"
|
2021-03-02 16:53:12 +08:00
|
|
|
|
this.usePropInfo.text=Language[11750]
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.usePropInfo.fontSize=25
|
|
|
|
|
|
|
|
|
|
--设置英雄显示
|
|
|
|
|
this.SortHeroDatas(tarHero)
|
|
|
|
|
this.ScrollView:SetData(tarHero, function (index, go)
|
|
|
|
|
this.SingleHeroDataShow(go, tarHero[index])
|
2021-02-26 14:52:59 +08:00
|
|
|
|
end,isTop,isAni)
|
2020-12-29 19:13:14 +08:00
|
|
|
|
-- this.ScrollView:ForeachItemGO(function(index, go)
|
|
|
|
|
-- Timer.New(function()
|
|
|
|
|
-- go.gameObject:SetActive(true)
|
|
|
|
|
-- PlayUIAnim(go.gameObject)
|
|
|
|
|
-- end, 0.001 * (index - 1)):Start()
|
|
|
|
|
-- end)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--获取筛选后的英雄数据
|
|
|
|
|
function this.GetHeroData(_sortType)
|
|
|
|
|
local tempHeros={}
|
2020-07-13 11:15:53 +08:00
|
|
|
|
local data=HeroManager.GetAllHeroDataMsinusUpWar(_sortType,1)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
for n=1,#data do
|
|
|
|
|
tempHeros[#tempHeros+1]=data[n]
|
|
|
|
|
end
|
|
|
|
|
--根据元素筛选
|
|
|
|
|
local heros={}
|
2020-07-22 16:25:10 +08:00
|
|
|
|
if tempHeros and LengthOfTable(tempHeros)>0 then
|
|
|
|
|
for i, v in pairs(tempHeros) do
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if _sortType ==0 then
|
|
|
|
|
table.insert(heros,v)
|
2020-07-10 18:29:38 +08:00
|
|
|
|
-- elseif _sortType>=7 then
|
|
|
|
|
-- if v.star==_sortType-4 then
|
|
|
|
|
-- table.insert(heros,v)
|
|
|
|
|
-- end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
2020-07-22 16:31:31 +08:00
|
|
|
|
if v.property==_sortType then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
table.insert(heros,v)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-07-10 18:29:38 +08:00
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
return heros
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--英雄单个数据展示
|
|
|
|
|
function this.SingleHeroDataShow(go,_heroData)
|
|
|
|
|
local heroData = _heroData
|
|
|
|
|
local _go = go
|
2021-04-21 13:12:04 +08:00
|
|
|
|
Util.GetGameObject(_go.transform, "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
|
2021-01-26 17:08:39 +08:00
|
|
|
|
Util.GetGameObject(_go.transform, "Text"):GetComponent("Text").text = SubString2(GetLanguageStrById(heroData.heroConfig.ReadingName),8)
|
2021-04-21 13:12:04 +08:00
|
|
|
|
Util.GetGameObject(_go.transform, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.icon)
|
|
|
|
|
Util.GetGameObject(_go.transform, "posIcon"):SetActive(false)--:GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.professionIcon)
|
|
|
|
|
Util.GetGameObject(_go.transform, "proIcon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
|
|
|
|
|
--Util.GetGameObject(_go.transform, "heroStage"):GetComponent("Image").sprite = this.spLoader:LoadSprite(HeroStageSprite[heroData.heroConfig.HeroStage])
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local starGrid = Util.GetGameObject(_go.transform, "star")
|
2021-10-26 16:00:31 +08:00
|
|
|
|
local star,starType = heroData.GetStar(1)
|
2021-10-27 12:50:15 +08:00
|
|
|
|
local starScale = -15
|
|
|
|
|
if starType == 3 then
|
2021-11-04 09:27:56 +08:00
|
|
|
|
starScale = -13
|
2021-10-27 12:50:15 +08:00
|
|
|
|
end
|
|
|
|
|
SetHeroStars(this.spLoader, starGrid, star,starType,nil,starScale)
|
2021-11-05 13:18:55 +08:00
|
|
|
|
Util.SetParticleSortLayer(starGrid,sortingOrder + 1)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local choosed =Util.GetGameObject(_go.transform, "choosed")
|
|
|
|
|
local formationMask =Util.GetGameObject(_go.transform, "formationMask")
|
2021-04-21 13:12:04 +08:00
|
|
|
|
Util.GetGameObject(_go.transform, "formationMask/formationImage/upImage"):GetComponent("Image").sprite = this.spLoader:LoadSprite("t_tongyong-yishangzheng_zh")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
formationMask:SetActive(heroData.isFormation ~= "" )
|
|
|
|
|
local lockMask =Util.GetGameObject(_go.transform, "lockMask")
|
|
|
|
|
lockMask:SetActive(heroData.lockState == 1)
|
|
|
|
|
choosed:SetActive(selectHeroData[heroData.dynamicId] ~= nil)
|
|
|
|
|
local cardclickBtn = Util.GetGameObject(_go.transform, "icon")
|
2020-12-18 16:37:56 +08:00
|
|
|
|
local GongMingMask = Util.GetGameObject(_go.transform, "GongMingMask")
|
|
|
|
|
GongMingMask:SetActive(false)--最后检测是否共鸣
|
|
|
|
|
if heroData.lockState == 1 or (heroData.isFormation ~= "") then
|
|
|
|
|
else
|
|
|
|
|
if HarmonyManager.IsChangeColor(_heroData.dynamicId) then
|
|
|
|
|
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = "<color=#0f0>"..heroData.lv.."</color>"
|
|
|
|
|
GongMingMask:SetActive(true)
|
2021-01-11 16:08:56 +08:00
|
|
|
|
elseif HarmonyManager:IsEnvoy(_heroData.dynamicId) and HarmonyManager:HongMengTowerUpLimit() ~= 0 then
|
2021-01-18 17:43:11 +08:00
|
|
|
|
if HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).heroTid == 0 then
|
2020-12-29 20:36:37 +08:00
|
|
|
|
-- body
|
|
|
|
|
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = "<color=#ffbe22>"..heroData.lv.."</color>"
|
|
|
|
|
GongMingMask:SetActive(true)
|
|
|
|
|
end
|
|
|
|
|
|
2020-12-18 16:37:56 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Util.AddOnceClick(GongMingMask, function()
|
2021-03-04 15:16:23 +08:00
|
|
|
|
PopupTipPanel.ShowTip(Language[12184])
|
2020-12-18 16:37:56 +08:00
|
|
|
|
end)
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Util.AddOnceClick(cardclickBtn, function()
|
|
|
|
|
if oldChoosed then
|
|
|
|
|
oldChoosed:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
if oldChoosed==choosed then
|
2021-01-09 14:20:06 +08:00
|
|
|
|
--LogColor("green","点的我自己")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
oldChoosed:SetActive(LengthOfTable(selectHeroData)==0)
|
|
|
|
|
oldChoosed=nil
|
|
|
|
|
selectHeroData={}
|
|
|
|
|
if LengthOfTable(selectHeroData)==0 then
|
2021-03-02 16:53:12 +08:00
|
|
|
|
this.usePropInfo.text=Language[11750]
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.usePropInfo.fontSize=25
|
|
|
|
|
end
|
|
|
|
|
else
|
2020-12-17 10:41:00 +08:00
|
|
|
|
HarmonyManager.IsGongMing(heroData.dynamicId)
|
2021-01-09 14:20:06 +08:00
|
|
|
|
--LogColor("red","别人")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
choosed:SetActive(true)
|
|
|
|
|
oldChoosed=choosed
|
|
|
|
|
|
|
|
|
|
selectHeroData = {}
|
|
|
|
|
selectHeroData[heroData.dynamicId]=heroData
|
|
|
|
|
this.usePropInfo.fontSize=35
|
|
|
|
|
--英雄消耗道具数量
|
|
|
|
|
local heroUseCount=0
|
2020-07-06 16:27:27 +08:00
|
|
|
|
local heroUseItemId=0
|
2020-07-10 18:29:38 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--等表配全后再启用
|
|
|
|
|
for k,v in pairs(selectHeroData) do
|
2020-07-24 12:11:00 +08:00
|
|
|
|
local pId
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local curHeroData =HeroManager.GetSingleHeroData(v.dynamicId)
|
|
|
|
|
if not curHeroData then return end
|
2020-07-24 12:11:00 +08:00
|
|
|
|
if curHeroData.breakId == 0 then
|
|
|
|
|
pId=0
|
|
|
|
|
else
|
|
|
|
|
pId= heroRankupConfig[curHeroData.breakId].Phase[2]
|
|
|
|
|
end
|
|
|
|
|
local heroReturnConfig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.HeroReturn,"HeroId",curHeroData.id,"Star",pId)
|
2020-07-22 16:31:31 +08:00
|
|
|
|
if not heroReturnConfig then
|
2020-07-24 12:14:52 +08:00
|
|
|
|
LogRed("HeroId"..curHeroData.id.." Star"..pId.." curHeroData.breakId"..curHeroData.breakId)
|
2020-07-22 16:31:31 +08:00
|
|
|
|
heroUseCount= 50
|
|
|
|
|
heroUseItemId = 16
|
|
|
|
|
else
|
2020-05-09 13:31:21 +08:00
|
|
|
|
heroUseCount= heroReturnConfig.ReturnConsume[1][2]
|
2020-07-06 16:27:27 +08:00
|
|
|
|
heroUseItemId = heroReturnConfig.ReturnConsume[1][1]
|
2020-07-22 16:31:31 +08:00
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
break
|
|
|
|
|
end
|
2020-07-10 18:29:38 +08:00
|
|
|
|
--持有道具数量
|
|
|
|
|
costItemId = heroUseItemId
|
|
|
|
|
local itemNum = BagManager.GetItemCountById(heroUseItemId)
|
2020-07-06 16:27:27 +08:00
|
|
|
|
if heroUseItemId > 0 then
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.usePropIcon.sprite = this.spLoader:LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,heroUseItemId).ResourceID))
|
2020-07-06 16:27:27 +08:00
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if itemNum<heroUseCount then
|
2020-07-16 10:49:01 +08:00
|
|
|
|
this.usePropInfo.text="<color=red> "..heroUseCount.."</color>"
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
2020-07-16 10:49:01 +08:00
|
|
|
|
this.usePropInfo.text=" "..heroUseCount
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--Util.SetGray(this.confirmBtn,LengthOfTable(selectHeroData)==0)
|
2021-03-04 10:16:07 +08:00
|
|
|
|
this.usePropIcon.gameObject:SetActive(LengthOfTable(selectHeroData)~=0)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
Util.AddOnceClick(formationMask, function()
|
|
|
|
|
if heroData.isFormation ~= "" then
|
|
|
|
|
-- 复位角色的状态
|
2021-03-02 16:53:12 +08:00
|
|
|
|
MsgPanel.ShowTwo(Language[11738]..heroData.isFormation..Language[11739], nil, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if heroData.isFormations[1] then
|
|
|
|
|
if heroData.isFormations[1] == FormationTypeDef.FORMATION_NORMAL then
|
|
|
|
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.SAVE_FORMATION)
|
|
|
|
|
elseif heroData.isFormations[1] == FormationTypeDef.FORMATION_ARENA_DEFEND then
|
|
|
|
|
JumpManager.GoJump(8001)
|
2020-08-27 09:40:25 +08:00
|
|
|
|
-- elseif heroData.isFormations[1] == FormationTypeDef.FORMATION_ENDLESS_MAP then
|
|
|
|
|
-- JumpManager.GoJump(57001)
|
2020-07-22 19:07:29 +08:00
|
|
|
|
elseif heroData.isFormations[1] == FormationTypeDef.EXPEDITION then
|
|
|
|
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.SAVE_FORMATION,FormationTypeDef.EXPEDITION)
|
2020-08-15 00:08:25 +08:00
|
|
|
|
elseif heroData.isFormations[1] == FormationTypeDef.ARENA_TOM_MATCH then
|
2020-08-25 17:50:52 +08:00
|
|
|
|
-- JumpManager.GoJump(57001)
|
|
|
|
|
UIManager.OpenPanel(UIName.ArenaTopMatchPanel)
|
2021-07-13 17:40:25 +08:00
|
|
|
|
elseif heroData.isFormations[1] == FormationTypeDef.JUMPSERVER_HIGHTLADDER then
|
|
|
|
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.JUMPSERVER_HIGHTLADDER)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
Util.AddOnceClick(lockMask, function()
|
|
|
|
|
if heroData.lockState == 1 then
|
2021-03-02 16:53:12 +08:00
|
|
|
|
MsgPanel.ShowTwo(Language[11740], nil, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
NetManager.HeroLockEvent(heroData.dynamicId,0,function ()
|
2021-03-02 16:53:12 +08:00
|
|
|
|
PopupTipPanel.ShowTip(Language[11741])
|
2020-05-09 13:31:21 +08:00
|
|
|
|
HeroManager.UpdateSingleHeroLockState(heroData.dynamicId,0)
|
|
|
|
|
lockMask:SetActive(false)
|
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--英雄排序
|
|
|
|
|
function this.SortHeroDatas(_heroDatas)
|
|
|
|
|
--上阵最优先,星级优先,同星级等级优先,同星级同等级按sortId排序。排序时降序排序。
|
|
|
|
|
table.sort(_heroDatas, function(a, b)
|
|
|
|
|
if a ==nil or b == nil then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if a.isFormation == "" and b.isFormation == "" then
|
|
|
|
|
if a.lockState == b.lockState then
|
2020-12-18 16:37:56 +08:00
|
|
|
|
if a.isHarmonyGongMing == b.isHarmonyGongMing then
|
|
|
|
|
if a.heroConfig.Natural ==b.heroConfig.Natural then
|
2021-11-08 15:04:53 +08:00
|
|
|
|
local aGodLv = GodSoulManager.GetGodSoulLv(a.dynamicId)
|
|
|
|
|
local bGodLv = GodSoulManager.GetGodSoulLv(b.dynamicId)
|
|
|
|
|
if aGodLv == bGodLv then
|
|
|
|
|
if a.star == b.star then
|
|
|
|
|
if a.lv == b.lv then
|
|
|
|
|
return a.heroConfig.Id > b.heroConfig.Id
|
|
|
|
|
else
|
|
|
|
|
return a.lv < b.lv
|
|
|
|
|
end
|
2020-12-18 16:37:56 +08:00
|
|
|
|
else
|
2021-11-08 15:04:53 +08:00
|
|
|
|
return a.star < b.star
|
2020-12-18 16:37:56 +08:00
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
2021-11-08 15:04:53 +08:00
|
|
|
|
return aGodLv > bGodLv
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
2020-12-18 16:37:56 +08:00
|
|
|
|
return a.heroConfig.Natural < b.heroConfig.Natural
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
2020-12-18 16:37:56 +08:00
|
|
|
|
return a.isHarmonyGongMing < b.isHarmonyGongMing
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
return a.lockState < b.lockState
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
return a.isFormation == "" and not b.dynamicId ~= ""
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
2021-04-21 13:12:04 +08:00
|
|
|
|
return this
|
|
|
|
|
|