关卡编队修改

zhangqiang 2020-09-11 23:07:45 +08:00
parent 71438e88c3
commit a077692c0f
2 changed files with 21 additions and 9 deletions

View File

@ -695,7 +695,7 @@ function this.GetPosList()
-- end
local list={}
for j = 1, 6 do
if data[j]==nil then
if not list[j] then
table.insert(list,j)
end
end
@ -835,9 +835,9 @@ end
function this.SetOneKeyGo()
--获取需要上阵的位置
local posArr=this.GetPosList()
for i = 1, #posArr do
Log("可上阵位置索引"..posArr[i])
end
-- for i = 1, #posArr do
-- Log("可上阵位置索引"..posArr[i])
-- end
if #posArr==0 then
PopupTipPanel.ShowTip(Language[10692])
return
@ -869,6 +869,7 @@ function this.SetOneKeyGo()
-- end
--修改 upHeroSidTable 静态id 存储 有则跳过
local upHeroSidTable = {}
this.order = 0
this.choosedList = {}
for j = 1, #this.choosedList do
local curSingleherodata = HeroManager.GetSingleHeroData(this.choosedList[j].heroId)
@ -880,10 +881,10 @@ function this.SetOneKeyGo()
LogGreen("this.choosedList "..#this.choosedList)
if #this.choosedList < 6 then
for n = 1, #posArr do
LogGreen("n posArr[n] "..n.." "..posArr[n])
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
table.remove(posArr,n)
this.order = this.order + 1
break
end
end
@ -894,7 +895,7 @@ function this.SetOneKeyGo()
-- for n = 1, #posArr do
-- table.insert(this.choosedList, {heroId = heros[n].dynamicId, position=posArr[n]})
-- end
this.order=this.order+#posArr
-- this.order=this.order+#posArr
this.SetCardsData()
this.OnClickTabBtn(proId)
end

View File

@ -18,12 +18,23 @@ function this.GetFormationIndex()
end
--- btn1点击回调事件
function this.On_Btn2_Click()
LogRed("hadClick "..tostring(hadClick).." this.root.order "..this.root.order)
if not hadClick then
hadClick = true
-- 编队为空
if #FormationManager.formationList[FormationManager.curFormationIndex].teamHeroInfos == 0 then
hadClick = false
-- -- 编队为空
-- if #FormationManager.formationList[FormationManager.curFormationIndex].teamHeroInfos == 0 then
-- hadClick = false
-- PopupTipPanel.ShowTip(Language[10702])
-- return
-- end
if this.root.order>=1 then
--保存编队
FormationManager.RefreshFormation(this.root.curFormationIndex, this.root.choosedList,
FormationManager.formationList[this.root.curFormationIndex].teamPokemonInfos)
else
PopupTipPanel.ShowTip(Language[10702])
hadClick = false
return
end