【森罗幻境】选择英雄按战力发送英雄顺序

dev_chengFeng
ZhangBiao 2021-04-14 20:00:06 +08:00
parent de85b844e5
commit 5ae5555011
2 changed files with 6 additions and 3 deletions

View File

@ -78,6 +78,9 @@ function FormationEditPopup:BindEvent()
for i, v in ipairs(choosedList) do for i, v in ipairs(choosedList) do
table.insert(dids,v.did) table.insert(dids,v.did)
end end
table.sort(dids,function (a,b)
return HeroManager.GetSingleHeroData(a.heroId).warPower > HeroManager.GetSingleHeroData(b.heroId).warPower
end)
if #choosedList <= maxNum and #choosedList > 0 then if #choosedList <= maxNum and #choosedList > 0 then
NetManager.TrialHeroInfoSaveRequest(dids,function(msg) NetManager.TrialHeroInfoSaveRequest(dids,function(msg)
PopupTipPanel.ShowTip(Language[10670]) PopupTipPanel.ShowTip(Language[10670])

View File

@ -518,9 +518,9 @@ function this.SetSelectHero(isFirstIn,isFirstData,isMainIn)
end end
end end
end end
table.sort(d,function (a,b) -- table.sort(d,function (a,b)
return HeroManager.GetSingleHeroData(a.heroId).warPower > HeroManager.GetSingleHeroData(b.heroId).warPower -- return HeroManager.GetSingleHeroData(a.heroId).warPower > HeroManager.GetSingleHeroData(b.heroId).warPower
end) -- end)
for i, v in ipairs(d) do for i, v in ipairs(d) do
if MapTrialManager.selectHeroDid ~= "" then if MapTrialManager.selectHeroDid ~= "" then
if MapTrialManager.selectHeroDid==v.heroId and v.heroHp <= 0 then if MapTrialManager.selectHeroDid==v.heroId and v.heroHp <= 0 then