From 8f2398c9322153eb305563b42e027253f4ebf035 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Tue, 2 Nov 2021 17:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B1=B1=E6=B2=B3=E7=A4=BE=E7=A8=B7?= =?UTF-8?q?=E5=9B=BE=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98=E5=8C=96=E9=80=89?= =?UTF-8?q?=E5=85=B3=E7=95=8C=E9=9D=A2=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Carbon/NewCarbon/CarbonsPanel.lua | 1 + .../Modules/FightLevel/FightLevelChapterPanel.lua | 15 +++++++++++---- .../~Lua/Modules/FightLevel/FightLevelManager.lua | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua index 9bb1c7f157..0e36c50199 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua @@ -375,6 +375,7 @@ function CarbonsPanel:BtnClick(id) end elseif id == FUNCTION_OPEN_TYPE.FIGHTLEVEL then if ActTimeCtrlManager.SingleFuncState(id) then + FightLevelManager.curSelect = 0 UIManager.OpenPanel(UIName.FightLevelChapterPanel) else PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(id)) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua index ef756e7ac5..cc0ecf7fef 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua @@ -35,6 +35,7 @@ end function FightLevelChapterPanel:BindEvent() Util.AddClick(self.btnBack, function() + FightLevelManager.curSelect = 0 self:ClosePanel() end) Util.AddClick(self.helpBtn, function() @@ -104,15 +105,19 @@ function this.OnShowPanel() curChapterId = FightLevelManager.GetCurChapterId() local allData = FightLevelManager.GetChapterData() this.ScrollView:SetData(allData, function (index, go) - this.SingleChapterDataShow(go, allData[index]) + this.SingleChapterDataShow(go, allData[index],index) end,true,true) - local curIndex = FightLevelManager.GetCurChapterId() - this.ScrollView:SetShow(curIndex) + if FightLevelManager.curSelect > 0 then + this.ScrollView:SetShow(FightLevelManager.curSelect) + else + local curIndex = FightLevelManager.GetCurChapterId() + this.ScrollView:SetShow(curIndex) + end -- 设置每日奖励显示 this:SetDailyRewardShow() end -function this.SingleChapterDataShow(go, data) +function this.SingleChapterDataShow(go, data,index) local playerParent = Util.GetGameObject(go, "playerParent") local cur = Util.GetGameObject(go, "cur") @@ -172,6 +177,7 @@ function this.SingleChapterDataShow(go, data) if PlayerManager.level >= data.config.Open then if curChapterId >= data.chapterId then UIManager.OpenPanel(UIName.FightLevelSingleChapterPanel,data.chapterId) + FightLevelManager.curSelect = index elseif curChapterId < data.chapterId then PopupTipPanel.ShowTip("通关上一章后解锁!") end @@ -203,6 +209,7 @@ end --界面关闭时调用(用于子类重写) function FightLevelChapterPanel:OnClose() + FightLevelManager.curSelect = 0 end --界面销毁时调用(用于子类重写) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua index 40695b23f9..a8739f9520 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua @@ -47,6 +47,7 @@ function this.Initialize() allChapterData[config.Id] = singleChapterData end end + this.curSelect = 0 end --后端更新章节信息 function this.UpdataChapterData(msg,_isShowChapterOpenPopup)