四灵提交
parent
59c0d4a81e
commit
a5c837d8a7
|
@ -560,11 +560,7 @@ function this.SortHeroDatas(_heroDatas)
|
|||
if a.star == b.star then
|
||||
if a.lv == b.lv then
|
||||
if a.warPower == b.warPower then
|
||||
if a.id == b.id then
|
||||
return a.sortId > b.sortId
|
||||
else
|
||||
return a.id > b.id
|
||||
end
|
||||
return a.id > b.id
|
||||
else
|
||||
return a.warPower > b.warPower
|
||||
end
|
||||
|
@ -586,11 +582,7 @@ function this.SortHeroDatas(_heroDatas)
|
|||
if a.star == b.star then
|
||||
if a.heroConfig.Natural == b.heroConfig.Natural then
|
||||
if a.warPower == b.warPower then
|
||||
if a.id == b.id then
|
||||
return a.sortId > b.sortId
|
||||
else
|
||||
return a.id > b.id
|
||||
end
|
||||
return a.id > b.id
|
||||
else
|
||||
return a.warPower > b.warPower
|
||||
end
|
||||
|
|
|
@ -91,6 +91,17 @@ function this:SortHeros(data)
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
function this:SortHeros1(data)
|
||||
table.sort(data,function(a,b)
|
||||
if a.hero.warPower == b.hero.warPower then
|
||||
return a.hero.star > b.hero.star
|
||||
else
|
||||
return a.hero.warPower > b.hero.warPower
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function this:SetMyHeightPower()
|
||||
heightPower = 0
|
||||
for k,v in ipairs(myHeros) do
|
||||
|
@ -113,7 +124,11 @@ function this:RefreshItemData()
|
|||
end
|
||||
LogGreen(#data)
|
||||
this.empty:SetActive(false)
|
||||
this:SortHeros(data)
|
||||
if curIndex == 1 then
|
||||
this:SortHeros1(data)
|
||||
else
|
||||
this:SortHeros(data)
|
||||
end
|
||||
for k,v in pairs(itemList) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
|
@ -127,7 +142,7 @@ function this:RefreshItemData()
|
|||
end
|
||||
itemList[go].gameObject:SetActive(true)
|
||||
LogGreen(tostring(data[index]))
|
||||
itemList[go]:OnShow(curIndex,data[index],curType,heightPower)
|
||||
itemList[go]:OnShow(curIndex,data[index],curType,canHelpPower)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -294,11 +294,12 @@ function this.InitBaoDatas(_soulEquips)
|
|||
end
|
||||
--初始化单个宝物的数据
|
||||
function this.InitSingleTreasureData(_singleData)
|
||||
if _singleData==nil then
|
||||
if not _singleData or not _singleData.equipId then
|
||||
return
|
||||
end
|
||||
local single={}
|
||||
local staticId=_singleData.equipId
|
||||
LogGreen(staticId)
|
||||
local currJewel=jewelConfig[staticId]
|
||||
single.id=staticId
|
||||
single.idDyn=_singleData.id
|
||||
|
|
|
@ -77,8 +77,12 @@ end
|
|||
|
||||
function FourTrailSingleHelpHero:SetIcon1(heroData,player)
|
||||
local tempData = MonsterCampManager.GetFriendHelpHero(self.curType)
|
||||
if tempData and heroData.dynamicId == tempData.hero.dynamicId then
|
||||
if tempData.state == 1 then
|
||||
if self.heifhtPower < heroData.warPower then
|
||||
self.select.sprite = Util.LoadSprite("s_silingshilian_zhanliguogao")
|
||||
self.selectText.text = ""
|
||||
self.btn:GetComponent("Button").enabled = false
|
||||
elseif tempData and heroData.dynamicId == tempData.hero.dynamicId then
|
||||
if tempData.player and tempData.player.state == 1 then
|
||||
self.select.sprite = Util.LoadSprite("s_silingshilian_yishiyong")
|
||||
self.selectText.text = ""
|
||||
self.btn:GetComponent("Button").enabled = false
|
||||
|
@ -88,27 +92,26 @@ function FourTrailSingleHelpHero:SetIcon1(heroData,player)
|
|||
Util.AddOnceClick(self.btn, function()
|
||||
NetManager.UseHelpHeroRequest(heroData.dynamicId,self.curType,0,function()
|
||||
MonsterCampManager.SetFriendHelpHero(nil,self.curType)
|
||||
self:SetIcon1(heroData)
|
||||
self:SetIcon1(heroData,player)
|
||||
return
|
||||
end)
|
||||
end)
|
||||
end
|
||||
elseif self.heifhtPower < heroData.warPower then
|
||||
self.select.sprite = Util.LoadSprite("s_silingshilian_zhanliguogao")
|
||||
self.selectText.text = ""
|
||||
self.btn:GetComponent("Button").enabled = false
|
||||
else
|
||||
self.select.sprite = Util.LoadSprite("r_hero_button_001")
|
||||
self.selectText.text = "选择神将"
|
||||
self.btn:GetComponent("Button").enabled = true
|
||||
Util.AddOnceClick(self.btn, function()
|
||||
if tempData and tempData.state == 0 then
|
||||
if tempData and tempData.player and tempData.player.state == 0 then
|
||||
PopupTipPanel.ShowTip("已选择其他神将!")
|
||||
elseif tempData and tempData.state == 1 then
|
||||
elseif tempData and tempData.player and tempData.player.state == 1 then
|
||||
LogGreen(tempData.player.state)
|
||||
PopupTipPanel.ShowTip("今日已无使用助战次数!")
|
||||
else
|
||||
NetManager.UseHelpHeroRequest(heroData.dynamicId,self.curType,1,function()
|
||||
MonsterCampManager.SetFriendHelpHero(player,self.curType)
|
||||
self:SetIcon1(heroData)
|
||||
self:SetIcon1(heroData,player)
|
||||
return
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue