diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua index a3e71c0a42..5c6f06da86 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua @@ -89,7 +89,7 @@ end function this.GetChapterData(allChapterId) if allChapterId and allChapterId > 0 then return allChapterData[allChapterId] - else + elseif not allChapterId then return allChapterData end end diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua index c39dbb0e9f..214f2a520a 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua @@ -57,6 +57,7 @@ end function FightLevelSingleChapterPanel:OnShow() this.OnShowPanel() + this.LeftOrRightBtnClickEvent() end function this.OnShowPanel() chapterData = FightLevelManager.GetChapterData(chapterId) @@ -96,12 +97,10 @@ function this.SetSingleLevel(levelDatas) levelList[i].transform.localPosition = Vector3.New(levelDatas[i].config.LevelPointPosition[1],levelDatas[i].config.LevelPointPosition[2],0) local prb1 = Util.GetGameObject(levelList[i], "prb1") local prb2 = Util.GetGameObject(levelList[i], "prb2") - prb1:SetActive(false) - prb2:SetActive(false) local isOpen = this.GetCurLevelIsOpen(levelDatas[i])-- -1 未开启 0 开启 1 需解锁上一关 2 等级不足 LogYellow("isOpen "..isOpen.." "..tostring(not (isOpen == 0))) - Util.SetGray(prb1, not (isOpen == 0)) - Util.SetGray(prb2, not (isOpen == 0)) + prb1:SetActive(false) + prb2:SetActive(false) -- levelList[i]:SetActive(not (levelDatas[i].nodeId > FightLevelManager.GetCurChapterLevelId())) if levelData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel then --主关卡 prb1:SetActive(true) @@ -153,6 +152,9 @@ function this.SetSingleLevel(levelDatas) end end) end + + Util.SetGray(prb1, not (isOpen == 0)) + Util.SetGray(prb2, not (isOpen == 0)) end end function this.SetlevelBox(_rewardBoxDatas) @@ -215,11 +217,30 @@ end --左右按钮 function this.LeftOrRightBtnClickEvent(index) --index 为空时 刷新下左右按钮的显示 下一章节未开启的时候不显示右按钮 相反 - + -- chapterData = FightLevelManager.GetChapterData(chapterId) + local upChapterId = chapterData.chapterId - 1 + local upChapterData = FightLevelManager.GetChapterData(upChapterId) + if upChapterData and upChapterId <= FightLevelManager.GetCurChapterId() then + this.leftBtn:SetActive(true) + else + this.leftBtn:SetActive(false) + end + + local downChapterId = chapterData.chapterId + 1 + local downChapterData = FightLevelManager.GetChapterData(upChapterId) + if downChapterData and downChapterId <= FightLevelManager.GetCurChapterId() then + this.rightBtn:SetActive(true) + else + this.rightBtn:SetActive(false) + end if index and index == 1 then--左 - + chapterId = upChapterId + chapterData = upChapterData + this.OnShowPanel() elseif index and index == 2 then--右 - + chapterId = downChapterId + chapterData = downChapterData + this.OnShowPanel() end end diff --git a/Assets/ManagedResources/~Lua/Modules/Ranking/RankingManager.lua b/Assets/ManagedResources/~Lua/Modules/Ranking/RankingManager.lua index c438e64108..8acf1582c9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Ranking/RankingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Ranking/RankingManager.lua @@ -45,7 +45,7 @@ function this.ReceiveRankingData(msg,fun) --滚动数据 local length=#this.curRankingData for i, rank in ipairs(msg.ranks) do - -- Log("UserRank "..rank.rankInfo.rank) + LogGreen("UserRank "..rank.rankInfo.rank.." userName "..rank.userName.." rank.rankInfo.param1 "..rank.rankInfo.param1) this.curRankingData[length+i]=rank end if #msg.ranks < 20 or #this.curRankingData >= 100 then diff --git a/Assets/ManagedResources/~Lua/Modules/Ranking/RankingSingleListPanel.lua b/Assets/ManagedResources/~Lua/Modules/Ranking/RankingSingleListPanel.lua index 54f2c34065..78cfa52b99 100644 --- a/Assets/ManagedResources/~Lua/Modules/Ranking/RankingSingleListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Ranking/RankingSingleListPanel.lua @@ -34,7 +34,14 @@ function RankingSingleListPanel:InitComponent() this.scrollParentView=Util.GetGameObject(self.gameObject,"RankList/ScrollParentView") this.itemPre=Util.GetGameObject(self.gameObject,"RankList/ScrollParentView/ItemPre") this.scrollView = nil - + this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scrollParentView.transform,this.itemPre, + nil,Vector2.New(903,571.1),1,1,Vector2.New(0,-10)) + this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0) + this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5) + this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5) + this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5) + this.scrollView.moveTween.MomentumAmount = 1 + this.scrollView.moveTween.Strength = 2 --this.titleName=Util.GetGameObject(self.gameObject,"RankList/ScrollTitleRoot/Name"):GetComponent("Text") --this.titleInfo=Util.GetGameObject(self.gameObject,"RankList/ScrollTitleRoot/Info"):GetComponent("Text") @@ -84,28 +91,14 @@ function RankingSingleListPanel:OnShow() this.scrollParentView:SetActive(true) end function this.PanelShowChange() - if this.scrollView then this.scrollView = nil end - if true then - this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scrollParentView.transform,this.itemPre, - nil,Vector2.New(903,571.1),1,1,Vector2.New(0,-10)) - this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0) - this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5) - this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5) - this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5) - this.scrollView.moveTween.MomentumAmount = 1 - this.scrollView.moveTween.Strength = 2 - this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 672, 0) + -- this.scrollView = nil + if not TabDataIndex then + this.scrollView:SetRectTransform(Vector2.New(903,571.1)) + this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 672- 339, 0) this.tabBox:SetActive(false) else - this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scrollParentView.transform,this.itemPre, - nil,Vector2.New(903,473.25),1,1,Vector2.New(0,-10)) - this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0) - this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5) - this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5) - this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5) - this.scrollView.moveTween.MomentumAmount = 1 - this.scrollView.moveTween.Strength = 2 - this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 773, 0) + this.scrollView:SetRectTransform(Vector2.New(903,473.25)) + this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 773 - 339, 0) this.tabBox:SetActive(true) curIndex = 1 this.TabCtrl:SetTabAdapter(this.TabAdapter) @@ -127,7 +120,7 @@ function this.SwitchView(index) oldSelect, curIndex = curIndex, index sData = _TabData[TabDataIndex][index].RankingSData this.name.text = sData.name - this.PanelShowChange() + -- this.PanelShowChange() this.GetRankInfo(sData.rankType,1) end --界面关闭时调用(用于子类重写) @@ -203,6 +196,12 @@ function this.SetRankingInfo(isTop, isAnim) elseif sData.rankType == RANK_TYPE.CELEBRATION_GUILD then dData = { rankInfo = {param1 = myRankData.param1}, score = myRankData.param1} + elseif sData.rankType == RANK_TYPE.FIGHTLEVEL_PROGRESS then + dData = { rankInfo = {param1 = myRankData.param1}, + force = myRankData.param1} + elseif sData.rankType == RANK_TYPE.FIGHTLEVEL_STAR then + dData = { rankInfo = {param1 = myRankData.param1}, + force = myRankData.param1} end this.SetInfoShow(this.infoGo,dData,sData.rankType) --数据拆分 @@ -349,26 +348,6 @@ function this.SetHeadInfo(root,head,frame,level) this.playerScrollHead[root]:SetLayer(this.sortingOrder) this.playerScrollHead[root]:SetEffectScale(0.8) end - - --- tab按钮自定义显示设置 -function this.TabAdapter(tab, index, status) - local img = Util.GetGameObject(tab, "Image") - local lockImage=Util.GetGameObject(tab,"LockImage") - local txt = Util.GetGameObject(tab, "Text") - - if status=="lock" then - lockImage:SetActive(true) - lockImage:GetComponent("Image").sprite = Util.LoadSprite(_tabImageData[status]) - txt:GetComponent("Text").text = RankingManager.GetTabTextData()[index].txt - txt:GetComponent("Text").color = _tabFontColor[status] - else - lockImage:SetActive(false) - img:GetComponent("Image").sprite = Util.LoadSprite(_tabImageData[status]) - txt:GetComponent("Text").text = RankingManager.GetTabTextData()[index].txt - txt:GetComponent("Text").color = _tabFontColor[status] - end -end --检查Tab是否解锁 function this.CheckTabCtrlIsLockP(index) local type = RankingManager.GetCurRankingInfo("Id",index) @@ -403,7 +382,7 @@ function this.SetInfoShow(go,data,rankType,Value0) goldExper:SetActive(false) arenaScore:SetActive(false) FightLeveStar:SetActive(false) - -- --LogGreen("rankType "..rankType) + LogGreen("rankType "..rankType) if rankType == RANK_TYPE.FIGHT_LEVEL_RANK then --LogGreen("data.rankInfo.param1 "..data.rankInfo.param1) if data.rankInfo.param1 and data.rankInfo.param1 > 0 then @@ -499,6 +478,7 @@ function this.SetInfoShow(go,data,rankType,Value0) Util.GetGameObject(go,"trial/Text"):GetComponent("Text").text = data.rankInfo.param1 end elseif rankType == RANK_TYPE.FIGHTLEVEL_PROGRESS then + LogYellow("data.rankInfo.param1 "..data.rankInfo.param1) if data.rankInfo.param1 and data.rankInfo.param1 > 0 then fight:SetActive(true) if Value0 then @@ -512,7 +492,7 @@ function this.SetInfoShow(go,data,rankType,Value0) if Value0 then Value0:GetComponent("Text").text = ""..data.userName.."" end - FightLeveStar:GetComponent("Text").text = data.rankInfo.param1 + Util.GetGameObject(FightLeveStar,"Text"):GetComponent("Text").text = data.rankInfo.param1 end end end diff --git a/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua b/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua index b1bb92ae1e..7263b19c57 100644 --- a/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua +++ b/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua @@ -532,5 +532,7 @@ end function this:GetItemDataIndex(go) return self.goItemDataRefList[go] end - +function this:SetRectTransform(scrollSizeDeltaV2) + self.rectTransform.sizeDelta = scrollSizeDeltaV2 +end return ScrollCycleView \ No newline at end of file