Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev
commit
7074527619
|
@ -314,6 +314,8 @@ function this.On_Btn2_Click()
|
||||||
|
|
||||||
--检测三个队伍是否有重复英雄
|
--检测三个队伍是否有重复英雄
|
||||||
local len = 0
|
local len = 0
|
||||||
|
local upHeros={}
|
||||||
|
local isSame=false
|
||||||
for key, value in pairs(allHeros) do
|
for key, value in pairs(allHeros) do
|
||||||
local newHero={}
|
local newHero={}
|
||||||
newHero.heroId=value.Id
|
newHero.heroId=value.Id
|
||||||
|
@ -325,13 +327,21 @@ function this.On_Btn2_Click()
|
||||||
elseif value.index==2003 then
|
elseif value.index==2003 then
|
||||||
table.insert(threeTeam,newHero)
|
table.insert(threeTeam,newHero)
|
||||||
end
|
end
|
||||||
|
if BattleUtil.ChecklistIsContainValue(upHeros,value.Id) then
|
||||||
|
isSame=true
|
||||||
|
else
|
||||||
|
table.insert(upHeros,value.Id)
|
||||||
|
end
|
||||||
len = len + 1
|
len = len + 1
|
||||||
end
|
end
|
||||||
if len <= 0 then
|
if len <= 0 then
|
||||||
PopupTipPanel.ShowTip(string.format(Language[10699], 1))
|
PopupTipPanel.ShowTip(string.format(Language[10699], 1))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if isSame then
|
||||||
|
PopupTipPanel.ShowTip("编队中有相同神将")
|
||||||
|
return
|
||||||
|
end
|
||||||
table.insert(allTeam,oneTeam)
|
table.insert(allTeam,oneTeam)
|
||||||
table.insert(allTeam,twoTeam)
|
table.insert(allTeam,twoTeam)
|
||||||
table.insert(allTeam,threeTeam)
|
table.insert(allTeam,threeTeam)
|
||||||
|
|
|
@ -101,9 +101,16 @@ local function OnEndDrag(self, Pointgo, data)
|
||||||
self.curFormation[2000 + currIndex] = self.curFormation[2000 + targetIndex]
|
self.curFormation[2000 + currIndex] = self.curFormation[2000 + targetIndex]
|
||||||
self.curFormation[2000 + targetIndex] = tempFormation
|
self.curFormation[2000 + targetIndex] = tempFormation
|
||||||
-- 保存
|
-- 保存
|
||||||
|
local upHeros={}
|
||||||
for i = 1, 3 do
|
for i = 1, 3 do
|
||||||
local heros = {}
|
local heros = {}
|
||||||
for _, hero in ipairs(self.curFormation[i+2000].teamHeroInfos) do
|
for _, hero in ipairs(self.curFormation[i+2000].teamHeroInfos) do
|
||||||
|
if BattleUtil.ChecklistIsContainValue(upHeros,hero.heroId) then
|
||||||
|
PopupTipPanel.ShowTip("编队中有相同神将!!")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
table.insert(upHeros,hero.heroId)
|
||||||
|
end
|
||||||
table.insert(heros, {heroId = hero.heroId, position = hero.position})
|
table.insert(heros, {heroId = hero.heroId, position = hero.position})
|
||||||
end
|
end
|
||||||
FormationManager.SaveFormation(i+2000, heros,
|
FormationManager.SaveFormation(i+2000, heros,
|
||||||
|
|
Loading…
Reference in New Issue