Merge branch 'china/dev-c' of http://60.1.1.230/gaoxin/JL_Client into china/dev-c
commit
35acdf34ef
|
@ -83,6 +83,11 @@ function this.SingleChapterDataShow(go, data)
|
|||
npc = PlayerLiveView:New(playerParent.transform,2, PlayerLiveViewData,this.sortingOrder)
|
||||
npc:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,0,0),WALK_DIR.IDLE_LEFT)
|
||||
end
|
||||
if curChapterId == data.chapterId then
|
||||
playerParent.gameObject:SetActive(true)
|
||||
else
|
||||
playerParent.gameObject:SetActive(false)
|
||||
end
|
||||
cur:SetActive(curChapterId == data.chapterId)
|
||||
open:SetActive(curChapterId > data.chapterId)
|
||||
lock:SetActive(curChapterId < data.chapterId)
|
||||
|
|
|
@ -115,15 +115,21 @@ function this.ShowChapterPoint()
|
|||
table.insert(allNodeDatas,value)
|
||||
end
|
||||
table.sort(allNodeDatas, function(a,b) return a.nodeId < b.nodeId end)
|
||||
local num = 0
|
||||
local points = {}
|
||||
for i = 1, #allNodeDatas do
|
||||
if allNodeDatas[i].config.UselessPoint then
|
||||
local isOpen = this.GetCurLevelIsOpen(allNodeDatas[i])-- -1 未开启 0 开启 1 需解锁上一关 2 等级不足
|
||||
for j = 1, #allNodeDatas[i].config.UselessPoint do
|
||||
num = num + 1
|
||||
table.insert(points,{allNodeDatas[i].config.UselessPoint[j][1],allNodeDatas[i].config.UselessPoint[j][2],isOpen})
|
||||
-- if allNodeDatas[i].config.UselessPoint[j + 1] then
|
||||
-- local posX = allNodeDatas[i].config.UselessPoint[j][1] + (allNodeDatas[i].config.UselessPoint[j + 1][1] - allNodeDatas[i].config.UselessPoint[j][1])/2
|
||||
-- local posY = allNodeDatas[i].config.UselessPoint[j][2] + (allNodeDatas[i].config.UselessPoint[j + 1][2] - allNodeDatas[i].config.UselessPoint[j][2])/2
|
||||
-- table.insert(points,{posX,posY,isOpen})
|
||||
-- end
|
||||
end
|
||||
end
|
||||
end
|
||||
for i = 1, math.max(#allSmallPoint , num) do
|
||||
for i = 1, math.max(#allSmallPoint , #points) do
|
||||
local go = allSmallPoint[i]
|
||||
if not go then
|
||||
go = newObject(this.pointPre)
|
||||
|
@ -135,18 +141,11 @@ function this.ShowChapterPoint()
|
|||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
local index = 0
|
||||
for i = 1, #allNodeDatas do
|
||||
local isOpen = this.GetCurLevelIsOpen(allNodeDatas[i])-- -1 未开启 0 开启 1 需解锁上一关 2 等级不足
|
||||
if allNodeDatas[i].config.UselessPoint then
|
||||
for j = 1, #allNodeDatas[i].config.UselessPoint do
|
||||
index = index + 1
|
||||
allSmallPoint[index].gameObject:SetActive(true)
|
||||
allSmallPoint[index].transform.localPosition = Vector3.New(allNodeDatas[i].config.UselessPoint[j][1],allNodeDatas[i].config.UselessPoint[j][2],0)
|
||||
local image = allSmallPoint[index]:GetComponent("Image")
|
||||
image.sprite = this.spLoader:LoadSprite(isOpen == 0 and point[1] or point[2])
|
||||
end
|
||||
end
|
||||
for i = 1, #points do
|
||||
allSmallPoint[i].gameObject:SetActive(true)
|
||||
allSmallPoint[i].transform.localPosition = Vector3.New(points[i][1],points[i][2],0)
|
||||
local image = allSmallPoint[i]:GetComponent("Image")
|
||||
image.sprite = this.spLoader:LoadSprite(points[i][3] == 0 and point[1] or point[2])
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -327,25 +326,30 @@ function this.LeftOrRightBtnClickEvent(index)
|
|||
-- chapterData = FightLevelManager.GetChapterData(chapterId)
|
||||
local upChapterId = chapterData.chapterId - 1
|
||||
local upChapterData = FightLevelManager.GetChapterData(upChapterId)
|
||||
local canLeft = true
|
||||
if upChapterData and upChapterId <= FightLevelManager.GetCurChapterId() then
|
||||
this.leftBtn:SetActive(true)
|
||||
else
|
||||
canLeft = false
|
||||
this.leftBtn:SetActive(false)
|
||||
end
|
||||
|
||||
local downChapterId = chapterData.chapterId + 1
|
||||
local downChapterData = FightLevelManager.GetChapterData(downChapterId)
|
||||
|
||||
local canRight = true
|
||||
if downChapterData and downChapterId <= FightLevelManager.GetCurChapterId() then
|
||||
this.rightBtn:SetActive(true)
|
||||
else
|
||||
canRight = false
|
||||
this.rightBtn:SetActive(false)
|
||||
end
|
||||
if index and index == 1 then--左
|
||||
if index and index == 1 and canLeft then--左
|
||||
chapterId = upChapterId
|
||||
chapterData = upChapterData
|
||||
this.OnShowPanel()
|
||||
this.LeftOrRightBtnClickEvent()
|
||||
elseif index and index == 2 then--右
|
||||
elseif index and index == 2 and canRight then--右
|
||||
chapterId = downChapterId
|
||||
chapterData = downChapterData
|
||||
this.OnShowPanel()
|
||||
|
|
Loading…
Reference in New Issue